ansible-playbooks/ubuntu/roles/icinga-client/tasks/main.yml

26 lines
918 B
YAML

---
# 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
apt_repository: repo="deb https://packages.icinga.com/ubuntu icinga-{{ ansible_distribution_release }} main" state=present
- name: Update apt cache and install Icinga packages
apt: name={{ item }} state=latest update_cache=yes
with_items:
- icinga2
- monitoring-plugins
- 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
- name: Ensure that icinga2 systemd service is enabled
systemd:
name: icinga2
enabled: yes
daemon_reload: yes