2025-01-11 12:44:28 +01:00
|
|
|
---
|
|
|
|
|
2025-01-14 11:07:46 +01:00
|
|
|
- name: Gather Icinga2 Agent facts
|
|
|
|
delegate_to: "{{ icinga2_agent }}"
|
|
|
|
delegate_facts: true
|
|
|
|
ansible.builtin.setup:
|
|
|
|
gather_subset: default_ipv4
|
|
|
|
register: i2_agent
|
|
|
|
|
2025-01-12 11:02:58 +01:00
|
|
|
- name: Allow incoming icinga2
|
|
|
|
become: true
|
2025-01-14 11:07:46 +01:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: nftables/input.d/icinga2.conf.j2
|
2025-01-12 11:02:58 +01:00
|
|
|
dest: /etc/nftables/input.d/icinga2.conf
|
|
|
|
mode: 0640
|
|
|
|
notify: Reload nftables service
|
|
|
|
|
2025-01-12 10:32:24 +01:00
|
|
|
- name: Setup Master node
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "icinga2 node setup --master --cn {{ ansible_hostname }} --disable-confd"
|
|
|
|
creates: "/var/lib/icinga2/certs/{{ ansible_hostname }}.crt"
|
|
|
|
notify: Restart icinga2 service
|