Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump a few deps; start on puppet4 types #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Class: icinga::client
# == Class: icinga1::client
#
# Installs all the client side stuff we need to monitor a host.
#
Expand All @@ -19,50 +19,50 @@
#
# Copyright 2012, 2013 Nedap Stepping Stone.
#
class icinga::client (
class icinga1::client (
$icinga_servers = '',

$package_libnagios_perl = $::icinga::client::params::package_libnagios_perl,
$package_nagios_nrpe_server = $::icinga::client::params::package_nagios_nrpe_server,
$package_nagios_plugins_basic = $::icinga::client::params::package_nagios_plugins_basic,
$package_nagios_plugins_standard = $::icinga::client::params::package_nagios_plugins_standard,
$package_nagios_plugins_contrib = $::icinga::client::params::package_nagios_plugins_contrib,
$package_nagios_plugin_check_multi = $::icinga::client::params::package_nagios_plugin_check_multi,
$service_nagios_nrpe_server = $::icinga::client::params::service_nagios_nrpe_server,
$service_nagios_nrpe_server_pattern = $::icinga::client::params::service_nagios_nrpe_server_pattern,
$dir_nagios = $::icinga::client::params::dir_nagios,
$dir_nrpe = $::icinga::client::params::dir_nrpe,
$file_nrpe_config = $::icinga::client::params::file_nrpe_config,
$dir_nagios_lib = $::icinga::client::params::dir_nagios_lib,
$dir_nagios_plugins = $::icinga::client::params::dir_nagios_plugins,
$package_libnagios_perl = $::icinga1::client::params::package_libnagios_perl,
$package_nagios_nrpe_server = $::icinga1::client::params::package_nagios_nrpe_server,
$package_nagios_plugins_basic = $::icinga1::client::params::package_nagios_plugins_basic,
$package_nagios_plugins_standard = $::icinga1::client::params::package_nagios_plugins_standard,
$package_nagios_plugins_contrib = $::icinga1::client::params::package_nagios_plugins_contrib,
$package_nagios_plugin_check_multi = $::icinga1::client::params::package_nagios_plugin_check_multi,
$service_nagios_nrpe_server = $::icinga1::client::params::service_nagios_nrpe_server,
$service_nagios_nrpe_server_pattern = $::icinga1::client::params::service_nagios_nrpe_server_pattern,
$dir_nagios = $::icinga1::client::params::dir_nagios,
$dir_nrpe = $::icinga1::client::params::dir_nrpe,
$file_nrpe_config = $::icinga1::client::params::file_nrpe_config,
$dir_nagios_lib = $::icinga1::client::params::dir_nagios_lib,
$dir_nagios_plugins = $::icinga1::client::params::dir_nagios_plugins,

# params below should equal ::icinga::server::params::$param
$dir_icinga = $::icinga::client::params::dir_icinga,
$dir_objects = $::icinga::client::params::dir_objects,
$dir_icinga = $::icinga1::client::params::dir_icinga,
$dir_objects = $::icinga1::client::params::dir_objects,

$d_nrpe = $::icinga::client::params::dir_nrpe,
$f_nrpe_config = $::icinga::client::params::file_nrpe_config,
$log_facility = $::icinga::client::params::log_facility,
$pid_file = $::icinga::client::params::pid_file,
$server_port = $::icinga::client::params::server_port,
$server_address = $::icinga::client::params::server_address,
$nrpe_user = $::icinga::client::params::nrpe_user,
$nrpe_group = $::icinga::client::params::nrpe_group,
$dont_blame_nrpe = $::icinga::client::params::dont_blame_nrpe,
$command_prefix = $::icinga::client::params::command_prefix,
$debug = $::icinga::client::params::debug,
$command_timeout = $::icinga::client::params::command_timeout,
$connection_timeout = $::icinga::client::params::connection_timeout,
$allow_weak_random_seed = $::icinga::client::params::allow_weak_random_seed,
$file_local_nrpe_config = $::icinga::client::params::file_local_nrpe_config,
$include_dir = $::icinga::client::params::include_dir,
) inherits icinga::client::params {
$d_nrpe = $::icinga1::client::params::dir_nrpe,
$f_nrpe_config = $::icinga1::client::params::file_nrpe_config,
$log_facility = $::icinga1::client::params::log_facility,
$pid_file = $::icinga1::client::params::pid_file,
$server_port = $::icinga1::client::params::server_port,
$server_address = $::icinga1::client::params::server_address,
$nrpe_user = $::icinga1::client::params::nrpe_user,
$nrpe_group = $::icinga1::client::params::nrpe_group,
$dont_blame_nrpe = $::icinga1::client::params::dont_blame_nrpe,
$command_prefix = $::icinga1::client::params::command_prefix,
$debug = $::icinga1::client::params::debug,
$command_timeout = $::icinga1::client::params::command_timeout,
$connection_timeout = $::icinga1::client::params::connection_timeout,
$allow_weak_random_seed = $::icinga1::client::params::allow_weak_random_seed,
$file_local_nrpe_config = $::icinga1::client::params::file_local_nrpe_config,
$include_dir = $::icinga1::client::params::include_dir,
) inherits icinga1::client::params {

validate_array($icinga_servers)

class { '::icinga::client::packages': } ->
class { '::icinga::client::configs': } ->
class { '::icinga::client::services': } ->
Class [ '::icinga::client' ]
class { '::icinga1::client::packages': } ->
class { '::icinga1::client::configs': } ->
class { '::icinga1::client::services': } ->
Class [ '::icinga1::client' ]

}
46 changes: 23 additions & 23 deletions manifests/client/configs.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Class: icinga::client::configs
# == Class: icinga1::client::configs
#
# Creates directories and drops configuration files to
# monitor a host.
Expand All @@ -11,33 +11,33 @@
#
# Copyright 2012, 2013 Nedap Steppingstone.
#
class icinga::client::configs (
$icinga_servers = $::icinga::client::icinga_servers,
$d_nrpe = $::icinga::client::dir_nrpe,
$f_nrpe_config = $::icinga::client::file_nrpe_config,
$f_local_nrpe_config = $::icinga::client::file_local_nrpe_config,
$log_facility = $::icinga::client::log_facility,
$pid_file = $::icinga::client::pid_file,
$server_port = $::icinga::client::server_port,
$server_address = $::icinga::client::server_address,
$nrpe_user = $::icinga::client::nrpe_user,
$nrpe_group = $::icinga::client::nrpe_group,
$dont_blame_nrpe = $::icinga::client::dont_blame_nrpe,
$command_prefix = $::icinga::client::command_prefix,
$debug = $::icinga::client::debug,
$command_timeout = $::icinga::client::command_timeout,
$connection_timeout = $::icinga::client::connection_timeout,
$allow_weak_random_seed = $::icinga::client::allow_weak_random_seed,
$f_local_nrpe_config = $::icinga::client::file_local_nrpe_config,
$include_dir = $::icinga::client::include_dir,
class icinga1::client::configs (
$icinga_servers = $::icinga1::client::icinga_servers,
$d_nrpe = $::icinga1::client::dir_nrpe,
$f_nrpe_config = $::icinga1::client::file_nrpe_config,
$f_local_nrpe_config = $::icinga1::client::file_local_nrpe_config,
$log_facility = $::icinga1::client::log_facility,
$pid_file = $::icinga1::client::pid_file,
$server_port = $::icinga1::client::server_port,
$server_address = $::icinga1::client::server_address,
$nrpe_user = $::icinga1::client::nrpe_user,
$nrpe_group = $::icinga1::client::nrpe_group,
$dont_blame_nrpe = $::icinga1::client::dont_blame_nrpe,
$command_prefix = $::icinga1::client::command_prefix,
$debug = $::icinga1::client::debug,
$command_timeout = $::icinga1::client::command_timeout,
$connection_timeout = $::icinga1::client::connection_timeout,
$allow_weak_random_seed = $::icinga1::client::allow_weak_random_seed,
$f_local_nrpe_config = $::icinga1::client::file_local_nrpe_config,
$include_dir = $::icinga1::client::include_dir,
) {

file { $f_nrpe_config:
mode => '0644',
owner => root,
group => root,
content => template('icinga/client/nrpe.cfg.erb'),
notify => Class['icinga::client::services'],
content => template('icinga1/client/nrpe.cfg.erb'),
notify => Class['icinga1::client::services'],
}

file { $f_local_nrpe_config:
Expand All @@ -55,7 +55,7 @@
force => true,
purge => true,
recurse => true,
notify => Class['icinga::client::services'],
notify => Class['icinga1::client::services'],
}

}
18 changes: 9 additions & 9 deletions manifests/client/packages.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Class: icinga::client::packages
# == Class: icinga1::client::packages
#
# Installs all the client side stuff we need to monitor a host.
#
Expand All @@ -10,18 +10,18 @@
#
# Copyright 2012, 2013 Nedap Steppingstone.
#
class icinga::client::packages (
$p_libnagios_perl = $::icinga::client::package_libnagios_perl,
$p_nagios_nrpe_server = $::icinga::client::package_nagios_nrpe_server,
$p_nagios_plugins_basic = $::icinga::client::package_nagios_plugins_basic,
$p_nagios_plugins_standard = $::icinga::client::package_nagios_plugins_standard,
$p_nagios_plugins_contrib = $::icinga::client::package_nagios_plugins_contrib,
$p_nagios_plugin_check_multi = $::icinga::client::package_nagios_plugin_check_multi,
class icinga1::client::packages (
$p_libnagios_perl = $::icinga1::client::package_libnagios_perl,
$p_nagios_nrpe_server = $::icinga1::client::package_nagios_nrpe_server,
$p_nagios_plugins_basic = $::icinga1::client::package_nagios_plugins_basic,
$p_nagios_plugins_standard = $::icinga1::client::package_nagios_plugins_standard,
$p_nagios_plugins_contrib = $::icinga1::client::package_nagios_plugins_contrib,
$p_nagios_plugin_check_multi = $::icinga1::client::package_nagios_plugin_check_multi,
) {

package { $p_nagios_nrpe_server:
ensure => latest,
notify => Class['icinga::client::services'],
notify => Class['icinga1::client::services'],
}

package { [
Expand Down
4 changes: 2 additions & 2 deletions manifests/client/params.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Class: icinga::client::params
# == Class: icinga1::client::params
#
# Client-side configuration parameters for Icinga.
#
Expand All @@ -10,7 +10,7 @@
#
# Copyright 2012, 2013 Nedap Steppingstone.
#
class icinga::client::params {
class icinga1::client::params {
case $::osfamily {
'Debian': {
$package_libnagios_perl = 'libnagios-plugin-perl'
Expand Down
10 changes: 5 additions & 5 deletions manifests/client/resources/nrpe_check.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Type: icinga::client::resources::nrpe_check
# == Type: icinga1::client::resources::nrpe_check
#
# This is a defined type used to store a nagios nrpe check
#
Expand All @@ -7,18 +7,18 @@
# [*command*]
# The specific params that should be included in the resource

define icinga::client::resources::nrpe_check (
define icinga1::client::resources::nrpe_check (
$check,
$check_name = $title,
$dir_nrpe = $::icinga::client::dir_nrpe,
$dir_nrpe = $::icinga1::client::dir_nrpe,
) {

file { "${dir_nrpe}/${check_name}.cfg":
mode => '0644',
owner => root,
group => root,
require => Class['icinga::client::configs'],
notify => Class['icinga::client::services'],
require => Class['icinga1::client::configs'],
notify => Class['icinga1::client::services'],
content => "command[${check_name}]=${check}\n",
}

Expand Down
8 changes: 4 additions & 4 deletions manifests/client/resources/plugin.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Type: icinga::client::resources::plugin
# == Type: icinga1::client::resources::plugin
#
# This is a defined type used to install a custom plugin into the plugindir
#
Expand All @@ -8,17 +8,17 @@
# This tells puppet where to find the plugin


define icinga::client::resources::plugin (
define icinga1::client::resources::plugin (
$plugin_source,
$dir_nagios_plugins = $::icinga::client::dir_nagios_plugins,
$dir_nagios_plugins = $::icinga1::client::dir_nagios_plugins,
) {


file { "${dir_nagios_plugins}/${title}":
owner => root,
group => root,
mode => '0755',
require => Class['icinga::client::configs'],
require => Class['icinga1::client::configs'],
source => $plugin_source,
}

Expand Down
8 changes: 4 additions & 4 deletions manifests/client/services.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# == Class: icinga::client::services
# == Class: icinga1::client::services
#
# Configures the service on each host needed to monitor the machine.
#
Expand All @@ -10,9 +10,9 @@
#
# Copyright 2012, 2013 Nedap Steppingstone.
#
class icinga::client::services (
$s_nrpe_server = $::icinga::client::service_nagios_nrpe_server,
$s_nrpe_pattern = $::icinga::client::service_nagios_nrpe_server_pattern,
class icinga1::client::services (
$s_nrpe_server = $::icinga1::client::service_nagios_nrpe_server,
$s_nrpe_pattern = $::icinga1::client::service_nagios_nrpe_server_pattern,
) {

service { $s_nrpe_server:
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# Copyright 2012, 2013 Nedap Stepping Stone.
#
class icinga {
class icinga1 {

fail('The class Icinga does nothing on its own.')

Expand Down
12 changes: 4 additions & 8 deletions manifests/resource.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@
# [*icinga_config*]
# The specific params that should be included in the resource

define icinga::resource (
$type,
$icinga_config = {},
define icinga1::resource (
String $type,
Hash $icinga_config = {},
) {

validate_string($type)
validate_hash($icinga_config)

concat::fragment { "icinga_${type}+${title}.cfg":
target => "icinga_${type}",
content => template('icinga/resource.erb'),
content => template('icinga1/resource.erb'),
}

}
Loading