[Puppet Users] Determining puppet env from client
Hi - I've just starting working with a complex puppet environment that's running with dozens of different environments. The PE console doesn't really seem to give me a way to filter views of machines by anything other than facts. So I'm wondering if there's a fact I can use to determine which environment a puppet agent is running in? I can't see anything out ofthe box from facter, and also can't seem to get anything useful from puppet config cmd. Our environment is being fed from the ENC in PE, rather than the local puppet.conf file, so examing that is no use. The only place I can seem to see any references ot the env. is in the last_run_report in the cache - is that the best place to find this info? Thanks Dave -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f41e941a-0212-4cdb-adef-d6fc56494141n%40googlegroups.com.
Re: [Puppet Users] Determining puppet env from client
Hi Maritn, thanks for answering. Yes, that's the sort of thing I was expecting to see But, I have no such fact listed. I wondered if this was a consequence of having an old copy of puppet agent installed - the box I'm testing on is running 3.5 - but the lists of 'core facts'; on puppet's website don't list an 'environment' fact, and I can't find any fact in the PE console's fact dialog box. Have I misunderstood your comment? Thanks On Tuesday, 22 June 2021 at 13:31:14 UTC+1 Martin Alfke wrote: > Hi Dave, > > On PE Console, select a Node to view Node facts and check the environment > Variable. > This variable is set on Master side, not agent side. > Check that the environment variable matches to the PE selected node > environment. > You should then be able to filter using the environment “Fact”. > > Best, > Martin > > > On 22. Jun 2021, at 13:58, daveford...@gmail.com > wrote: > > Hi - I've just starting working with a complex puppet environment that's > running with dozens of different environments. > > The PE console doesn't really seem to give me a way to filter views of > machines by anything other than facts. So I'm wondering if there's a fact > I can use to determine which environment a puppet agent is running in? I > can't see anything out ofthe box from facter, and also can't seem to get > anything useful from puppet config cmd. Our environment is being fed from > the ENC in PE, rather than the local puppet.conf file, so examing that is > no use. The only place I can seem to see any references ot the env. is in > the last_run_report in the cache - is that the best place to find this > info? > > Thanks > Dave > > -- > 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 puppet-users...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/f41e941a-0212-4cdb-adef-d6fc56494141n%40googlegroups.com > > <https://groups.google.com/d/msgid/puppet-users/f41e941a-0212-4cdb-adef-d6fc56494141n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/87891db5-2feb-448f-9a1d-ed215496cde1n%40googlegroups.com.
[Puppet Users] Custom fact query
Total ruby noob and first time trying to right a custom fact. It does look too complication and I've sort of got this working.. But one question - from the puppet documentation gives two ways of using a 'confine'. This lets me custom fact produce output via facter on my gentoo box as expected confine :kernel => "Linux" But this produces no output - confine :kernel do |value| value == "Linux" end What am I failing to understand- the documentation would suggest both should work? Am trying this on a Mint box running facter 4.4.0 and ruby 3.0.2 Thanks in advance. Dave -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b872c7ac-9072-43e2-81fd-9e3a7f4fb235n%40googlegroups.com.
[Puppet Users] Re custom fact query
To clarify, tried this on various systems - facter 4.4.0 and ruby 3.0.2 on Ubuntu Mint and facter 4.7.0 and ruby 3.1.4 on gentoo. Examples taken from the puppet documentation on writing custom facts. On Wednesday 8 May 2024 at 10:12:31 UTC+1 daveford...@gmail.com wrote: > Total ruby noob and first time trying to right a custom fact. It does look > too complication and I've sort of got this working.. But one question - > from the puppet documentation gives two ways of using a 'confine'. > > This lets me custom fact produce output via facter on my gentoo box as > expected > confine :kernel => "Linux" > > But this produces no output - > confine :kernel do |value| > > value == "Linux" > > end > What am I failing to understand- the documentation would suggest both > should work? > > Am trying this on a Mint box running facter 4.4.0 and ruby 3.0.2 > > > Thanks in advance. > Dave > -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1da07872-5d29-42e8-9aa6-62c3feb4087fn%40googlegroups.com.