diff --git a/tasks/configure-systemd.yml b/tasks/configure-systemd.yml new file mode 100644 index 0000000..c8ea21a --- /dev/null +++ b/tasks/configure-systemd.yml @@ -0,0 +1,13 @@ +--- + +- name: Check if /etc/tmpfiles.d exists (are we using systemd?) + stat: + path: /etc/tmpfiles.d + register: destination_exists + +- name: Install permissions override for [/var]/run/shinken + template: + dest: /etc/tmpfiles.d/run-shinken.conf + src: run-shinken-permissions.conf.tmpl + when: destination_exists.stat.isdir is defined and destination_exists.stat.isdir + diff --git a/tasks/main.yml b/tasks/main.yml index c00cb57..87d7efb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,3 +8,5 @@ - include: configure-shinken-webui.yml when: '"webui2" in shinken_broker_modules' +- include: configure-systemd.yml + diff --git a/templates/run-shinken-permissions.conf.tmpl b/templates/run-shinken-permissions.conf.tmpl new file mode 100644 index 0000000..6c574d1 --- /dev/null +++ b/templates/run-shinken-permissions.conf.tmpl @@ -0,0 +1,5 @@ +# {{ ansible_managed }} +# Set custom directory permissions +D /run/shinken 0755 shinken shinken +D /var/run/shinken 0755 shinken shinken +