Skip to content

[BUG] Updating Attributes is not idempotent #886

@bhuddah

Description

@bhuddah

Verify first that your issue is not already reported here.
Where possible also test if the latest release and main branch are affected too.
Complete all sections as described!

Describe the bug
Updating Attributes via checkmk.general.host is not idempotent.

Component Name

Component Name: checkmk.general.host

Ansible Version

$ ansible --version
ansible [core 2.17.14]

Checkmk Version and Edition

Checkmk Raw Edition 2.3.0p34

Collection Version

$ ansible-galaxy collection list
Collection                      Version
------------------------------- -------
ansible.netcommon               8.1.0
ansible.posix                   2.1.0
ansible.utils                   6.0.0
checkmk.general                 6.2.2
community.crypto                3.0.3
community.general               11.3.0

To Reproduce
Steps to reproduce the behavior:

  1. run task
  2. observe added labels
  3. run task again
  4. observe that there still are changes reported

Expected behavior

When run again, the task does not report changes.
Actual behavior

Minimum reproduction example

# Update only specified attributes
- name: "Update only specified attributes"
  checkmk.general.host:
    server_url: "http://myserver/"
    site: "mysite"
    automation_user: "myuser"
    automation_secret: "mysecret"
    name: "my_host"
    update_attributes: |
      {
      "labels": { "thisisatest": "this is a test" }
      }
    state: "present"

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingmodule:hostThis affects the host moduleneeds-infoFurther information is requested

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions