help-cfengine
[Top][All Lists]
Advanced

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

RE: "include" files


From: Wheeler, John
Subject: RE: "include" files
Date: Thu, 19 Dec 2002 10:32:37 -0600

I'm just starting to break out my files and follow a similar philosophy. I have two questions:
1) If I have control sections in my includes, are they all concatenated in order of include?

In other works, if I have:

cfagent.conf
        import:
                cf.blah
                cf.blah2

cf.blah
        actionsequence ( files copy shellcommands )

cf.blah2
        actionsequence ( copy tidy files shellcommands )


will the following action sequence be compiled:
files
copy
shellcommands
copy
tidy
files
shellcommands

?

2) I've been searching for why cfengine has two passes. When I run cfagent, it states that it does
everything in the action sequence twice (pass 1 and pass 2).  I vaguly remember reading about this
somewhere, but I can't remember where.

> -----Original Message-----
> From: Wipf, Stefan [mailto:Stefan.wipf@gs.com]
> Sent: Tuesday, December 03, 2002 10:36 AM
> To: Martin A. Brooks
> Cc: help-cfengine@gnu.org
> Subject: Re: "include" files
>
>
> This does not scale as well as you might think.  You might
> also want to copy, link then copy again.  We have arranged
> our config files by function instead:
>
> cfagent.conf:
>  import:
>    any::
>      cf.globalclasses
>      cf.globalvariables
>      cf.main
>
> in cf.globalclasses and cf.globalvariables we define classes
> and variables that may be used by any 'agent' cf.main imports
> the individual self-contained 'agents'
>
> cf.main:
>  import:
>    any::
>      cf.nis
>      cf.hosts
>      cf.auto
>      cf.dns
>      cf.ntp
>      cf.inetd
>      cf.passwd
>      ...
>
> here is a simple example of an agent:
>
> cf.ntp:
>  control:
>   actionsequence = (
>                      copy._ntp
>                      shellcommands._ntp
>                     )
>  groups:
>   _ntp_server    = ( somemachinename )
>   
>  copy:
>   _ntp._ntp_server::
>     ${gold}/etc/ntp.conf.default   dest=/etc/ntp.conf
> define=_ntp_bounce
>   _ntp.!_ntp_server::
>     ${gold}/etc/ntp.conf.ntpserver dest=/etc/ntp.conf
> define=_ntp_bounce
>
>  shellcommands:
>   _ntp._ntp_bounce::
>     "/etc/init.d/xntpd restart"
>
>
> The actionsequence class '_ntp' is what makes the whole thing
> work. See 'actionsequence classes' in the Tutorial
>
>
>
>
> "Martin A. Brooks" wrote:
> >
> > Hi
> >
> > I'd like to split up a lengthy cfagent.conf file by section rather
> > than by class. i.e. one text file for "links", one for
> "edit", one for
> > "shellcommands" etc, and then glue these together in the main
> > cfagent.conf
> > file:
> >
> > actionsequence ( editfiles links shellcommands )
> > #include "./include/editfiles.cfagent"
> > #include "./include/links.cfagent"
> >
> > and so on...
> >
> > I think I'm simply not seeing how this can be achieved. 
> Any pointers
> > appreciated.
> >
> > Thanks
> >
> > Martin A. Brooks
> > ---------------------------------
> > I/O, I/O, it's off to disk we go,
> > A bit or byte, to read or write,
> > I/O, I/O, I/O......
>
>
> --
> Stefan Wipf
> swipf@htc.com
> voice: (312) 697-2540
> fax:   (312) 697-2785
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-> cfengine
>


reply via email to

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