Possibility to change attributes of existing hosts #457
-
Hi, I wonder if Ansible collection provides the ability to change attributes (tags) only on existing hosts. I am using the following playbook:
Works without problem for existing hosts. But if a host does not exist anything in CheckMK, the task creates the host. I was hoping that 'state: "present"' would make this change only take effect for existing hosts. The others are ignored. But in the script 'host.py' I see from line 349 that the attributes are only changed if "state == "present" and current_state == "present"". If "state == "present" and current_state == "absent"" (line 384) the host is always created with the attributes. Am I right that with Ansible I have no way to skip attribute changes if the host is not present? For your information, the list of hosts comes from a CMDB. Therefore it is possible that hosts are queried but not monitored in CheckMK. Thanks already |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @L4aShadow and my apologies for the late response! We did some work on the |
Beta Was this translation helpful? Give feedback.
Hi @L4aShadow and my apologies for the late response!
We are not monitoring discussions as closely as the issues, as this is more a place for announcements and less important discussions.
We did some work on the
host
module, so if you are experiencing issues with the latest version still, I would ask you to open an issue, so we can inspect the situation more closely.