help-cfengine
[Top][All Lists]
Advanced

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

RE: imports and file copy


From: Atom Powers
Subject: RE: imports and file copy
Date: Fri, 28 Jan 2005 08:56:13 -0800

 
Check out the example update.conf and cfagent.conf in the documentation. The
update.conf can, and probably should, be used with only minor changes (to the
domain and host variables). Get that working and you can use the lessons
learned in your other config files.

Note: I have found that in order for any copy commands to work the cfengine
server must be running cfservd and have ACLs for the directories that hold
the files to be copied.



----
Perfection is just a word I use occasionally with mustard.

Atom Powers
Systems Administrator
Pyramid Breweries Inc.
206.682.8322 x251
-----Original Message-----
From: help-cfengine-bounces+apowers=pyramidbrew.com@gnu.org
[mailto:help-cfengine-bounces+apowers=pyramidbrew.com@gnu.org] On Behalf Of
Brian E. Seppanen
Sent: Friday, January 28, 2005 6:53 AM
To: help-cfengine@gnu.org
Subject: imports and file copy

I am tearing apart much of my previous configuration, and trying to 
understand cfengine better.   Not an easy task...

I'm running cfengine 2.1.10

I have a file hierarchy on a master host with the following layout

/var/cfengine/services/
                        dns/cf.dns
                        proxy/cf.proxy
                        smtp/cf.smtp
                        servicea/cf.servicea
                        serviceb/cf.serviceb
                        ...etc...

/var/cfengine/markets/
                        marketa/cf.marketa
                        marketb/cf.marketb
                        marketc/cf.marketc
                        ...etc...
/var/cfengine/os/
                linux/cf.linux
                solaris/cf.solaris
                ...etc...

Right now I'm having a problem with getting the file in
/var/cfengine/services/servicea/cf.servicea copied to
/var/cfengine/inputs/cf.servicea

I've created a cfagent.conf as follows

control:


        actionsequence  = ( copy )
        TrustKey        = ( true )
        TrustKeysFrom   = ( masterhost )
        Underscore_Classes = ( on )
        access          = ( root )
        EmailFrom       = ( cfengine@domaina )
        EmailMaxLines   = ( 10000 )
        EditfileSize    = ( 800000 )
        IfElapsed       = ( 2 )
        ExpireAfter     = ( 2 )
        domain          = ( domaina )

import:

        any:: cf.groups

        # Service Specific
        dns:: cf.dns
        proxy:: cf.proxy


        # OS Specific
        linux:: cf.linux
        solaris:: cf.solaris

copy:

 
        linux::

                /var/cfengine/os/linux/cf.linux
                        dest=/var/cfengine/inputs/cf.linux
                        server=masterhost
                        trustkey=true
                        encrypt=true
                        force=true

        
        dns::
                
                /var/cfengine/services/dns/cf.dns
                        dest=/var/cfengine/inputs/cf.dns
                        server=masterhost
                        trustkey=true
                        encrypt=true
                        force=true 



my update.conf

control:

        actionsequence  = ( copy shellcommands ) 
        domain          = ( domaina )
        workdir         = ( /var/cfengine )
        policyhost      = ( masterhost )
        master_cfinput  = ( /var/cfengine/inputs )
        cf_install_dir  = ( /var/cfengine/sbin )
        SplayTime       = ( 2 ) # minutes
        ExpireAfter     = ( 2 )
        IfElapsed       = ( 2 )
        OutputPrefix    = ( "init->" )

copy:

        /var/cfengine/inputs/cfagent.conf
                dest=/var/cfengine/inputs/cfagent.conf
                server=masterhost
                trustkey=true
                encrypt=true
                force=true

        /var/cfengine/inputs/update.conf
                dest=/var/cfengine/inputs/update.conf
                server=masterhost
                trustkey=true
                encrypt=true
                force=true

        /var/cfengine/inputs/cf.groups
                dest=/var/cfengine/inputs/cf.groups
                server=masterhost
                trustkey=true
                encrypt=true
                force=true


shellcommands:

        "/var/cfengine/sbin/cfagent -i -v -f
/var/cfengine/inputs/cfagent.conf"

--

so if I run /var/cfengine/sbin/cfagent -v -f 
/var/cfengine/inputs/update.conf   

I am expecting that it copy an updated cfagent.conf and execute it.   In 
the cfagent.conf I'm importing the cf.groups.   If it evaluates a class 
that it belongs to it should copy the relevent updated.cf file and execute
it.

So on my master host, I delete cf.linux from /var/cfengine/inputs because I
expect it to use copy a new copy from /var/cfengine/os/linux into
/var/cfengine/inputs before it executes.

I get the output in the attached file.    It doesn't find cf.linux.   

What am I doing wrong?   It seems like it should work.   This is a pretty 
humbling experience...   Honest, I have read the documentation... and yet 
it still seems I don't "get" it.

Do I need to move my imports to update.conf?    Do I then need to move the 
copies to update.conf?   


Thanks for all of the help.

                        


Brian Seppanen
seppy@chartermi.net
608.826.1464



reply via email to

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