On 02/15/2011 10:24 PM, CraftyTech wrote:
> Hello All,
>
> I'm using puppet 0.25.5, and I'm having issues with an ERB template
> and its syntax. Instead of declaring a var true or false, I'd like to
> do something if the variable is defined, otherwise ignore. So here's
> what I have in my template:
>
> <% if defined?("VAR") and VAR == "ABC" then -%> XYZ <%END -%>
I believe you're looking for the has_variable? function.
> But for some reason, it just ignores it when I defined VAR=ABC. I'd
> have to do <% if VAR == "ABC" then -%> XYZ, and that works. But then
> I'd have to define it the VAR true or false, and I just want to have the
> option to define it only when I need it, and not all the time. Any
> thoughts?
HTH,
Felix
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.