summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-07-15 09:56:11 +0200
committervarac <varacanero@zeromail.org>2013-07-15 09:56:11 +0200
commit91ccfd2a528b5b4d89801e15f8949275cad77f64 (patch)
tree93938c542c541613ac6a420b82847909e378adb6
parent08dd5bd0187159f3463b270b13ffbda8396df101 (diff)
added use_ssh to check_mk class
-rw-r--r--README.md3
-rw-r--r--files/use_ssh.mk5
-rw-r--r--manifests/init.pp8
-rw-r--r--manifests/server/configure_ssh.pp13
4 files changed, 28 insertions, 1 deletions
diff --git a/README.md b/README.md
index 0ef7920..6371d7d 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,9 @@ created making the URL http://hostname/acme/check_mk/ running as the 'acme' user
*omdadmin_htpasswd*: changes the htpasswd of the amdadmin user (requires apache module from i.e.
https://labs.riseup.net/code/projects/shared-apache)
+*use_ssh*: Configures ssh to agents that use the same parameter.
+ Default: false.
+
### Notes
* A user and group with the same value as the site parameter is created. By default this is 'monitoring'.
diff --git a/files/use_ssh.mk b/files/use_ssh.mk
new file mode 100644
index 0000000..b5d77c6
--- /dev/null
+++ b/files/use_ssh.mk
@@ -0,0 +1,5 @@
+# http://mathias-kettner.de/checkmk_datasource_programs.html
+datasource_programs = [
+ ( "ssh -l root -i /omd/sites/monitoring/.ssh/monitoring_<HOST>_id_rsa <IP> check_mk_agent", ['ssh'], ALL_HOSTS ),
+]
+
diff --git a/manifests/init.pp b/manifests/init.pp
index 16c8dce..0dcf155 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -7,7 +7,8 @@ class check_mk (
$omd_service_name = 'omd',
$http_service_name = 'httpd',
$xinitd_service_name = 'xinetd',
- $omdadmin_htpasswd = undef ) {
+ $omdadmin_htpasswd = undef,
+ $use_ssh = false ) {
class { 'check_mk::install':
filestore => $filestore,
@@ -28,4 +29,9 @@ class check_mk (
password => $omdadmin_htpasswd
}
}
+
+ if ( $use_ssh == true ) {
+ class { '': }
+ }
+
}
diff --git a/manifests/server/configure_ssh.pp b/manifests/server/configure_ssh.pp
new file mode 100644
index 0000000..b0599fb
--- /dev/null
+++ b/manifests/server/configure_ssh.pp
@@ -0,0 +1,13 @@
+class check_mk::server::configure_ssh (
+ $check_mk_tag = 'check_mk_sshkey'
+) {
+ # collect exported files from client::generate_sshkey
+ File <<| tag == $check_mk_tag |>>
+
+ # configure ssh access to agents which have 'ssh' tags
+ $etcdir = $check_mk::etcdir
+ file { "${check_mk::etc_dir}/conf.d/use_ssh.mk":
+ source => [ 'puppet:///modules/site_check_mk/use_ssh.mk',
+ 'puppet:///modules/check_mk/use_ssh.mk' ],
+ }
+}