summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2018-11-14 11:09:02 +0100
committerkwadronaut <kwadronaut@leap.se>2018-11-14 11:09:02 +0100
commit06b521b6887d33b4cfa650c0d26850c8d1cc0ef8 (patch)
treecaa0bac49dfd2573462acef06b68d2ea69d8cdb8 /manifests
parent6ffee2d778992b783bd29a1ddeaab61baf6d47aa (diff)
parent15aba17d007e076ea09e50c837081ee1bec1b301 (diff)
Merge remote-tracking branch 'shared/master'HEADmaster
Diffstat (limited to 'manifests')
-rw-r--r--manifests/agent/install_local.pp3
-rw-r--r--manifests/agent/ps.pp7
-rw-r--r--manifests/agent/register.pp6
-rw-r--r--manifests/config.pp6
-rw-r--r--manifests/init.pp15
-rw-r--r--manifests/params.pp13
-rw-r--r--manifests/server/collect_ps.pp4
-rw-r--r--manifests/server/configure_ssh.pp13
8 files changed, 44 insertions, 23 deletions
diff --git a/manifests/agent/install_local.pp b/manifests/agent/install_local.pp
index 7238440..6450abd 100644
--- a/manifests/agent/install_local.pp
+++ b/manifests/agent/install_local.pp
@@ -1,12 +1,11 @@
define check_mk::agent::install_local($source=undef, $content=undef, $ensure='present') {
- @file { "/usr/lib/check_mk_agent/local/${name}" :
+ file { "/usr/lib/check_mk_agent/local/${name}" :
ensure => $ensure,
owner => 'root',
group => 'root',
mode => '0755',
content => $content,
source => $source,
- tag => 'check_mk::local',
require => Package['check-mk-agent'],
}
}
diff --git a/manifests/agent/ps.pp b/manifests/agent/ps.pp
index 67a999f..737cb91 100644
--- a/manifests/agent/ps.pp
+++ b/manifests/agent/ps.pp
@@ -1,12 +1,15 @@
define check_mk::agent::ps (
# procname and levels have defaults in check_mk::ps
$procname = undef,
- $levels = undef,
+ $levels = undef,
# user is optional
- $user = undef
+ $user = undef
) {
+ include check_mk::params
+
@@check_mk::ps { "${::fqdn}_${name}":
+ target => "${check_mk::params::etc_dir}/check_mk/conf.d/ps.mk",
desc => $name,
host => $::fqdn,
procname => $procname,
diff --git a/manifests/agent/register.pp b/manifests/agent/register.pp
index 46cdeae..51c803d 100644
--- a/manifests/agent/register.pp
+++ b/manifests/agent/register.pp
@@ -1,8 +1,10 @@
class check_mk::agent::register (
$host_tags = '',
- $hostname = $::fqdn
-) {
+ $hostname = $::fqdn,
+ $etc_dir = $check_mk::params::etc_dir
+) inherits check_mk::params {
@@check_mk::host { $hostname:
host_tags => $host_tags,
+ target => "${etc_dir}/check_mk/main.mk",
}
}
diff --git a/manifests/config.pp b/manifests/config.pp
index de36b7d..4a5dcc0 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -2,12 +2,12 @@
class check_mk::config (
$site,
$host_groups = undef,
- $etc_dir = "/omd/sites/${site}/etc",
+ $etc_dir = $check_mk::params::etc_dir,
$nagios_subdir = 'nagios',
- $bin_dir = "/omd/sites/${site}/bin",
+ $bin_dir = $check_mk::params::bin_dir,
$use_storedconfigs = true,
$inventory_only_on_changes = true
-) {
+) inherits check_mk::params {
file {
# for local check_mk checks
"${etc_dir}/${nagios_subdir}/local":
diff --git a/manifests/init.pp b/manifests/init.pp
index 4aab837..8bba46f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -4,16 +4,17 @@ class check_mk (
$host_groups = undef,
$package = 'omd-0.56',
$site = 'monitoring',
- $workspace = '/root/check_mk',
- $omd_service_name = 'omd',
- $http_service_name = 'httpd',
- $xinitd_service_name = 'xinetd',
+ $workspace = $check_mk::params::workspace,
+ $omd_service_name = $check_mk::params::omd_service_name,
+ $http_service_name = $check_mk::params::http_service_name,
+ $xinitd_service_name = $check_mk::params::xinetd_service_name,
$omdadmin_htpasswd = undef,
$use_ssh = false,
- $shelluser = 'monitoring',
- $shellgroup = 'monitoring',
+ $shelluser = $check_mk::params::shelluser,
+ $shellgroup = $check_mk::params::shellgroup,
$use_storedconfigs = true,
- $inventory_only_on_changes = true) {
+ $inventory_only_on_changes = true
+) inherits check_mk::params {
class { 'check_mk::install':
filestore => $filestore,
diff --git a/manifests/params.pp b/manifests/params.pp
new file mode 100644
index 0000000..a499ff4
--- /dev/null
+++ b/manifests/params.pp
@@ -0,0 +1,13 @@
+class check_mk::params {
+
+ $site = 'monitoring'
+ $etc_dir = "/omd/sites/${site}/etc"
+ $bin_dir = "/omd/sites/${site}/bin"
+ $omd_service_name = 'omd'
+ $http_service_name = 'httpd'
+ $xinitd_service_name = 'xinetd'
+ $shelluser = 'monitoring'
+ $shellgroup = 'monitoring'
+ $workspace = '/root/check_mk'
+
+}
diff --git a/manifests/server/collect_ps.pp b/manifests/server/collect_ps.pp
index 067a25c..5b8456c 100644
--- a/manifests/server/collect_ps.pp
+++ b/manifests/server/collect_ps.pp
@@ -1,6 +1,6 @@
class check_mk::server::collect_ps (
- $config = "${::check_mk::config::etc_dir}/check_mk/conf.d/ps.mk"
-) {
+ $config = "${check_mk::config::etc_dir}/check_mk/conf.d/ps.mk"
+) inherits check_mk::params {
# this class gets run on the check-mk server in order to collect the
# stored configs created on clients and assemble the ps.mk config file
diff --git a/manifests/server/configure_ssh.pp b/manifests/server/configure_ssh.pp
index 987cc7a..3b517f7 100644
--- a/manifests/server/configure_ssh.pp
+++ b/manifests/server/configure_ssh.pp
@@ -1,15 +1,18 @@
class check_mk::server::configure_ssh (
- $check_mk_tag = 'check_mk_sshkey'
-) {
+ $check_mk_tag = 'check_mk_sshkey',
+ $etc_dir = $check_mk::params::etc_dir,
+ $shelluser = $check_mk::params::shelluser,
+ $shellgroup = $check_mk::params::shellgroup,
+) inherits check_mk::params {
# collect exported files from client::generate_sshkey
File <<| tag == $check_mk_tag |>>
# configure ssh access to agents which have 'ssh' tags
- file { "${check_mk::config::etc_dir}/check_mk/conf.d/use_ssh.mk":
+ file { "${etc_dir}/check_mk/conf.d/use_ssh.mk":
source => [ 'puppet:///modules/site_check_mk/use_ssh.mk',
'puppet:///modules/check_mk/use_ssh.mk' ],
- owner => $::check_mk::shelluser,
- group => $::check_mk::shellgroup,
+ owner => $shelluser,
+ group => $shellgroup,
mode => '0644',
notify => Exec['check_mk-refresh']
}