summaryrefslogtreecommitdiff
path: root/puppet/modules/check_mk/manifests/agent/config.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-06-09 17:32:09 +0200
committervarac <varacanero@zeromail.org>2016-06-14 12:05:18 +0200
commit5e44087aed707e882129c03f24fadf00abbf7e02 (patch)
tree32bc70662dbeb7618e03769607ebdff6cd93ab58 /puppet/modules/check_mk/manifests/agent/config.pp
parente9b7b662d7da5ffe03ae2b2c4b65e763aa4441e3 (diff)
git subrepo clone https://leap.se/git/puppet_check_mk puppet/modules/check_mk
subrepo: subdir: "puppet/modules/check_mk" merged: "aa02571" upstream: origin: "https://leap.se/git/puppet_check_mk" branch: "master" commit: "aa02571" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "cb2995b"
Diffstat (limited to 'puppet/modules/check_mk/manifests/agent/config.pp')
-rw-r--r--puppet/modules/check_mk/manifests/agent/config.pp59
1 files changed, 59 insertions, 0 deletions
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 : {}
+ }
+}