lae / ansible-role-proxmox

IaC for Proxmox VE clusters.
MIT License
468 stars 139 forks source link

Present but disabled storage breaks idempotency #203

Closed junousi closed 1 year ago

junousi commented 1 year ago

...or then I'm just setting some parameter the wrong way?

$ cat cluster.yml
pve_storages:
  - name: local
    type: dir
    path: /var/lib/vz
    disable: true
    state: present

Expected results:

RUN1
TASK [ansible-role-proxmox : Configure Proxmox Storage] *********************************************************************************************************************
changed: [server1] => (item={'name': 'local', 'type': 'dir', 'path': '/var/lib/vz', 'disable': True, 'state': 'present'})
RUN2
TASK [ansible-role-proxmox : Configure Proxmox Storage] *********************************************************************************************************************
ok: [server1] => (item={'name': 'local', 'type': 'dir', 'path': '/var/lib/vz', 'disable': True, 'state': 'present'})

Actual results:

RUN1
TASK [ansible-role-proxmox : Configure Proxmox Storage] *********************************************************************************************************************
changed: [server1] => (item={'name': 'local', 'type': 'dir', 'path': '/var/lib/vz', 'disable': True, 'state': 'present'})
RUN2
TASK [ansible-role-proxmox : Configure Proxmox Storage] *********************************************************************************************************************
changed: [server1] => (item={'name': 'local', 'type': 'dir', 'path': '/var/lib/vz', 'disable': True, 'state': 'present'})
lae commented 1 year ago

Likely a bug around here: https://github.com/lae/ansible-role-proxmox/blob/v1.7.1/library/proxmox_storage.py#L204

lae commented 1 year ago

Pushed a branch for this. Do you mind testing it?