So my hiera variable looks like this.
contacts:
'Group A':
'bmurphy': '[email protected]'
'cjames': '[email protected]'
'Group B':
'RPrice': '[email protected]'
'STurpen': '[email protected]'
I need to be able to iterate through contacts, grab the group name create a
Nagios_contact group based on that value, then iterate through each group
and create the contacts. How do I do this?
I tried something like below but it just doesn't work.
$contactdata.each | $groupname, $groupcontacts | {
$contactgroupname = $groupname[0]
nagios_contactgroup { "$contactgroupname":
ensure => present,
}
$groupcontacts.each | String $username, String $emailaddress | {
nagios_contact { "$username":
ensure => present,
contactgroups => "$groupdisplay",
email => "$emailaddress",
}
}
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/1afb59a5-236a-4056-95ac-9231a204d1a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.