help-cfengine
[Top][All Lists]
Advanced

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

Re: Understanding output, modifying output, importing groups


From: Tim Nelson
Subject: Re: Understanding output, modifying output, importing groups
Date: Fri, 28 Jan 2005 12:28:17 +1100 (EST)

On Thu, 27 Jan 2005, Brian E. Seppanen wrote:

I'm trying to understand the output of cfengine a bit better.   I have
several hosts that run cfexecd on a 15 minute interval.

I'm running 2.1.10.   My cfagent consists of


import:

       any::
               /var/cfengine/inputs/cf.groups
               /var/cfengine/inputs/cf.main


My cf.groups is something

       service1 = ( hosta hostb hostc hostd )
        service2 = ( hoste hostf hostg )

my cf.main consists of

control:


       actionsequence  = ( copy shellcommands )
       TrustKey        = ( true )
       TrustKeysFrom   = ( master )
       domain          = ( domaina )
       Underscore_Classes = ( on )
       sysadm          = ( address@hidden )
       access          = ( root )
       smtpserver      = ( smtp.domaina )
       EmailFrom       = ( address@hidden )
       EmailMaxLines   = ( 10000 )
       EditfileSize    = ( 800000 )
       IfElapsed       = ( 2 )
       ExpireAfter     = ( 2 )
       SkipVerify      = ( true )
       OutputPrefix    = ( "main=>" )


copy:

       servicea::

               /var/cfengine/services/servicea/cf.servicea
                       dest=/var/cfengine/inputs/cf.servicea
                       server=master
                       trustkey=true
                       encrypt=true
                       force=true

        serviceb::

               /var/cfengine/services/serviceb/cf.serviceb
                       dest=/var/cfengine/inputs/cf.serviceb
                       server=master
                       trustkey=true
                       encrypt=true
                       force=true

shellcommands:

       servicea::

               "/var/cfengine/sbin/cfagent -i -f 
/var/cfengine/inputs/cf.servicea"

       serviceb::

               "/var/cfengine/sbin/cfagent -i -f 
/var/cfengine/inputs/cf.serviceb

This isn't relevant to the question you asked, but is there a particular reason this shellcommands section can't be replaced with:

import:
        servicea::
                cf.servicea
        serviceb::
                cf.serviceb

So my undertanding of the scenario is that cfexecd calls cfagent which
uses cfagent.conf,  cfagent.conf does nothing more than import some groups
into play.   Those groups are evaluated and if the host belongs to one of
those groups it pulls a specific service cf.

So I get the following output.   And I see the same action twice.   Once
listed under cfagent output denoted by main=> and once under os/linux.cf
denoted by linux+host->

cfengine::in/cfagent -i -: main=>:in/cfagent -i -:
linux+host->:newaliases: /etc/aliases: 154 aliases, longest 287 bytes,
8244 bytes total
main=>:in/cfagent -i -: linux+hostr->:newaliases:
/etc/aliases: 154 aliases, longest 287 bytes, 8244 bytes total

Is there any way that I can either have all output listed under cfagent
and not listed under subcategories, or vice versa?   Or would I need to
restructure so that I'm using a single cfagent.conf?

I like the method we have for maintaining seperate cf's under a seperate
hierarchy.    It could be that I'm just blind to an obvious solution.
Would anyone mind commenting?   How have others handled groups and
imports and the corresponding output.

Is this for separate networks? If so, I solved it with a Perl templating solution similar to the one below.

http://sourceforge.net/project/showfiles.php?group_id=115927&package_id=137971

The link above links to a basic setup of cfengine config files, and is only intended to be installed on the master cfengine server. It had a little bit of extra code in cf-pt-conv to generate separate internal and external versions, and some extra code in cfedit to push out the config from my internal server to my external server. That was at a previous workplace. I wouldn't say it's any better or worse than what you have, just different (although it *does* have the advantage of being able to use Perl templating in cfengine files :) ).

--
Tim Nelson
Server Administrator
WebAlive Technologies Global
Level 1 Innovation Building, Digital Harbour
1010 LaTrobe Street
Docklands, Melbourne, Vic, 3008
Phone: +61 3 9934 0812
Fax: +61 3 9934 0899
E-mail: address@hidden
http://www.webalive.biz/

"Your Business, Your Web, Your Control"




reply via email to

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