oops.. i thought i sent this originally to the list (sorry everyone).  Since
I messed up I'm going to clarify the text based on the discussion seth and I
had and attach the second patch set.  See below.

---------- Forwarded message ----------
From: Greg Swift <[email protected]>
Date: Mon, Dec 6, 2010 at 21:45
Subject: Re: [Func-list] delegation (Now with more PATCH)
To: seth vidal <[email protected]>


On Mon, Dec 6, 2010 at 14:19, seth vidal <[email protected]> wrote:

> On Sun, 2010-11-21 at 19:00 -0600, Greg Swift wrote:
> > We recently re-worked our infrastructure to utilize delegation.  It
> > got me started on thinking that it would be great if the overlord
> > could be configured to default to delegation, i'm assuming in
> > overlord.conf.  As I started playing around with some of the new
> > scripts (ie func-command) to enable delegation, it occurred to me that
> > it might be as cut and dry as I thought it would be.  Enabling
> > delegation in the scripts as a cli option is easy, but based on what
> > I'm seeing in how settings and such work, overriding the config file's
> > entry would be less so.  Maybe I'm missing something, so thought I'd
> > ask if anyone had any suggestions on the implementation?
>
> Hey,
>  1. sorry for long lag in responding. Thanksgiving gave me a cold and
> kicked the crap out of my will to reply to email. :(
>

Not a problem, either sick or holidays are good reasons to not be keeping up
here :)


>
>  2. I'm confused what you're asking for. Do you want to change your
> overlord configs occasionally on the commandline of things like
> func-command?
>

Maybe it would be useful to let some of the cli options become overlord
config defaults, but the only one we use enough to have looked into is
delegate.

Most of the new commands in the scripts/ don't seem to take delegation into
account, but they also look very helpful.  Since we are moving to
multi-level delegation implementation and I want to reduce the amount of
info my admins have to type every time (yes its just a -d when it works, but
still, if its always it kind stinks to have to type it).  The goal is not to
turn delegate on by default, but to make it where it can be configured as a
default on a system.  Then the ability to override the system config when
running an individual command is the other part of the patch set.

A use case for that would be:

In my delegated environment I have delegate=True in overlord.conf. But right
now i want to run the command only against my hosts's minions without
delegation.  Instead of changing the overlord.conf I can just add
--no-delegate my call.

In the effort to provide additional clarification I'm attaching a patch set
that does the following:

- Added delegate as a default Overlord config option, including placing it
in the overlord.conf.  The default value is False.
- Adjusted default Overlord class to define delegate as None in its option
list.
    The logic behind this is that the Overlord config has a default value of
false.  If a call plans on
     overriding the default option of the system, it can do so, thus
changing None to True/False.
     If delegate is passed in as none, then they want the system default.
- Added delegate and no-delegate as options in
func.overlord.scripts.base_func_parser (default to None)
- Implemented the new delegate cli options inside most of the scripts under
the scripts directory (just func-command in the first patch set)
- Added a line return on the mapfile load error message for delegation for
cleaner output.

In the basic test bed I had to play with it seems to work.  Luckily enough,
while the various commands do need to be modified to provide the cli on/off
switch for delegation, the default defined in /etc/func/overlord.conf seems
to take immediate effect.  You can see this by changing it to True and then
trying a call command.

I threw together a patch set of the other scripts, and while for most it was
easy enough to add ",delegate=opts.delegate" into the Client
initializations.  However func-yum and func-ps-compare required a bit more
change, and thus i'm concerned to make sure others that have used them
ensure they still work properly.  I didn't touch func-transmit, however I
can see the need for it to be updated from a feature support standpoint.
However it isn't using some of the newer modules, so I didn't dig to deep at
this point.

-greg

Attachment: 0001-Added-delegate-as-a-default-Overlord-config-option-i.patch
Description: Binary data

Attachment: 0001-updated-Client-call-in-scripts-in-scripts-to-include.patch
Description: Binary data

_______________________________________________
Func-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/func-list

Reply via email to