hello,

I need to get Puppet to read its config file and specifically use the
settings like an agent would.

I need this for 2.7 and 3.0

In trying to figure this out for 3.0 I have the following:

   require 'puppet'
   require 'puppet/util/run_mode'
   Puppet.settings.preferred_run_mode = :agent
   run_mode = Puppet::Util::RunMode[ Puppet.settings.preferred_run_mode ]
   
Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(run_mode))

At this point Puppet[:pidfile] is /var/lib/puppet/run/agent.pid but when I do:

   # puppet agent --configprint pidfile

I get /var/run/puppet/agent.pid

What is the correct way for both 2.7 and 3.0 to initialize the settings 
and to be sure I am seeing agent settings?

It's OK if the way is completely different between versions, I have a way to
handle that.

---
R.I.Pienaar

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to