----- Original Message -----
> 
> no seems I am still missing something:
> 
>    $puppet_application_mode = Puppet::Util::RunMode[:agent]
>    $puppet_application_name = :agent
> 
>    Puppet.settings.use :main, :agent
>    Puppet.parse_config
> 
>    p Puppet[:classfile]
>    p Puppet[:pidfile]
> 
> with classfile set in [agent] it's reading the right classfile,
> however with this code :pidfile would be /var/run/puppet/apply.pid rather
> than /var/run/puppet/agent.pid.  pidfile is not specifically set in the
> config so it should come from defaults

following up here it seems the order of requires matter, if you just 
require puppet before setting $puppet_application_name it assumes apply

so:

   $puppet_application_name = :agent
   require 'puppet'
   $puppet_application_mode = Puppet::Util::RunMode[:agent]

   Puppet.settings.use :main, :agent
   Puppet.parse_config

works, but if I set the application name after the require puppet its
stuck in apply.

As it turns out this is almost impossible to control in my use case, is there
a way to properly reparse the settings if $puppet_application_name changes?

-- 
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