summaryrefslogtreecommitdiff
path: root/manifests/target.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2012-06-08 13:04:33 -0300
committermh <mh@immerda.ch>2012-06-08 13:04:33 -0300
commit106515b61b731489cce2d8b74bea13b26d4a65f6 (patch)
treec2e221f0652a5ab87428a540e2556439c5d4a999 /manifests/target.pp
parent315a1942cacc58aecfe275599e54fa9da8252518 (diff)
refactor things for >2.7
Diffstat (limited to 'manifests/target.pp')
-rw-r--r--manifests/target.pp25
1 files changed, 15 insertions, 10 deletions
diff --git a/manifests/target.pp b/manifests/target.pp
index fc39834..9a86c09 100644
--- a/manifests/target.pp
+++ b/manifests/target.pp
@@ -2,16 +2,21 @@
class nagios::target(
$parents = 'absent',
-) {
+ $address = $::ipaddress,
+ $nagios_alias = $::hostname,
+ $hostgroups = 'absent',
+){
+ @@nagios_host { $::fqdn:
+ address => $address,
+ alias => $nagios_alias,
+ use => 'generic-host',
+ }
- @@nagios_host { $::fqdn:
- address => $::ipaddress,
- alias => $::hostname,
- use => 'generic-host',
- }
-
- if ($parents != 'absent') {
- Nagios_host["${::fqdn}"] { parents => $parents }
- }
+ if ($parents != 'absent') {
+ Nagios_host["${::fqdn}"] { parents => $parents }
+ }
+ if ($hostgroups != 'absent') {
+ Nagios_host["${::fqdn}"] { hostgroups => $hostgroups }
+ }
}