proxmox_kvm: add support for ciupgrade parameter (#9066)
* proxmox_kvm: add support for ciupgrade parameter * add changelog fragment * proxmox_kvm: version_added specifier for ciupgrade parameter * proxmox_kvm: remove default value from docs for ciupgrade parameterpull/9073/head
parent
67d1b6c413
commit
9069f673e2
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- proxmox_kvm - adds the ``ciupgrade`` parameter to specify whether cloud-init should upgrade system packages at first boot (https://github.com/ansible-collections/community.general/pull/9066).
|
|
@ -86,6 +86,11 @@ options:
|
|||
type: str
|
||||
choices: ['nocloud', 'configdrive2']
|
||||
version_added: 1.3.0
|
||||
ciupgrade:
|
||||
description:
|
||||
- 'cloud-init: do an automatic package upgrade after the first boot.'
|
||||
type: bool
|
||||
version_added: 10.0.0
|
||||
ciuser:
|
||||
description:
|
||||
- 'cloud-init: username of default user to create.'
|
||||
|
@ -984,6 +989,7 @@ class ProxmoxKvmAnsible(ProxmoxAnsible):
|
|||
# Available only in PVE 4
|
||||
only_v4 = ['force', 'protection', 'skiplock']
|
||||
only_v6 = ['ciuser', 'cipassword', 'sshkeys', 'ipconfig', 'tags']
|
||||
only_v8 = ['ciupgrade']
|
||||
|
||||
# valid clone parameters
|
||||
valid_clone_params = ['format', 'full', 'pool', 'snapname', 'storage', 'target']
|
||||
|
@ -1012,6 +1018,12 @@ class ProxmoxKvmAnsible(ProxmoxAnsible):
|
|||
if p in kwargs:
|
||||
del kwargs[p]
|
||||
|
||||
# The features work only on PVE 8
|
||||
if pve_major_version < 8:
|
||||
for p in only_v8:
|
||||
if p in kwargs:
|
||||
del kwargs[p]
|
||||
|
||||
# 'sshkeys' param expects an urlencoded string
|
||||
if 'sshkeys' in kwargs:
|
||||
urlencoded_ssh_keys = quote(kwargs['sshkeys'], safe='')
|
||||
|
@ -1207,6 +1219,7 @@ def main():
|
|||
cicustom=dict(type='str'),
|
||||
cipassword=dict(type='str', no_log=True),
|
||||
citype=dict(type='str', choices=['nocloud', 'configdrive2']),
|
||||
ciupgrade=dict(type='bool'),
|
||||
ciuser=dict(type='str'),
|
||||
clone=dict(type='str'),
|
||||
cores=dict(type='int'),
|
||||
|
@ -1414,6 +1427,7 @@ def main():
|
|||
cicustom=module.params['cicustom'],
|
||||
cipassword=module.params['cipassword'],
|
||||
citype=module.params['citype'],
|
||||
ciupgrade=module.params['ciupgrade'],
|
||||
ciuser=module.params['ciuser'],
|
||||
cpulimit=module.params['cpulimit'],
|
||||
cpuunits=module.params['cpuunits'],
|
||||
|
|
Loading…
Reference in New Issue