ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
812 stars 1.49k forks source link

proxmox_kvm: update is not idempotent #1965

Open ghost opened 3 years ago

ghost commented 3 years ago

Summary

If update: true the task is always reported as "changed"

Issue Type

Bug Report

Component Name

proxmox_kvm

Ansible Version

ansible 2.10.1

Configuration

No response

OS / Environment

No response

Steps To Reproduce

- name: VM
  community.general.proxmox_kvm:
    other params....
    vmid: 123
    update: true

Expected Results

Task should only change if anything got actually changed on the proxmox side. It should not report a change all the time.

Actual Results

"changed": true
...
"msg": "VM test with vmid 123 updated"
"vmid": 123
ansibullbot commented 3 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

cc @Aversiste @Thulium-Drake @helldorado @joshainglis @karmab click here for bot help

ansibullbot commented 2 years ago

cc @Ajpantuso click here for bot help

ohdearaugustin commented 2 years ago

I took a bit deeper look in that issue. As far as I could see this is a actual issue with the api of proxmox. To get this working the API must change or some workaround needs to be introduced into the ansible module. As the information can be retrieved in different ways.

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 1 year ago

cc @UnderGreen click here for bot help

ansibullbot commented 6 months ago

cc @krauthosting click here for bot help

Lithimlin commented 4 months ago

One workaround would probably be to get the current config beforehand and then compare it with the settings provided to the update call

eliasp commented 4 months ago

IMHO, update: true shouldn't be required in the first place. A single proxmox_kvm task should be sufficient.

It feels like it violates both design conventions: