On Mon, May 2, 2011 at 11:16, Peter Meier <[email protected]> wrote:

> thanks for your answer.

I only wish I had a better answer to give you at this stage.

>> The only way to specify the run mode is at the very start of the
>> application; this is one of the limitations of the older Puppet
>> architecture that we didn't completely excise during the initial move
>> to faces.  Specifically, you need to pass it on the command line:
>>
>> ] puppet --mode {user,agent,master} node clean # or whatever...
>>
>> That will set the run mode before it does the rest of the command line
>> parsing, invokes your face and action, or anything like that.
>>
>> To make the certificate face work as expected you have to do the same
>> thing: set the run mode globally, for all faces, before any face is
>> invoked.
>
> hmm, this makes faces not so useable for certain cases. So for example
> the clean face: Setting the mode on the cli is quite cumbersome, and I'm
> not really happy to propose a face, that only works with an additional
> cli flag, to be included in the core.

I agree.  Part of the problem is that faces are young, and we can't
rearchitect the entire Puppet system before 2.7.0 is due out; this
assumption that run-mode is fixed at startup time is pretty darn core
in the entire set of assumptions the code used to make.

That said?  You /can/ change run-mode dynamically.  We don't make
promises about that always working, but it is reasonably stable as far
as I can tell.  (Essentially, if it tests stable it probably is, but
we don't universally test for code that makes assumptions that it is
static.)

> * fix setting mode before 2.7. Is this feasible?

Nope.  There is basically no chance you could do that.

> * Ship things that require an ugly face/cli-options chain. Could we then
> at least say that certain actions require master mode and abort
> otherwise? One option is to manually test it on our own in the action,.
> The other way would be to have a more declarative way, where we can
> require run modes for an action and abort execution in a more generic
> and clean way. (With a nice error message and so on...)

So, you can declare your run-mode in your face application shell, if
you want.  If you only require 'master' mode then declaring it in
there will work for now, and we can sort of the rest later.

> It would be nice to have the first option, otherwise various faces will
> look quite half baken. However, I don't know all the internals and
> further plans to decide and say whether it's actually feasible. So #2
> would also be fine, although rather hacky and smelly.

Yah.  Sadly, there is no chance we can fix that before release.  Sorry.

> Other options?

I think you covered it.

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <[email protected]>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

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

Reply via email to