[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
copy: templates
From: |
Will Lowe |
Subject: |
copy: templates |
Date: |
Wed, 14 May 2003 02:33:21 -0700 |
User-agent: |
Mutt/1.5.3i |
I'm using cfengine 2.x (right now 2.0.4, but I don't mind upgrading)
under Debian woody. Let's say I have several variables set in my
cfagent program named $cfgroot, $site, $type, and $host, with the
obvious meanings.
I'd like to do something like this:
copy:
$cfgroot/$host/etc/resolv.conf dest=/etc/resolv.conf recurse=inf
# if it exists, otherwise try:
$cfgroot/$type/etc/resolv.conf dest=/etc/resolv.conf recurse=inf
# if it exists, otherwise try:
$cfgroot/$site/etc/resolv.conf dest=/etc/resolv.conf recurse=inf
# if it exists, otherwise try:
$cfgroot/default/etc/resolv.conf dest=/etc/resolv.conf recurse=inf
... in other words, I'd like to be able to maintain (possibly partial)
sets of configs for each of $site, $type, $host, and a default set,
and have cfengine automatically find the "most specific" action to
apply.
An additonal catch is that I'd like to do it for *every* *single* copy
statement anywhere in the cfagent config (find the most specific
resolv.conf, the most specific set of apache configs, the most
specific /etc/nsswitch.conf, etc.) -- a generic templating system.
Using groups/classes might be possible:
sitefoo.farma:
copy resolv.conf.1234
sitefoo.!farmb.farmc.!sitebar:
copy resolv.conf.4321
siteBaz.farmF:
copy resolv.conf.0987
... but with 15 farms, 1000 servers, and 10 sites, the number of
possibly needed rules becomes insane. It'd be a lot simpler if
cfengine could find the "best match" somehow on its own ... any ideas?
--
thanks,
Will
- copy: templates,
Will Lowe <=