ArielGlenn has submitted this change and it was merged.

Change subject: second try at getting icinga user its nagios group, thanks 
hashar
......................................................................


second try at getting icinga user its nagios group, thanks hashar

Change-Id: Id74d3c9edcc4c32e6de403017ce00c610db7b76b
---
M manifests/misc/icinga.pp
M manifests/nagios.pp
M manifests/nrpe.pp
3 files changed, 25 insertions(+), 11 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/misc/icinga.pp b/manifests/misc/icinga.pp
index deafa8a..15245f0 100644
--- a/manifests/misc/icinga.pp
+++ b/manifests/misc/icinga.pp
@@ -2,10 +2,20 @@
 # misc/icinga.pp
 
 class icinga::user {
-  systemuser { 'icinga':
-    name   => 'icinga',
-    home   => '/home/icinga',
-    groups => [ 'icinga', 'dialout', 'nagios' ]
+  include nagios::group
+  # where does the dialout user group come from? it should be included here 
somehow
+
+  user { 'icinga':
+    name       => 'icinga',
+    home       => '/home/icinga',
+    gid        => 'icinga',
+    system     => true,
+    managehome => false,
+    shell      => "/bin/false",
+    require    => Group['icinga'],
+    require    => Group['dialout'],
+    require    => Group['nagios'],
+    groups     => [ 'icinga', 'dialout', 'nagios' ]
   }
 }
 
diff --git a/manifests/nagios.pp b/manifests/nagios.pp
index 39e58c7..1803c05 100644
--- a/manifests/nagios.pp
+++ b/manifests/nagios.pp
@@ -189,6 +189,14 @@
        @monitor_service { "GSB_wiktionary": description => "check google safe 
browsing for wiktionary.org", check_command => 
"check_http_url_for_string!www.google.com!/safebrowsing/diagnostic?site=wiktionary.org/!'This
 site is not currently listed as suspicious'", host => "google" }
 }
 
+class nagios::group {
+       group { 'nagios':
+               ensure    => present,
+               name      => 'nagios',
+               system    => true,
+               allowdupe => false,
+       }
+}
 
 class misc::zfs::monitoring {
        monitor_service { "zfs raid": description => "ZFS RAID", check_command 
=> "nrpe_check_zfs" }
diff --git a/manifests/nrpe.pp b/manifests/nrpe.pp
index 45648db..e2ccc3f 100644
--- a/manifests/nrpe.pp
+++ b/manifests/nrpe.pp
@@ -63,7 +63,6 @@
 class nrpe {
        include nrpe::packages
        include nrpe::service
-       include nrpe::user
 
        #Collect virtual NRPE nagios service checks
        Monitor_service <| tag == "nrpe" |>
@@ -117,13 +116,10 @@
        }
 }
 
-class nrpe::user {
-       include icinga::user
-}
-
 class nrpe::service {
-       # user needs nagios group which is created by nagios-nrpe-server so...
-       Class[nrpe::packages] -> Class[nrpe::user] -> Class[nrpe::service]
+       include icinga::user
+
+       Class[nrpe::packages] -> Class[nrpe::service]
 
        service { nagios-nrpe-server:
                require => [ Package[nagios-nrpe-server], 
File["/etc/icinga/nrpe_local.cfg"], File["/usr/lib/nagios/plugins/check_dpkg"] 
],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id74d3c9edcc4c32e6de403017ce00c610db7b76b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to