Mohamed Lrhazi
2011-Jan-07 04:11 UTC
[Puppet Users] facter --puppet does not report "environment"
Is it normal that "facter --puppet" does not show the environment variable? is there a way to have it include it? Thanks a lot, Mohamed. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nigel Kersten
2011-Jan-07 04:22 UTC
Re: [Puppet Users] facter --puppet does not report "environment"
On Thu, Jan 6, 2011 at 8:11 PM, Mohamed Lrhazi <lrhazi@gmail.com> wrote:> Is it normal that "facter --puppet" does not show the environment > variable? is there a way to have it include it?facter --puppet shows the facter facts, plus any that have been delivered by puppet and pluginsync. "environment" isn''t a fact by default. You could make a fact that reported on the Puppet environment setting however. require ''puppet'' Facter.add("environment) do setcode do Puppet[:environment] end end [1] - UNTESTED in anything other than a quick interactive session.> > Thanks a lot, > Mohamed. > > -- > 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+unsubscribe@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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mohamed Lrhazi
2011-Jan-07 14:07 UTC
Re: [Puppet Users] facter --puppet does not report "environment"
Thanks a lot Nigel... I do need to learn to create custom facts indeed. On Thu, Jan 6, 2011 at 11:22 PM, Nigel Kersten <nigel@puppetlabs.com> wrote:> facter --puppet shows the facter facts, plus any that have been > delivered by puppet and pluginsync. > > "environment" isn''t a fact by default. You could make a fact that > reported on the Puppet environment setting however. > > require ''puppet'' > > Facter.add("environment) do > setcode do > Puppet[:environment] > end > end > > [1] - UNTESTED in anything other than a quick interactive session. > >>-- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nigel Kersten
2011-Jan-07 15:02 UTC
Re: [Puppet Users] facter --puppet does not report "environment"
On Fri, Jan 7, 2011 at 6:07 AM, Mohamed Lrhazi <lrhazi@gmail.com> wrote:> Thanks a lot Nigel... I do need to learn to create custom facts indeed.I should add that even without this custom fact, "$environment" is available to use as a variable in your Puppet manifests. It''s just not a fact, it''s exposed as a global variable.> > > On Thu, Jan 6, 2011 at 11:22 PM, Nigel Kersten <nigel@puppetlabs.com> wrote: >> facter --puppet shows the facter facts, plus any that have been >> delivered by puppet and pluginsync. >> >> "environment" isn''t a fact by default. You could make a fact that >> reported on the Puppet environment setting however. >> >> require ''puppet'' >> >> Facter.add("environment) do >> setcode do >> Puppet[:environment] >> end >> end >> >> [1] - UNTESTED in anything other than a quick interactive session. >> >>> > > -- > 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+unsubscribe@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-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Tony G.
2011-Jan-07 15:54 UTC
Re: [Puppet Users] facter --puppet does not report "environment"
It probably would be good idea to have a facter of the environment, guess that could be a very quick way to know what environment the client/agent is using. On Fri, Jan 7, 2011 at 9:02 AM, Nigel Kersten <nigel@puppetlabs.com> wrote:> On Fri, Jan 7, 2011 at 6:07 AM, Mohamed Lrhazi <lrhazi@gmail.com> wrote: > > Thanks a lot Nigel... I do need to learn to create custom facts indeed. > > I should add that even without this custom fact, "$environment" is > available to use as a variable in your Puppet manifests. > > It''s just not a fact, it''s exposed as a global variable. > > > > > > > On Thu, Jan 6, 2011 at 11:22 PM, Nigel Kersten <nigel@puppetlabs.com> > wrote: > >> facter --puppet shows the facter facts, plus any that have been > >> delivered by puppet and pluginsync. > >> > >> "environment" isn''t a fact by default. You could make a fact that > >> reported on the Puppet environment setting however. > >> > >> require ''puppet'' > >> > >> Facter.add("environment) do > >> setcode do > >> Puppet[:environment] > >> end > >> end > >> > >> [1] - UNTESTED in anything other than a quick interactive session. > >> > >>> > > > > -- > > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Tony http://blog.tonyskapunk.net -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.