Skip to content

Commit

Permalink
Merge branch 'enhancement/add-condition-to-be-sure-that-icinga2-base-…
Browse files Browse the repository at this point in the history
…class-is-parsed-first-280'
  • Loading branch information
lbetz committed Apr 11, 2017
2 parents 98b1e71 + 17f5fd8 commit cb4b6e4
Show file tree
Hide file tree
Showing 19 changed files with 70 additions and 6 deletions.
5 changes: 4 additions & 1 deletion manifests/feature.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
$ensure = present,
$feature = $title,
) {
require ::icinga2::config

if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' {
fail("icinga2::feature is a private define resource of the module icinga2, you're not permitted to use it.")
}

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: 4 additions & 0 deletions manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@
$bind_port = undef,
) {

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
$ca_dir = $::icinga2::params::ca_dir
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/checker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
$concurrent_checks = undef,
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/command.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
$command_path = "${::icinga2::params::run_dir}/cmd/icinga2.cmd",
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/compatlog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
$rotation_method = 'DAILY',
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/debuglog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
$path = "${::icinga2::params::log_dir}/debug.log",
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/gelf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
$enable_send_perfdata = false,
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/graphite.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
$enable_send_metadata = false,
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
5 changes: 3 additions & 2 deletions manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@
$import_schema = false,
) {

require ::icinga2::config
require ::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
5 changes: 3 additions & 2 deletions manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
$import_schema = false,
) {

require ::icinga2::config
require ::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: 4 additions & 0 deletions manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
$flush_threshold = 1024
) {

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
$node_name = $::icinga2::_constants['NodeName']
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/livestatus.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
$compat_log_path = "${::icinga2::params::log_dir}/compat",
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/mainlog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
$path = "${::icinga2::params::log_dir}/icinga2.log",
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/notification.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
$enable_ha = undef,
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/opentsdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
$port = '4242',
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/perfdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
$rotation_interval = '30s',
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/statusdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
$update_interval = '15s',
) {

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 ? {
'present' => Class['::icinga2::service'],
Expand Down
4 changes: 4 additions & 0 deletions manifests/feature/syslog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
$severity = 'warning',
) {

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 ? {
'present' => Class['::icinga2::service'],
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

0 comments on commit cb4b6e4

Please sign in to comment.