Can't use `each` statement on puppet 3.6
Issue
Unable to use the each statement in puppet. Documentation for each statement: https://docs.puppet.com/puppet/3.6/reference/function.html#each
[root@undercloud ~]# cat test.pp
$sgrouptmp = [ 'test', 'test2', 'test3' ]
each($sgrouptmp) |$sgroup| {
notify { $sgroup : }
}
This throws the following error
Error: Could not parse for environment production: Could not match |$sgroup| at /root/test.pp:3 on node undercloud.default.redhat.local
Error: Could not parse for environment production: Could not match |$sgroup| at /root/test.pp:3 on node undercloud.default.redhat.local
Environment
Red Hat Enterprise Linux 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
