Files
2025-10-08 09:32:02 +02:00

28 lines
894 B
YAML

- name: "Delete Host at CheckMK Server"
checkmk.general.host:
server_url: "{{ checkmk_server_url }}"
site: "{{ checkmk_monitoring_site }}"
automation_user: "{{ checkmk_automation_user }}"
automation_secret: "{{ checkmk_automation_pass }}"
name: "{{ backupcow__hostname }}"
folder: "{{ checkmk_host_folder }}"
attributes:
ipaddress: "{{ bmx_ipv4_public }}"
state: absent
notify:
- Activate Changes
- Sign and bake pending agent jobs
- name: "Remove CheckMK Agent from Host"
ansible.builtin.apt:
name: "check-mk-agent"
state: absent
purge: true
when: ansible_facts['distribution'] == 'Ubuntu' or ansible_facts['distribution'] == 'Debian'
register: cmk_agent_removal
- name: "Purge CheckMK Agent Configuration from Host"
ansible.builtin.file:
name: "/var/lib/cmk-agent"
state: absent
when: cmk_agent_removal.changed