diff --git a/changelogs/fragments/8038-proxmox-startup.yml b/changelogs/fragments/8038-proxmox-startup.yml new file mode 100644 index 0000000000..f8afbc0c4e --- /dev/null +++ b/changelogs/fragments/8038-proxmox-startup.yml @@ -0,0 +1,2 @@ +minor_changes: + - proxmox - adds ``startup`` parameters to configure startup order, startup delay and shutdown delay (https://github.com/ansible-collections/community.general/pull/8038). diff --git a/plugins/modules/proxmox.py b/plugins/modules/proxmox.py index 0990169ca5..47f3faa4f2 100644 --- a/plugins/modules/proxmox.py +++ b/plugins/modules/proxmox.py @@ -81,6 +81,15 @@ options: type: list elements: str version_added: 2.0.0 + startup: + description: + - Specifies the startup order of the container. + - Use C(order=#) where C(#) is a non-negative number to define the general startup order. Shutdown in done with reverse ordering. + - Use C(up=#) where C(#) is in seconds, to specify a delay to wait before the next VM is started. + - Use C(down=#) where C(#) is in seconds, to specify a delay to wait before the next VM is stopped. + type: list + elements: str + version_added: 8.5.0 mounts: description: - specifies additional mounts (separate disks) for the container. As a hash/dictionary defining mount points @@ -761,6 +770,7 @@ def main(): ]), onboot=dict(type='bool'), features=dict(type='list', elements='str'), + startup=dict(type='list', elements='str'), storage=dict(default='local'), cpuunits=dict(type='int'), nameserver=dict(), @@ -859,6 +869,9 @@ def main(): features=",".join(module.params["features"]) if module.params["features"] is not None else None, + startup=",".join(module.params["startup"]) + if module.params["startup"] is not None + else None, description=module.params["description"], hookscript=module.params["hookscript"], timezone=module.params["timezone"], @@ -912,6 +925,7 @@ def main(): force=ansible_to_proxmox_bool(module.params['force']), pubkey=module.params['pubkey'], features=",".join(module.params['features']) if module.params['features'] is not None else None, + startup=",".join(module.params['startup']) if module.params['startup'] is not None else None, unprivileged=ansible_to_proxmox_bool(module.params['unprivileged']), description=module.params['description'], hookscript=module.params['hookscript'],