summaryrefslogtreecommitdiff
path: root/manifests/target.pp
blob: aaa67cff7e9d4f0ffd25d73268a7317dfdd59ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# manifests/target.pp

class nagios::target(
  $parents = 'absent',
  $address = $::ipaddress,
  $nagios_alias = $::hostname,
  $hostgroups = 'absent',
  $notes = 'absent'
){
  @@nagios_host { $::fqdn:
    address => $address,
    alias   => $nagios_alias,
    use     => 'generic-host',
  }

  if ($parents != 'absent') {
    Nagios_host[ $::fqdn ] { parents => $parents }
  }

  if ($hostgroups != 'absent') {
    Nagios_host[ $::fqdn ] { hostgroups => $hostgroups }
  }
  if ($notes != 'absent') {
    Nagios_host[ $::fqdn ] { notes => $notes }
  }
}