help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autodefine


From: Josh Lothian
Subject: Re: Autodefine
Date: Wed, 18 May 2005 07:41:16 -0400
User-agent: Mutt/1.5.6i

On Tue, May 17, 2005 at 06:12:08PM -0700, Russell Van Tassell wrote:
> > ----
> > control:
> >   actionsequence = ( copy shellcommands )
> >   singleCopy = ( on )
> >   restart_syslogd::
> >     autodefine = ( /etc/syslog.conf )
> > copy:
> >   any::
> >     ${local_config_root}/_etc_syslog.conf/$(os).$(osrel) 
> > dest=/etc/syslog.conf mode=0444 owner=0,0
> >     ${local_config_root}/_etc_syslog.conf/$(os) dest=/etc/syslog.conf 
> > mode=0444 owner=0,0
> >     ${local_config_root}/_etc_syslog.conf/generic dest=/etc/syslog.conf 
> > mode=0444 owner=0,0
> > shellcommands:
> >   restart_syslogd::
> >     "/bin/echo restarting syslog"
>
> Why don't you just use an "AddInstallable" and "define" statement in the
> copies?
> 
> Shouldn't your copy rules be in the opposite order, by the way, assuming
> you want a specific release to override a generic, right?  Or is it
> bottom-up rather than top-down?

With SingeCopy = ( on ), only the first instance of a named destination
will be copied, so it will grab the first syslog.conf that is applicable.
the rest of them are then ignored.

As to why I'm try use AutoDefine instead of define and
AddInstallable.. well, we're actually looking at closer to 5 ot 6
different files that might be copied rather than the 3 in the example.
If I decide later that we need to, say, restart sshd when sshd_config is
copied, I'd like to be be able to add just those two lines for autodefine
rather than change X lines somewhere way down in the file.

To me at least, it's nice to be able to glance at the control section
and see which classes will be defined for a specific file being copied.
But if AutoDefine is broken, I may end up having to do it the old
fashioned way anyway.

-jkl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]