[colug-432] ERB variable expansion

Rick Hornsby richardjhornsby at gmail.com
Mon Oct 19 18:12:40 EDT 2015


> On Oct 19, 2015, at 16:55, Scott Merrill <skippy at skippy.net> wrote:
> 
> 
> On Oct 19, 2015 5:50 PM, Rick Hornsby <richardjhornsby at gmail.com> wrote:
> >
> 
> > I have this: 
> >
> > <% 
> > @memberList = "" 
> > @groups.each do |group| 
> > @memberList += "(memberOf=cn=${group},cn=Users,dc=foo,dc=com)" 
> > end 
> > -%> 
> >
> 
> I think you want #{} for variable expansion inside your quoted string, and not ${}.
> 
Ah, thanks! That did the trick.  erb might be ruby, but the syntax is different enough I'm not sure I'd have gotten the # thing.

> What you're trying to do is the recommended way. Looping inside Puppet manifests is not supported unless you use the "future" parser (enabled by default in newer Puppet versions).
> 
That's what I was finding.  Enabling the future parser in this version of Puppet tends to break stuff - including (at least it was this way a few months ago) Puppet Forge modules which aren't expecting the newer parser.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20151019/3722ccc2/attachment.html 


More information about the colug-432 mailing list