1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/modules/cloud
Tristan Le Guern 73f8338980
proxmox_kvm: fix idempotency issue with state=absent (#811)
When the `vmid` parameter is not supplied and the module can only rely on
name look-up an early failure can happen if the targeted VM doesn't exist.
In this case a task execution with the parameter `state` set to `absent`
will actually fail instead of being considered ok.

This patch introduces a deferred error-checking for non-existent VMs
by assigning the value -1 to the `vmid` parameter, allowing the actual
verification to be performed in the right code paths.
Is also help to differentiate between a non-existent `vmid` or non-existent
VM `name`.

Previously:

    TASK [ansible-role-proxmox-instance : Remove instance-test]
    changed: [localhost]
    ...
    TASK [ansible-role-proxmox-instance : Remove instance-test]
    fatal: [localhost]: FAILED! => changed=false
      msg: VM instance-test does not exist in cluster.

Now:

    TASK [ansible-role-proxmox-instance : Remove instance-test]
    ok: [localhost]
    ...
    TASK [ansible-role-proxmox-instance : Remove instance-test]
    ok: [localhost]

Update changelogs/fragments/811-proxmox-kvm-state-absent.yml

With suggestions from Felix Fontein <felix@fontein.de>.
2020-09-05 00:51:54 +02:00
..
alicloud
atomic sanity: Fix sanity check for modules (#587) 2020-07-31 10:57:57 +02:00
centurylink modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
dimensiondata
docker New Docker Stack Task Info Module with Tests (#732) 2020-08-05 08:16:32 +02:00
google Restore removed google modules (#675) 2020-07-21 07:45:32 +01:00
heroku
huawei
kubevirt
linode
lxc modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
lxd module lxd_container - added target parameter for cluster deployments (#711) 2020-07-30 12:30:25 +03:00
memset
misc proxmox_kvm: fix idempotency issue with state=absent (#811) 2020-09-05 00:51:54 +02:00
oneandone
online modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
opennebula modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
oracle
ovh
ovirt modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
packet modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
profitbricks
pubnub
rackspace modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
scaleway Scaleway Database Backup : Create new module (#741) 2020-09-03 15:02:30 +03:00
smartos modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
softlayer
spotinst modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
univention
webfaction
xenserver