The [0] after groupname shouldn't be there.  Still didn't work 

On Friday, July 21, 2017 at 2:21:22 PM UTC-5, Ryan Murphy wrote:
>
> 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/fa645010-0a96-4e30-ab2a-69163985dce3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to