help-cfengine
[Top][All Lists]
Advanced

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

Re: importing files


From: Dustin Sorge
Subject: Re: importing files
Date: Tue, 15 Mar 2005 11:46:45 -0500
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Atom Powers wrote:


My cfagent.conf file is very bare. Just a control section and a list of
groups and imports. This way I have all my importing and class in one place
and I don't have to worry about recursive imports.

I have something like this;

groups:
        seattle_network = ( IPRange(192.168.0.0/23) )
        webservers = ( www0 www1 www2 )

import:
        any::
                main.cf

        seattle_network::
                seattle.cf

        webservers::
                wwwsvr.cf                               


----
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
Edward F. Brown
Sent: Monday, March 14, 2005 5:12 PM
To: Dustin Sorge
Cc: help-cfengine@gnu.org
Subject: Re: importing files

I currently have a file (groups.cf) which defines a number of groups. I want to be able to import this file into my cfagent.conf file (as well as others). Since the groups can change I would rather make the changes in one file and have it propagate to the others instead of going through each file individually and modifying the groups. What would the syntax be for importing this groups.cf file and referencing the groups contained in it in my .conf files? Any suggestions would be much appreciated.


Dustin,

Cfengine configuration files aren't really "imported into" other
configuration files.  Instead, they are "imported", or parsed and acted on,
by a running instance of cfagent on a given machine.  groups.cf is typically
one of a couple of configuration files that every host is going to want to
"import" or read, so often (but not necessarily) the import statement for it
is in cfagent.conf.  So in cfagent.conf, you might do
this:

import:
   groups.cf
   main.cf

Now you can use the groups (aka, classes) defined in groups.cf in main.cf, or
any subsequently imported files.  You can even use them in cfagent.conf,
though you may need to list them in an "AddInstallables"
variable declared in a 'control:' section there.  So in main.cf, you might
have:

import:
 WebServer::
   webserver.cf

-Ed



_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine


In the replies I have recieved I am noticing that everyone has a main.cf. It a main.cf required or is it just a matter of convenience? Is it possible to get away with just importing groups.cf

import:
   any::
      groups.cf

thanks everyone for the helpful suggestions, they have been great

   -- Dustin Sorge

--
Dustin Sorge HPC System Administrator Pittsburgh Supercomputing Center Carnegie Mellon University
4400 Fifth Avenue
Pittsburgh, PA 15213




reply via email to

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