community.general/lib/ansible/modules/windows/win_file_version.py

79 lines
1.6 KiB
Python
Raw Normal View History

2018-03-21 16:41:01 +00:00
#!/usr/bin/python
2015-11-11 05:30:09 +00:00
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Sam Liu <sam.liu@activenetwork.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
2015-11-11 05:30:09 +00:00
2017-08-16 03:16:38 +00:00
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
2015-11-11 05:30:09 +00:00
---
module: win_file_version
2016-03-08 07:24:02 +00:00
version_added: "2.1"
2016-03-16 00:44:29 +00:00
short_description: Get DLL or EXE file build version
2015-11-11 05:30:09 +00:00
description:
- Get DLL or EXE file build version.
notes:
- This module will always return no change.
2015-11-11 05:30:09 +00:00
options:
2016-03-08 07:24:02 +00:00
path:
description:
- File to get version.
- Always provide absolute path.
type: path
required: yes
seealso:
- module: win_file
author:
- Sam Liu (@SamLiu79)
2015-11-11 05:30:09 +00:00
'''
EXAMPLES = r'''
2015-11-11 05:30:09 +00:00
- name: Get acm instance version
win_file_version:
path: C:\Windows\System32\cmd.exe
2015-11-11 05:30:09 +00:00
register: exe_file_version
- debug:
msg: '{{ exe_file_version }}'
2015-11-11 05:30:09 +00:00
'''
2016-03-08 07:24:02 +00:00
RETURN = r'''
path:
2016-03-08 07:24:02 +00:00
description: file path
returned: always
type: str
2016-03-08 07:24:02 +00:00
file_version:
description: File version number..
2016-03-08 07:24:02 +00:00
returned: no error
type: str
2016-03-08 07:24:02 +00:00
product_version:
description: The version of the product this file is distributed with.
2016-03-08 07:24:02 +00:00
returned: no error
type: str
2016-03-08 07:24:02 +00:00
file_major_part:
2016-03-08 07:24:02 +00:00
description: the major part of the version number.
returned: no error
type: str
2016-03-08 07:24:02 +00:00
file_minor_part:
2016-03-08 07:24:02 +00:00
description: the minor part of the version number of the file.
returned: no error
type: str
2016-03-08 07:24:02 +00:00
file_build_part:
2016-03-08 07:24:02 +00:00
description: build number of the file.
returned: no error
type: str
2016-03-08 07:24:02 +00:00
file_private_part:
2016-03-08 07:24:02 +00:00
description: file private part number.
returned: no error
type: str
'''