On 12/3/2013 9:54 AM, Dan White wrote:
I started with
<% if @agent_environment == "production" then -%>
and this worked.
But then I needed to add a second possibility, so I tried:
<% if (@agent_environment == "production" || @agent_environment ==
"dmz_production") then -%>
and
<% if ((@agent_environment == "production") || (@agent_environment ==
"dmz_production")) then -%>
and
<% if (@agent_environment == "production" or @agent_environment ==
"dmz_production") then -%>
and
<% if ((@agent_environment == "production") or (@agent_environment ==
"dmz_production")) then -%>
and none of the above will work for either value
My goal is to avoid this:
<% if @agent_environment == "production" then -%>
...code...
<% end -%>
<% if @agent_environment == "dmz_production" then -%>
...duplicate code...
<% end -%>
Suggestions ?
I don't see any reason those wouldn't work, but there must be something.
I tend to use this format as I find it more compact.
if (['dbm','dbs']).include? @role -%>
fwiw, it might be better to move the data into Hiera and skip the if
statements altogether.
Ramin
--
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/529E2170.7050706%40badapple.net.
For more options, visit https://groups.google.com/groups/opt_out.