Should have posted that...0.24.6.

I tried pulling it up into Puppet, but it wasn't very clean since I
had to do both an 'import foo' and an 'include foo' to get it to see
the variables in a module.

I'll try 'function_defined' and see what happens.

Thanks,

Trevor

On Mon, Jan 19, 2009 at 16:21, Andrew Shafer <and...@reductivelabs.com> wrote:
> Trevor,
>
> What version of Puppet?
>
> You could pull that logic up into Puppet and use 'defined' to set a variable
> then use that in the template.
>
> Or if you have to do it in the template, you should be able to call that
> same function with 'function_defined' depending on the version of Puppet.
>
> You can try and see what methods you have in your version.
>
> <% methods.sort.each do |m| -%>
>   <%= m %> is part of the current scope
> <% end -%>
>
> Cheers,
> Andrew
>
>
>
> On Mon, Jan 19, 2009 at 12:35 PM, Trevor Vaughan <peiriann...@gmail.com>
> wrote:
>>
>> Hi all,
>>
>> I've been toying around with this for a little while and find that my
>> ruby-fu is weak.
>>
>> In the Puppet language, I can do the following:
>>
>> if defined(Class["foo"]) { ...do stuff... }
>>
>> How do I do that in an ERB file?
>>
>> I.e.
>>
>> <% if class(foo) then %>do stuff<% end %>
>>
>> Or, is this impossible?
>>
>> Thanks,
>>
>> Trevor
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to