Skip to content

Commit efb78f5

Browse files
authored
vmware_guest_tools_upgrade: New parameter installer_options (#1958)
vmware_guest_tools_upgrade: New parameter installer_options SUMMARY Fixes #1059 Add parameter installer_options to pass command line options to the installer to modify the installation procedure for tools. ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_guest_tools_upgrade ADDITIONAL INFORMATION Reviewed-by: Alexander Nikitin <ihumster@ihumster.ru>
1 parent b1a7235 commit efb78f5

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
minor_changes:
2+
- vmware_guest_tools_upgrade - Add parameter `installer_options` to pass command line options to the installer to modify the installation procedure for tools
3+
(https://github.com/ansible-collections/community.vmware/pull/1059).

plugins/modules/vmware_guest_tools_upgrade.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
default: false
7171
type: bool
7272
required: false
73+
installer_options:
74+
version_added: '4.1.0'
75+
description:
76+
- Command line options passed to the installer to modify the installation procedure for tools.
77+
type: str
78+
required: false
7379
extends_documentation_fragment:
7480
- community.vmware.vmware.documentation
7581
@@ -151,8 +157,12 @@ def upgrade_tools(self, vm):
151157
elif vm.guest.toolsStatus == "toolsOld":
152158
try:
153159
force = self.module.params.get('force_upgrade')
160+
installer_options = self.module.params.get('installer_options')
154161
if force or vm.guest.guestFamily in ["linuxGuest", "windowsGuest"]:
155-
task = vm.UpgradeTools()
162+
if installer_options is not None:
163+
task = vm.UpgradeTools(installer_options)
164+
else:
165+
task = vm.UpgradeTools()
156166
changed, err_msg = wait_for_task(task)
157167
result.update(changed=changed, msg=to_native(err_msg))
158168
else:
@@ -182,6 +192,7 @@ def main():
182192
folder=dict(type='str'),
183193
datacenter=dict(type='str', required=True),
184194
force_upgrade=dict(type='bool', default=False),
195+
installer_options=dict(type='str'),
185196
)
186197
module = AnsibleModule(
187198
argument_spec=argument_spec,

0 commit comments

Comments
 (0)