diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/agent.pp | 1 | ||||
-rw-r--r-- | manifests/agent/config.pp | 8 | ||||
-rw-r--r-- | manifests/agent/generate_sshkey.pp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/manifests/agent.pp b/manifests/agent.pp index d3d48b2..64109ae 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -57,6 +57,7 @@ class check_mk::agent ( method => $method, generate_sshkey => $generate_sshkey, sshuser => $sshuser, + hostname => $hostname, require => Class['check_mk::agent::install'], } diff --git a/manifests/agent/config.pp b/manifests/agent/config.pp index 5907d43..8ee5f18 100644 --- a/manifests/agent/config.pp +++ b/manifests/agent/config.pp @@ -9,7 +9,8 @@ class check_mk::agent::config ( $user, $method = 'xinetd', $generate_sshkey = false, - $sshuser = undef + $sshuser = undef, + $hostname = $::fqdn ) { if $use_cache { $server = "${server_dir}/check_mk_caching_agent" @@ -38,11 +39,12 @@ class check_mk::agent::config ( 'ssh': { if $generate_sshkey { - check_mk::agent::generate_sshkey { "check_mk_key_${::fqdn}": + check_mk::agent::generate_sshkey { "check_mk_key_${hostname}": keydir => $keydir, authdir => $authdir, authfile => $authfile, - sshuser => $sshuser + sshuser => $sshuser, + hostname => $hostname } } diff --git a/manifests/agent/generate_sshkey.pp b/manifests/agent/generate_sshkey.pp index 807e826..b00271f 100644 --- a/manifests/agent/generate_sshkey.pp +++ b/manifests/agent/generate_sshkey.pp @@ -15,11 +15,12 @@ define check_mk::agent::generate_sshkey ( $ssh_key_basepath = '/etc/puppet/modules/check_mk/keys', # user on the client the check_mk server will ssh to, to run the agent $sshuser = 'root', + $hostname = $::fqdn, $check_mk_tag = 'check_mk_sshkey' ){ # generate check-mk ssh keypair, stored on puppetmaster - $ssh_key_name = "${::fqdn}_id_rsa" + $ssh_key_name = "${hostname}_id_rsa" $ssh_keys = ssh_keygen("${ssh_key_basepath}/${ssh_key_name}") $public = split($ssh_keys[1],' ') $public_type = $public[0] |