diff options
author | varac <varacanero@zeromail.org> | 2016-06-09 17:32:09 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-06-14 12:05:18 +0200 |
commit | 5e44087aed707e882129c03f24fadf00abbf7e02 (patch) | |
tree | 32bc70662dbeb7618e03769607ebdff6cd93ab58 /puppet/modules/check_mk/manifests/agent.pp | |
parent | e9b7b662d7da5ffe03ae2b2c4b65e763aa4441e3 (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.pp')
-rw-r--r-- | puppet/modules/check_mk/manifests/agent.pp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/puppet/modules/check_mk/manifests/agent.pp b/puppet/modules/check_mk/manifests/agent.pp new file mode 100644 index 00000000..64109ae9 --- /dev/null +++ b/puppet/modules/check_mk/manifests/agent.pp @@ -0,0 +1,70 @@ +class check_mk::agent ( + $filestore = undef, + $host_tags = undef, + $ip_whitelist = undef, + $port = '6556', + $server_dir = '/usr/bin', + $keydir = '/omd/sites/monitoring', + $authdir = '/omd/sites/monitoring', + $authfile = undef, + $use_cache = false, + $user = 'root', + $version = undef, + $workspace = '/root/check_mk', + $agent_package_name = 'check_mk-agent', + $agent_logwatch_package_name = 'check_mk-agent-logwatch', + $method = 'xinetd', + $generate_sshkey = false, + $sshuser = undef, + $use_ssh_tag = 'ssh', + $hostname = $::fqdn, + $register_agent = true +) { + + case $method { + 'xinetd': { + $tags = $host_tags + include check_mk::agent::service + } + 'ssh': { + if ( $host_tags == undef ) or ( $host_tags == '' ) { + $tags = $use_ssh_tag + } else { + $tags = "${host_tags}|${use_ssh_tag}" + } + } + default: {} + } + + class { 'check_mk::agent::install': + version => $version, + filestore => $filestore, + workspace => $workspace, + agent_package_name => $agent_package_name, + agent_logwatch_package_name => $agent_logwatch_package_name, + method => $method + } + + class { 'check_mk::agent::config': + ip_whitelist => $ip_whitelist, + port => $port, + server_dir => $server_dir, + keydir => $keydir, + authdir => $authdir, + authfile => $authfile, + use_cache => $use_cache, + user => $user, + method => $method, + generate_sshkey => $generate_sshkey, + sshuser => $sshuser, + hostname => $hostname, + require => Class['check_mk::agent::install'], + } + + if ( $register_agent ) { + class { 'check_mk::agent::register': + host_tags => $tags, + hostname => $hostname, + } + } +} |