Minor change

This commit is contained in:
Tunui Franken 2025-03-23 09:51:49 +01:00
parent 1a7b5b24b7
commit de4f590585

View file

@ -34,35 +34,18 @@
mode: 0644 mode: 0644
notify: Reload icinga2 service notify: Reload icinga2 service
- name: Create master zone directory - name: Create needed directories
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: /etc/icinga2/zones.d/master path: "/etc/icinga2/{{ item }}"
state: directory
owner: nagios
group: nagios
mode: 0750
- name: Copy files under master zone directory
become: true
ansible.builtin.template:
src: "{{ item }}"
dest: "/etc/icinga2/zones.d/master/{{ item | basename | replace('.j2', '') }}"
owner: nagios
group: nagios
mode: 0644
with_fileglob:
- "{{ role_path }}/templates/zones.d/master/*.conf.j2"
notify: Reload icinga2 service
- name: Create global-templates zone directory
become: true
ansible.builtin.file:
path: /etc/icinga2/zones.d/global-templates
state: directory state: directory
owner: nagios owner: nagios
group: nagios group: nagios
mode: 0750 mode: 0750
loop:
- zones.d/global-templates
- zones.d/master
- zones.d/master/services
- name: Copy files under global-templates zone directory - name: Copy files under global-templates zone directory
become: true become: true
@ -76,14 +59,17 @@
- "{{ role_path }}/templates/zones.d/global-templates/*.conf.j2" - "{{ role_path }}/templates/zones.d/global-templates/*.conf.j2"
notify: Reload icinga2 service notify: Reload icinga2 service
- name: Create services directory - name: Copy files under master zone directory
become: true become: true
ansible.builtin.file: ansible.builtin.template:
path: /etc/icinga2/zones.d/master/services src: "{{ item }}"
state: directory dest: "/etc/icinga2/zones.d/master/{{ item | basename | replace('.j2', '') }}"
owner: nagios owner: nagios
group: nagios group: nagios
mode: 0750 mode: 0644
with_fileglob:
- "{{ role_path }}/templates/zones.d/master/*.conf.j2"
notify: Reload icinga2 service
- name: Copy common services - name: Copy common services
become: true become: true