From 0cf3a5163b6e2ea8edac7d48970d6f5e3709fbdf Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 7 Nov 2014 18:32:17 +0000 Subject: [PATCH] Add the nrpe and collectd users to the fedmsg group to simplify our /var/run/fedmsg permissions. --- roles/fedmsg/base/tasks/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/fedmsg/base/tasks/main.yml b/roles/fedmsg/base/tasks/main.yml index 762746011c..6ff7c3d217 100644 --- a/roles/fedmsg/base/tasks/main.yml +++ b/roles/fedmsg/base/tasks/main.yml @@ -179,3 +179,19 @@ when: semanageoutput.stdout.find("3000-3100") == -1 tags: - fedmsg/base + +- name: Check if the nrpe user exists + shell: /usr/bin/getent passwd nrpe | /usr/bin/wc -l | tr -d ' ' + register: nrpe_exists + +- name: Add nrpe user to the fedmsg group if it exists + user: name=nrpe groups=fedmsg append=yes + when: nrpe_exists.stdout == 1 + +- name: Check if the collectd user exists + shell: /usr/bin/getent passwd collectd | /usr/bin/wc -l | tr -d ' ' + register: collectd_exists + +- name: Add collectd user to the fedmsg group if it exists + user: name=collectd groups=fedmsg append=yes + when: collectd_exists.stdout == 1