Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
Commit work around for Issue #10
Browse files Browse the repository at this point in the history
Thanks to the commenters in
https://blog.hqcodeshop.fi/archives/93-Handling-varrun-with-systemd.html for
pointing me at tmpfiles.d. This change is to install an override file which
sets the desired ownership (shinken:shinken) for /var/run/shinken .
  • Loading branch information
goetzk committed Apr 16, 2017
1 parent 7fd24de commit 5c8260f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tasks/configure-systemd.yml
Original file line number Diff line number Diff line change
@@ -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

2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
- include: configure-shinken-webui.yml
when: '"webui2" in shinken_broker_modules'

- include: configure-systemd.yml

5 changes: 5 additions & 0 deletions templates/run-shinken-permissions.conf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# {{ ansible_managed }}
# Set custom directory permissions
D /run/shinken 0755 shinken shinken
D /var/run/shinken 0755 shinken shinken

0 comments on commit 5c8260f

Please sign in to comment.