From 91ccfd2a528b5b4d89801e15f8949275cad77f64 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 15 Jul 2013 09:56:11 +0200 Subject: added use_ssh to check_mk class --- README.md | 3 +++ files/use_ssh.mk | 5 +++++ manifests/init.pp | 8 +++++++- manifests/server/configure_ssh.pp | 13 +++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 files/use_ssh.mk create mode 100644 manifests/server/configure_ssh.pp 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__id_rsa 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' ], + } +} -- cgit v1.2.3