Re: [Puppet Users] complex data types in puppet & facter

2010-04-05 Thread Greg Retkowski

Hello Dan,
 Thanks. I'm following your suggestion and serializing anything complex 
that I need to get at in ERB.


-- Greg

Dan Bode wrote:

Hi,

On Fri, Apr 2, 2010 at 3:37 PM, Greg Retkowski > wrote:


Good Afternoon,
 I'm running puppet vers. 0.24.4 and am trying to use some facts
in puppet ERB templates.


.24.4 is a pretty old version of Puppet, if its feasible I would upgrade.
 


It appears as long as the fact is a simple type, such as a String,
the fact works as expected in the ERB template. However if the
fact is something more complex (like a Hash) it appears to get
converted into a string.

Using it directly in ruby (via Facter.value) returns the correct
complex data type.

Is there an elegant way to use complex facts in puppet's erb
templates?


Puppet will support hashes in the next major version (Rwolf), although 
I am not sure if the interaction between Puppet and Facter will 
support it. Until then, the best work around is to serialize the data 
as a string and deserialize it in the erb.


 


Thanks for any help you may have!

Cheers,

-- Greg


Hope this helps,

-Dan
 

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


--
You received this message because you are subscribed to the Google 
Groups "Puppet Users" group.

To post to this group, send email to puppet-us...@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.


--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@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.



Re: [Puppet Users] complex data types in puppet & facter

2010-04-03 Thread Dan Bode
Hi,

On Fri, Apr 2, 2010 at 3:37 PM, Greg Retkowski  wrote:

> Good Afternoon,
>  I'm running puppet vers. 0.24.4 and am trying to use some facts in puppet
> ERB templates.


.24.4 is a pretty old version of Puppet, if its feasible I would upgrade.


> It appears as long as the fact is a simple type, such as a String, the fact
> works as expected in the ERB template. However if the fact is something more
> complex (like a Hash) it appears to get converted into a string.
>
> Using it directly in ruby (via Facter.value) returns the correct complex
> data type.
>
> Is there an elegant way to use complex facts in puppet's erb templates?
>

Puppet will support hashes in the next major version (Rwolf), although I am
not sure if the interaction between Puppet and Facter will support it. Until
then, the best work around is to serialize the data as a string and
deserialize it in the erb.



> Thanks for any help you may have!
>
> Cheers,
>
> -- Greg
>
>
> Hope this helps,

-Dan


> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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.



[Puppet Users] complex data types in puppet & facter

2010-04-02 Thread Greg Retkowski

Good Afternoon,
 I'm running puppet vers. 0.24.4 and am trying to use some facts in 
puppet ERB templates. It appears as long as the fact is a simple type, 
such as a String, the fact works as expected in the ERB template. 
However if the fact is something more complex (like a Hash) it appears 
to get converted into a string.


Using it directly in ruby (via Facter.value) returns the correct complex 
data type.


Is there an elegant way to use complex facts in puppet's erb templates?

Thanks for any help you may have!

Cheers,

-- Greg


--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@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.