You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
---
|
|
- name: Create conf.d directory
|
|
become: yes
|
|
file:
|
|
dest: "{{ i2_conf_dir }}/{{ item }}"
|
|
state: directory
|
|
owner: "{{ i2_user }}"
|
|
group: "{{ i2_group }}"
|
|
with_items: "{{ i2_confd }}"
|
|
|
|
- name: Manage main Icinga 2 configuration
|
|
become: yes
|
|
template:
|
|
src: icinga2.conf.j2
|
|
dest: "{{ i2_conf_dir }}/icinga2.conf"
|
|
owner: "{{ i2_user }}"
|
|
group: "{{ i2_group }}"
|
|
mode: 0644
|
|
notify: reload icinga2
|
|
|
|
- name: Check for constants sample file
|
|
stat:
|
|
path: "{{ i2_conf_dir }}/constants.conf-sample"
|
|
register: sample_file
|
|
|
|
- name: Copy original Icinga 2 config to sample
|
|
become: yes
|
|
copy:
|
|
remote_src: true
|
|
src: "{{ i2_conf_dir }}/constants.conf"
|
|
dest: "{{ i2_conf_dir }}/constants.conf-sample"
|
|
owner: "{{ i2_user }}"
|
|
group: "{{ i2_group }}"
|
|
mode: 0644
|
|
when: not sample_file.stat.exists
|
|
|
|
- name: Manage Icinga 2 constants
|
|
become: yes
|
|
template:
|
|
src: constants.conf.j2
|
|
dest: "{{ i2_conf_dir }}/constants.conf"
|
|
owner: "{{ i2_user }}"
|
|
group: "{{ i2_group }}"
|
|
mode: 0644
|
|
notify: reload icinga2
|
|
|