You can use inline_template("<%= var = "your ruby code here" %>")
Cheers
On Monday, November 4, 2013 2:23:34 PM UTC, jcbollinger wrote:
>
>
>
> On Saturday, November 2, 2013 5:03:13 PM UTC-5, ytmp123 wrote:
>>
>> Hi guys,
>>
>> I've two questions:
>> 1. How can I execute normal Ruby-Code in a Puppet-Template?
>>
>
>
> See any onine docs / tutorials on ERB, though there really isn't much to
> it. The docs Jo pointed you to are as good as any, and they cover the
> details particular to Puppet's use of ERB.
>
>
>
>> 2. How can I execute normal Ruby-Code in a Puppet-Manifest?
>>
>>
>
> Not directly, no, but it is relatively easy to create custom functions (in
> Ruby) that your manifests can call just like Puppet's built-ins. These are
> often a better vehicle for general-purpose Ruby code than are templates.
>
>
> John
>
>
>
>
--
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/91c0a2da-3d74-4e27-aa27-9534daa60564%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.