Jonathan Gazeley
2014-Jan-13 11:38 UTC
[Puppet Users] Nagios_contact in multiple contactgroups
Hi all,
I'm using hiera with puppet to create Nagios contacts. However, it seems
that Nagios contacts do not get put into multiple contact groups. No
errors are thrown, but I think this is wrong.
After running the below code the contact "jg4461" is only placed in
the
"resnet" contactgroup (see bottom). Is this expected behaviour?
Thanks,
Jonathan
## nagios/user.pp
define nagios::user ($nagiosuser=true, $ensure=present, $comment, $uid,
$gid, $groups) {
if $nagiosuser == true {
# create nagios user
@@nagios_contact { $name:
ensure => $ensure,
contact_name => $name,
alias => $comment,
use => 'generic-contact',
email => "${name}@bristol.ac.uk",
contactgroups => $groups,
}
}
}
## nagios/init.pp
$unifiedusers = hiera("unifiedusers")
create_resources("nagios::user", $unifiedusers)
## common.yaml
unifiedusers:
jg4461:
nagiosuser: true
comment: Jonathan Gazeley
gid: resnet
uid: 56933
groups:
- sudoers
- resnet
- netops
- superadmins
## nagios_contact.cfg
define contact {
alias Jonathan Gazeley
contact_name jg4461
contactgroups resnet
use generic-contact
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/52D3D03F.8010208%40bristol.ac.uk.
For more options, visit https://groups.google.com/groups/opt_out.