2018-07-07 17:48:48 +00:00
|
|
|
---
|
|
|
|
# This role installs Icinga 2 and the plugins required on a Icinga client nodes
|
|
|
|
|
|
|
|
- name: Make sure EPEL repository is enabled
|
|
|
|
yum:
|
|
|
|
name: epel-release
|
|
|
|
state: latest
|
|
|
|
- name: Add Icinga2 repository key
|
|
|
|
rpm_key:
|
|
|
|
state: present
|
|
|
|
key: https://packages.icinga.com/icinga.key
|
2018-07-07 17:54:36 +00:00
|
|
|
- name: Install Icinga2 repository
|
2018-07-07 17:48:48 +00:00
|
|
|
yum:
|
|
|
|
name: https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
|
|
|
|
state: latest
|
2018-07-07 17:54:36 +00:00
|
|
|
- name: Install Icinga2 packages
|
|
|
|
yum:
|
2018-07-07 18:09:50 +00:00
|
|
|
name: "{{ packages }}"
|
2018-07-07 18:11:52 +00:00
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- icinga2
|
2018-07-07 18:22:08 +00:00
|
|
|
- nagios-plugins-all
|
2019-02-03 18:23:04 +00:00
|
|
|
- name: Ensure icinga2 systemd folder exists
|
|
|
|
file:
|
|
|
|
path: /etc/systemd/system/icinga2.service.d/
|
|
|
|
state: directory
|
|
|
|
- name: Copy custom icinga2 systemd service file modifications
|
|
|
|
copy:
|
|
|
|
src: restart.conf
|
|
|
|
dest: /etc/systemd/system/icinga2.service.d/restart.conf
|
2018-07-07 17:48:48 +00:00
|
|
|
- name: Ensure that icinga2 systemd service is enabled
|
|
|
|
systemd:
|
|
|
|
name: icinga2
|
|
|
|
enabled: yes
|
2019-02-03 18:23:04 +00:00
|
|
|
daemon_reload: yes
|