diff options
author | Micah Anderson <micah@riseup.net> | 2016-11-04 10:54:28 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2016-11-04 10:54:28 -0400 |
commit | 34a381efa8f6295080c843f86bfa07d4e41056af (patch) | |
tree | 9282cf5d4c876688602705a7fa0002bc4a810bde /puppet/modules/check_mk/manifests/agent/config.pp | |
parent | 0a72bc6fd292bf9367b314fcb0347c4d35042f16 (diff) | |
parent | 5821964ff7e16ca7aa9141bd09a77d355db492a9 (diff) |
Merge branch 'develop'
Diffstat (limited to 'puppet/modules/check_mk/manifests/agent/config.pp')
m--------- | puppet/modules/check_mk | 0 | ||||
-rw-r--r-- | puppet/modules/check_mk/manifests/agent/config.pp | 59 |
2 files changed, 59 insertions, 0 deletions
diff --git a/puppet/modules/check_mk b/puppet/modules/check_mk deleted file mode 160000 -Subproject aa02571537af90ac73309e6e216c9417802548c diff --git a/puppet/modules/check_mk/manifests/agent/config.pp b/puppet/modules/check_mk/manifests/agent/config.pp new file mode 100644 index 00000000..8ee5f185 --- /dev/null +++ b/puppet/modules/check_mk/manifests/agent/config.pp @@ -0,0 +1,59 @@ +class check_mk::agent::config ( + $ip_whitelist = '', + $port, + $server_dir, + $keydir, + $authdir, + $authfile = undef, + $use_cache, + $user, + $method = 'xinetd', + $generate_sshkey = false, + $sshuser = undef, + $hostname = $::fqdn +) { + if $use_cache { + $server = "${server_dir}/check_mk_caching_agent" + } else { + $server = "${server_dir}/check_mk_agent" + } + + case $method { + 'xinetd': { + if $ip_whitelist { + $only_from = join($ip_whitelist, ' ') + } else { + $only_from = undef + } + + file { '/etc/xinetd.d/check_mk': + ensure => present, + owner => 'root', + group => 'root', + mode => '0444', + content => template('check_mk/agent/check_mk.erb'), + require => Package['check_mk-agent','check_mk-agent-logwatch'], + notify => Class['check_mk::agent::service'], + } + } + + 'ssh': { + if $generate_sshkey { + check_mk::agent::generate_sshkey { "check_mk_key_${hostname}": + keydir => $keydir, + authdir => $authdir, + authfile => $authfile, + sshuser => $sshuser, + hostname => $hostname + } + } + + # make sure the xinetd method is not configured + file { '/etc/xinetd.d/check_mk': + ensure => absent; + } + } + + default : {} + } +} |