From 279b4e10f0fe6de210c6368998d1276077348f96 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sun, 3 Feb 2019 13:11:18 -0500 Subject: [PATCH] Modify icinga-client role to add some systemd options --- ubuntu/roles/icinga-client/files/restart.conf | 2 ++ ubuntu/roles/icinga-client/tasks/main.yml | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 ubuntu/roles/icinga-client/files/restart.conf diff --git a/ubuntu/roles/icinga-client/files/restart.conf b/ubuntu/roles/icinga-client/files/restart.conf new file mode 100644 index 0000000..eedb19c --- /dev/null +++ b/ubuntu/roles/icinga-client/files/restart.conf @@ -0,0 +1,2 @@ +[Service] +Restart=on-failure diff --git a/ubuntu/roles/icinga-client/tasks/main.yml b/ubuntu/roles/icinga-client/tasks/main.yml index 27b96ae..34439e7 100644 --- a/ubuntu/roles/icinga-client/tasks/main.yml +++ b/ubuntu/roles/icinga-client/tasks/main.yml @@ -10,7 +10,16 @@ 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