On Thursday, 23 November 2017 16:47:44 UTC+2, buoyant_puppy wrote:
>
> Why does this:
> class mymodule {
> notify { "booboo": }
> notify { "booboo": }
>
> provoke the error:
> Error while evaluating a Resource Statement, Duplicate declaration:
> Notify[booboo] is already declared in file xxxx
>
> The error occurs because you have two resources of the same type (notify)
with the same name ('booboo'). Remember that 'notify' is not like a
'log.info' - it is a resource in it's own right, and each 'notify' has to
have a unique name.
> That's is a simplified version of my actual use case:
> $mythings.each | String $x | { # for each x in list 'mythings'
> notify { "gonna do something with $x": }
> ....
>
> In plain english, for example, I may have a list of rpms and want to loop
> through them to ensure all are installed.
>
> What would be the correct way to do this, if not the above?
>
> Your code looks OK- as long as you don't have duplicates in $mythings.
What is the output you get from your actual use case?
--
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/8dfb2faf-e769-4682-9de4-d1b55d04664d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.