diff --git a/manifests/config.pp b/manifests/config.pp index 564fc8f2d..e906ca4b9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,7 +13,7 @@ # class icinga2::config { - if defined($caller_module_name) and $module_name != $caller_module_name { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::config is a private class of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/debian/dbconfig.pp b/manifests/debian/dbconfig.pp index 24ab14fc1..79aa9f857 100644 --- a/manifests/debian/dbconfig.pp +++ b/manifests/debian/dbconfig.pp @@ -8,7 +8,7 @@ $ssl = false, ) { - if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::debian::dbconfig is a private define resource of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/feature.pp b/manifests/feature.pp index b50ec2afa..5b007f008 100644 --- a/manifests/feature.pp +++ b/manifests/feature.pp @@ -8,7 +8,7 @@ $feature = $title, ) { - if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::feature is a private define resource of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/install.pp b/manifests/install.pp index 3d0c9d278..76075dc60 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -14,7 +14,7 @@ # class icinga2::install { - if defined($caller_module_name) and $module_name != $caller_module_name { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::install is a private class of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/object.pp b/manifests/object.pp index 6c356de3c..d82ea9ab4 100644 --- a/manifests/object.pp +++ b/manifests/object.pp @@ -77,7 +77,7 @@ $attrs = {}, ) { - if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::object is a private define resource of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/repo.pp b/manifests/repo.pp index 4fd01a86c..90b2f15dc 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -16,7 +16,7 @@ # class icinga2::repo { - if defined($caller_module_name) and $module_name != $caller_module_name { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::repo is a private class of the module icinga2, you're not permitted to use it.") } diff --git a/manifests/service.pp b/manifests/service.pp index 04c664b2b..b3c38cb76 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -16,7 +16,7 @@ # class icinga2::service { - if defined($caller_module_name) and $module_name != $caller_module_name { + if !defined($caller_module_name) or $module_name != $caller_module_name { fail("icinga2::service is a private class of the module icinga2, you're not permitted to use it.") }