Skip to content

Commit

Permalink
fix ansible-collections#7600 add hookscript parameter to proxmox_kvm
Browse files Browse the repository at this point in the history
  • Loading branch information
elelay committed Nov 26, 2023
1 parent af5da7d commit dd61877
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7600-proxmox_kvm-hookscript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "proxmox_kvm - support the ``hookscript`` parameter
17 changes: 17 additions & 0 deletions plugins/modules/proxmox_kvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@
- Used only with clone
type: bool
default: true
hookscript:
description:
- Script that will be executed during various steps in the containers lifetime.
type: str
hostpci:
description:
- Specify a hash/dictionary of map host pci devices into guest. O(hostpci='{"key":"value", "key":"value"}').
Expand Down Expand Up @@ -867,6 +871,17 @@
name: spynal
node: sabrewulf-2
migrate: true
- name: Add hookscript to existing VM
community.general.proxmox_kvm:
api_user: root@pam
api_password: secret
api_host: helldorado
vmid: 999
node: sabrewulf
hookscript: local:snippets/hookscript.pl
update: true
'''

RETURN = '''
Expand Down Expand Up @@ -1214,6 +1229,7 @@ def main():
format=dict(type='str', choices=['cloop', 'cow', 'qcow', 'qcow2', 'qed', 'raw', 'vmdk', 'unspecified']),
freeze=dict(type='bool'),
full=dict(type='bool', default=True),
hookscript=dict(type='str'),
hostpci=dict(type='dict'),
hotplug=dict(type='str'),
hugepages=dict(choices=['any', '2', '1024']),
Expand Down Expand Up @@ -1432,6 +1448,7 @@ def main():
efidisk0=module.params['efidisk0'],
force=module.params['force'],
freeze=module.params['freeze'],
hookscript=module.params['hookscript'],
hostpci=module.params['hostpci'],
hotplug=module.params['hotplug'],
hugepages=module.params['hugepages'],
Expand Down

0 comments on commit dd61877

Please sign in to comment.