On Wed, May 4, 2011 at 17:40, Corey Osman <co...@logicminds.biz> wrote:

> I am writing a hp ilo module to automatically assign a static ip that is 
> derived from the IP of the system which is fed in via facter.  I basically 
> just need to change the network the ilo is connected to.
>
> The ruby code works great inside the irb console.  However, puppet doesn't 
> seem to be able to use the variable I have derived from the ipaddress.  This 
> is my first template so I am not exactly sure if I can use ruby syntax inside 
> a template.

It should be just fine you you wrap it in the "Ruby escape":

<% example = 12 * 12 %>
<%= example %>  => 144

If you want, though, you can use the erb command line tool that ships
with Ruby to make the transformation for you.  'erb -x foo.erb' will
spit out the transformed Ruby to generate your content, and you can
inspect that to see exactly how this is working.

Regards,
    Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <dan...@puppetlabs.com>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

-- 
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