On Tuesday, September 25, 2012 at 1:32 PM, Jo Rhett wrote:
> Your usage here is backwards. You need to re-read how puppet works. The node
> collects its facts and submits them to the puppet master. The puppet master
> uses the facts to compile a catalog for the node, which will be run by the
> node.
>
> So you can set $foot in the fact, and echo it in the class, but not vice
> versa as you have done below.
I see. I thought Puppet could feed it's facts definitions too by requiring some
class on it.
Many thanks for your fast and clear answer :)
Cheers,
Frank
>
> On Sep 25, 2012, at 5:28 AM, Frank wrote:
> > I've created a class where I define some variables like $mydns, $myproxy,
> > etc to use everywhere (in other manifests)
> >
> > The question is: Can I call these class variables inside a fact definition?
> >
> > Something like:
> >
> > #somemanifest.pp
> > class x {
> > $foo = "great"
> > }
> >
> > #somefact.rb
> >
> > Facter.add("foo") do
> > setcode do
> > Facter::Util::Resolution.exec('echo ${x::foo}')
> > end
> > end
> >
> >
> >
> > Thanks in advance
> >
> > --
> > Frank
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to [email protected]
> > (mailto:[email protected]).
> > To unsubscribe from this group, send email to
> > [email protected]
> > (mailto:[email protected]).
> > For more options, visit this group at
> > http://groups.google.com/group/puppet-users?hl=en.
>
> --
> Jo Rhett
> Net Consonance : net philanthropy to improve open source and internet
> projects.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected]
> (mailto:[email protected]).
> To unsubscribe from this group, send email to
> [email protected]
> (mailto:[email protected]).
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.