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