Hi I''d like to be able to test if stored config is enabled and active, and if not then react (eg. notice or die). Is there any way of doing this? Thanks Dom -- 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.
anyone? anyone? (bueller? bueller?) are there internal puppet variables or some such that show puppet state/config that can be interrogated in a manifest? any other way of telling if storedconfig is enabled? the two ways i can think of: - assume puppetmaster config is /etc/puppet/puppet.conf and grep for expected storedconfig parameters - add some static data to the database and retrieve through collecting resources and testing for expected data both these are a bit ''bodgy'', and could potentially show false positives or negatives. would prefer a more direct test if anyone knows if it is possible? thanks dom On Jul 29, 4:37 pm, dom <domiji...@googlemail.com> wrote:> Hi > > I''d like to be able to test if stored config is enabled and active, > and if not then react (eg. notice or die). > > Is there any way of doing this? > > Thanks > Dom-- 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.
On Aug 4, 2:33 am, dom <domiji...@googlemail.com> wrote:> anyone? anyone? (bueller? bueller?) > > are there internal puppet variables or some such that show puppet > state/config that can be interrogated in a manifest? any other way of > telling if storedconfig is enabled?I''ve never tried, so I dont know if there''s a righter way to do it. You may be able to access the config information from a rvalue function inside your manifest. Take a look at Puppet.settings[:storeconfigs]. As I recall here are different settings for different sections of your config though. You should be able to poke around at Puppet.settings from IRB. Take a look at the scripts in contrib to get there. -- 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 can: * Check that there is data in your db :) * enable rails debugging in puppet (search the archives here for more info) * Use on of the features which requires storeconfigs ;) Ohad On Thu, Aug 5, 2010 at 10:28 PM, donavan <donavan@desinc.net> wrote:> On Aug 4, 2:33 am, dom <domiji...@googlemail.com> wrote: > > anyone? anyone? (bueller? bueller?) > > > > are there internal puppet variables or some such that show puppet > > state/config that can be interrogated in a manifest? any other way of > > telling if storedconfig is enabled? > > I''ve never tried, so I dont know if there''s a righter way to do it. > You may be able to access the config information from a rvalue > function inside your manifest. Take a look at > Puppet.settings[:storeconfigs]. As I recall here are different > settings for different sections of your config though. You should be > able to poke around at Puppet.settings from IRB. Take a look at the > scripts in contrib to get there. > > -- > 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. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
> I''ve never tried, so I dont know if there''s a righter way to do it. > You may be able to access the config information from a rvalue > function inside your manifest. Take a look at > Puppet.settings[:storeconfigs]. As I recall here are different > settings for different sections of your config though. You should be > able to poke around at Puppet.settings from IRB. Take a look at the > scripts in contrib to get there.thanks this put me in the right direction. it has to be done through a custom function, either test Puppet[] which seems to be a magic array, or you can do something like: Puppet[:config] = "/etc/puppet/puppet.conf" Puppet.parse_config pm_conf = Puppet.settings.instance_variable_get(:@values) if pm_conf[:puppetmasterd][:storeconfigs] == true or pm_conf[:master] [:storeconfigs] $storeconfigs = true end this is important to test if you''re relying on correct data from exported resources, if it''s not set you''ll just get blank results and pushing data up goes nowhere. -- 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.