help-cfengine
[Top][All Lists]
Advanced

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

Re: "include" files


From: Wipf, Stefan
Subject: Re: "include" files
Date: Tue, 03 Dec 2002 10:35:52 -0600

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




reply via email to

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