I have this simple ansible playbook to install the CheckMK agent on linux hosts, create the host in CheckMK and register automatically. It works all fine, but existing hosts are moved to the root folder.
I usually just move the hosts in CheckMK directly as the environment is very heterogenic.
Is there a way around this except defining the folder path in the ansible inventory?
---
- hosts: all
become: true
roles:
- role: checkmk.general.agent
vars:
checkmk_agent_edition: cee
checkmk_agent_server: checkmk
checkmk_agent_server_ips: [10.x.x.x]
checkmk_agent_site: site1
checkmk_agent_server_protocol: https
checkmk_agent_user: user
checkmk_agent_secret: secret
checkmk_agent_add_host: true
checkmk_agent_discover: true
checkmk_agent_update: true
checkmk_agent_tls: true
checkmk_agent_prep_legacy: true
checkmk_agent_configure_firewall: true
checkmk_agent_host_attributes:
alias: "{{ hostvars[inventory_hostname]['human_description'] | default(omit) }}"