[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: actionsequence question
From: |
Chip Seraphine |
Subject: |
Re: actionsequence question |
Date: |
Fri, 12 Mar 2004 08:16:52 -0600 |
User-agent: |
KMail/1.5.4 |
The reason I need to have a file copied prior to the groups section is
because I wish to use an evaluated class to make a decision, and the
presence of that file is required. In this case, I am copying some files
into place that perform some diagnostics, then using ReturnsZero() to set a
class based on the output of the diagnostics.
I got it working by simply doing the copying in the update.conf file. I was
wanting to avoid as an optimization; the test in question only runs once a
day, so the file need only be synced up once a day. The logic that
determines when it should run lives in cfagent.conf, hence putting the copy
in update.conf means that I check the files every time. Not a big deal, it
just means that I do a little more I/O then I wanted.
I have no objection to the way groups are ordered; this is only an issue for
me because I want to use an evaluated class, and those only seem to work in
groups:.
On Friday 12 March 2004 01:42, Mark.Burgess@iu.hio.no wrote:
>
> I don't understand why you need copy before groups. If you want to
> define groups as a result of copy use define= ?
>
> Groups are just definitions, and cfengine does not guarantee the
> ordering of anything unless you use define=
>
> This might be a job for AddInstallables ?
>
> M
>
> On 7 Mar, Brendan Strejcek wrote:
> > Chip Seraphine wrote:
> >
> >> My cfagent.conf imports a file (call it cf.import). I want a copy
> >> action to be perfomed prior to the groups section of cf.import
> >> firing. Is there a way of doing this outside of putting the copy in
> >> update.conf? It seems currently that the groups: stuff in cf.imports
> >> fires before the copy: section of cfagent.conf.
> >
> > It appears from my experiments that all the groups are defined before
> > any actions are carried out (assuming the class is registered in
> > AddInstallable). In fact, it seems that the aggregate groups section,
> > after all imports, fires before any other action, imported or not.
> >
> > To illustrate:
> >
> > # begin cfagent.conf
> > import: import1.cf import2.cf
> > control:
> > actionsequence = ( shellcommands )
> > AddInstallable = ( asdf )
> > shellcommands:
> > !asdf:: "/bin/echo cfagent.conf asdf is not set"
> > asdf:: "/bin/echo cfagent.conf asdf is set"
> > # end cfagent.conf
> >
> > # begin import1.cf
> > control: actionsequence = ( shellcommands.import1 )
> > shellcommands:
> > import1.!asdf:: "/bin/echo import1 asdf is not set"
> > import1.asdf:: "/bin/echo import1 asdf is set"
> > # end import1.cf
> >
> > # begin import2.cf
> > groups: asdf = ( openbsd )
> > control: actionsequence = ( shellcommands.import2 )
> > shellcommands:
> > import2.!asdf:: "/bin/echo import2 asdf is not set"
> > import2.asdf:: "/bin/echo import2 asdf is set"
> > # end import2.cf
> >
> > The result is:
> >
> > $ cfagent -qK
> > cfengine::/bin/echo cfage: cfagent.conf asdf is set
> > cfengine::/bin/echo impor: import1 asdf is set
> > cfengine::/bin/echo impor: import2 asdf is set
> >
> > If asdf is not registered in AddInstallable, cfagent ignores lines that
> > reference asdf (until it becomes defined).
> >
> > $ cfagent -qk # same policy as above, save no AddInstallable
> > cfengine::/bin/echo impor: import2 asdf is set
> >
> >> (My motive is that I am trying to limit my update.conf as much as
> >> possible.)
> >
> > My workaround would be to not use the groups section and instead wrap
> > your class definition in a module, if you truly need this behavior. Then
> > you could place this module in some actionsequence and be sure that the
> > ordering will be correct.
> >
> > All tests were done with cfengine 2.1.3 on openbsd 3.4.
> >
> > Is there a reason based on convergence that this design was chosen? It
> > seems counterintuitive.
> >
> > -- Brendan
> >
> >
> > _______________________________________________
> > Help-cfengine mailing list
> > Help-cfengine@gnu.org
> > http://mail.gnu.org/mailman/listinfo/help-cfengine
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
> Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>