summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorKeith Burdis <keith@burdis.org>2013-02-07 17:03:57 +0000
committerKeith Burdis <keith@burdis.org>2013-02-07 17:03:57 +0000
commitbe3594468ea18211f4b8ea2fcd1f9ab205a4da7a (patch)
tree04f6505000ab80a918503b7064fd93ea953d5aba /manifests
parent7b9e60d41a09af40da75f55052c655bf69e6ae76 (diff)
Add a read-only guest user
Diffstat (limited to 'manifests')
-rw-r--r--manifests/config.pp6
-rw-r--r--manifests/install.pp16
2 files changed, 20 insertions, 2 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index c679170..031f443 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -11,6 +11,12 @@ class check_mk::config {
path => '/etc/nagios/nagios.cfg',
notify => Class['check_mk::service'],
}
+ file_line { 'add-guest-users':
+ ensure => present.
+ line => 'guest_users = [ "guest" ]',
+ path => '/etc/check_mk/multisite.mk',
+ notify => Class['check_mk::service'],
+ }
concat { '/etc/check_mk/main.mk':
owner => 'root',
group => 'root',
diff --git a/manifests/install.pp b/manifests/install.pp
index 95196b5..2762165 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -5,11 +5,23 @@ class check_mk::install (
) {
package { 'nagios':
ensure => present,
- notify => Exec['set-nagiosadmin-password', 'add-apache-to-nagios-group'],
+ notify => Exec['set-nagiosadmin-password', 'set-guest-password', 'add-apache-to-nagios-group'],
+ }
+ file { '/etc/nagios/passwd':
+ ensure => present,
+ owner => 'root',
+ group => 'apache',
+ mode => '0640',
}
exec { 'set-nagiosadmin-password':
- command => '/usr/bin/htpasswd -bc /etc/nagios/passwd nagiosadmin letmein',
+ command => '/usr/bin/htpasswd -b /etc/nagios/passwd nagiosadmin letmein',
+ refreshonly => true,
+ require => File['/etc/nagios/passwd'],
+ }
+ exec { 'set-guest-password':
+ command => '/usr/bin/htpasswd -b /etc/nagios/passwd guest guest',
refreshonly => true,
+ require => File['/etc/nagios/passwd'],
}
exec { 'add-apache-to-nagios-group':
command => '/usr/sbin/usermod -a -G nagios apache',