I can''t help but think there''s a cleaner way to do this:
<% if has_variable?("foo") then %>
<% if has_variable?("bar") then %>
Both foo and bar are defined.
<% end %>
<% end %>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Trevor Vaughan
2010-Jan-11 14:04 UTC
Re: [Puppet Users] Testing 2 variables within a template
Not much but...
<% if has_variable?("foo") and has_variable?("bar") then
-%>
Both foo and bar are defined.
<% end -%>
Trevor
On Mon, Jan 11, 2010 at 9:02 AM, windowsrefund <windowsrefund@gmail.com>
wrote:> I can''t help but think there''s a cleaner way to do this:
>
> <% if has_variable?("foo") then %>
> <% if has_variable?("bar") then %>
> Both foo and bar are defined.
> <% end %>
> <% end %>
>
> --
> You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
>
>
>
>
--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com
-- This account not approved for unencrypted proprietary information --
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
windowsrefund
2010-Jan-11 14:09 UTC
[Puppet Users] Re: Testing 2 variables within a template
> <% if has_variable?("foo") and has_variable?("bar") then -%> > Both foo and bar are defined. > <% end -%>Perfect. Thank you very much -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.