Skip to content

Commit

Permalink
fix #280 add condition to be sure that icinga2 base class is parsed f…
Browse files Browse the repository at this point in the history
…irst
  • Loading branch information
lbetz committed Apr 11, 2017
1 parent c605d72 commit 17f5fd8
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 23 deletions.
4 changes: 3 additions & 1 deletion manifests/feature.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
fail("icinga2::feature is a private define resource of the module icinga2, you're not permitted to use it.")
}

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

validate_re($ensure, [ '^present$', '^absent$' ],
"${ensure} isn't supported. Valid values are 'present' and 'absent'.")
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@
$bind_port = undef,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$pki_dir = $::icinga2::params::pki_dir
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/checker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
$concurrent_checks = undef,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/command.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
$command_path = "${::icinga2::params::run_dir}/cmd/icinga2.cmd",
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/compatlog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
$rotation_method = 'DAILY',
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/debuglog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
$path = "${::icinga2::params::log_dir}/debug.log",
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/gelf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
$enable_send_perfdata = false,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/graphite.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
$enable_send_metadata = false,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@
$import_schema = false,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$owner = $::icinga2::params::user
$group = $::icinga2::params::group
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
$import_schema = false,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$ido_pgsql_package = $::icinga2::params::ido_pgsql_package
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
$flush_threshold = 1024
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$user = $::icinga2::params::user
$group = $::icinga2::params::group
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/livestatus.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
$compat_log_path = "${::icinga2::params::log_dir}/compat",
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/mainlog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
$path = "${::icinga2::params::log_dir}/icinga2.log",
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/notification.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
$enable_ha = undef,
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/opentsdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
$port = '4242',
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/perfdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
$rotation_interval = '30s',
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/statusdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
$update_interval = '15s',
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
4 changes: 3 additions & 1 deletion manifests/feature/syslog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
$severity = 'warning',
) {

include ::icinga2::params
if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$conf_dir = $::icinga2::params::conf_dir
$_notify = $ensure ? {
Expand Down
1 change: 0 additions & 1 deletion manifests/object.pp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
}

include ::icinga2::params
require ::icinga2::config

case $::osfamily {
'windows': {
Expand Down
4 changes: 0 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#
class icinga2::params {

if ! defined(Class['::icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class or any define resource!')
}

$package = 'icinga2'
$service = 'icinga2'
$plugins = [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ]
Expand Down

0 comments on commit 17f5fd8

Please sign in to comment.