2017-11-27 19:20:10 +00:00
|
|
|
---
|
|
|
|
# This role installs Icinga 2 and the plugins required on a Icinga client nodes
|
|
|
|
|
|
|
|
- name: Add Icinga package repository key
|
|
|
|
apt_key: url="https://packages.icinga.com/icinga.key" state=present
|
|
|
|
- name: Add Icinga apt repository
|
2018-06-03 22:15:46 +00:00
|
|
|
apt_repository: repo="deb https://packages.icinga.com/ubuntu icinga-{{ ansible_distribution_release }} main" state=present
|
2017-11-27 19:20:10 +00:00
|
|
|
- name: Update apt cache and install Icinga packages
|
2019-02-03 18:35:00 +00:00
|
|
|
apt: name={{ packages }} state=latest update_cache=yes
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- icinga2
|
|
|
|
- monitoring-plugins
|
2019-02-03 18:11:18 +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
|
2017-11-27 19:20:10 +00:00
|
|
|
- name: Ensure that icinga2 systemd service is enabled
|
|
|
|
systemd:
|
|
|
|
name: icinga2
|
|
|
|
enabled: yes
|
2019-02-03 18:11:18 +00:00
|
|
|
daemon_reload: yes
|