Ayounsi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399101 )

Change subject: LibreNMS: Allow librenms to write file in $install_dir
......................................................................

LibreNMS: Allow librenms to write file in $install_dir

The librenms user needs to write files such as sockets or lock files in
the root $install_dir.
As $install_dir is owned by deploy-librenms, this CR adds librenms to
the deploy-librenms group, then ensure that group can write to the
folder.

Change-Id: I16165153cbcdc22078a2240f455ad609dfe0c329
---
M modules/role/manifests/librenms.pp
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/01/399101/1

diff --git a/modules/role/manifests/librenms.pp 
b/modules/role/manifests/librenms.pp
index 08dbec4..817ccc2 100644
--- a/modules/role/manifests/librenms.pp
+++ b/modules/role/manifests/librenms.pp
@@ -23,6 +23,20 @@
         before      => Class['::librenms'],
     }
 
+    # The following is required as librenms needs to write files (lock, socket)
+    # In $install_dir.
+    exec { 'Ensure user librenms is is group deploy-librenms':
+        unless  => '/bin/grep -q "deploy-librenms\\S*librenms" /etc/group',
+        command => '/usr/sbin/usermod -aG deploy-librenms librenms',
+        require => [ User['librenms']
+                    Scap::Target['librenms/librenms']],
+    }
+    file { $install_dir:
+        mode    => 'g+w',
+        require => Scap::Target['librenms/librenms'],
+    }
+
+
     $config = {
         'title_image'      => 
'//upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Wikimedia_Foundation_logo_-_horizontal_%282012-2016%29.svg/140px-Wikimedia_Foundation_logo_-_horizontal_%282012-2016%29.svg.png',
 

-- 
To view, visit https://gerrit.wikimedia.org/r/399101
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16165153cbcdc22078a2240f455ad609dfe0c329
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ayounsi <ayou...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to