|
From: | Luke Youngblood |
Subject: | RE: Copy to multiple destinations |
Date: | Wed, 8 Jun 2005 08:25:23 -0400 |
Good post. I have been contemplating
how to implement cfengine on some of our clustered servers as well. Although
I haven’t implemented it yet, I think this can safely be done using the FileExists
class. The logic is that if the clustered filesystem isn’t mounted,
certain files won’t exist, therefore, you can skip the relevant copy
section on that server. The limitation is that you have to write every
possibility into your file. Here is a quick implementation that I wrote
up in a few minutes: control: actionsequence = ( copy ) classes: primary_node_AA = FileExists
(/some/path/AA/network/admin/tnsnames.ora) primary_node_AB = FileExists
(/some/path/AB/network/admin/tnsnames.ora) primary_node_AC = FileExists
(/some/path/AC/network/admin/tnsnames.ora) <snip> copyfiles: primary_node_AA:: (copy
statements go here) primary_node_AB:: (copy
statements go here) primary_node_AC:: (copy
statements go here) Essentially, you list each one of your
clustered filesystems and set a class if the tnsnames.ora file exists on that
filesystem. If so, the copy statement gets evaluated. If not,
it gets skipped. HTH, Luke From: help-cfengine-bounces+lyoungblood=phonechargeinc.com@gnu.org
[mailto:help-cfengine-bounces+lyoungblood=phonechargeinc.com@gnu.org] On Behalf Of Martin, Jason H Is
there any way to have a file copied to a variable number of destinations?
I'm looking for a way to keep a set of Oracle installations in sync. Since
the boxes are clustered, there is a set of hosts which may have 0 or more
oracle installations in seperate directories under /some/path. Each
directory has a file network/admin/tnsnames.ora. There is supposed to be just
one master copy of tnsnames.ora, so I'd like Cfengine to copy the gold
tnsnames.ora to /some/path/XX/network/admin/tnsnames.ora, where XX is a list of
directories populated in a variable by a module or (preferably) a wildcard
expansion that is then evaulated by a filter. However, there doesn't seem to be
any way in Cfengine to express this. Since
the number of directories under /some/path is variable, it isn't feasible to
write individual stanzas for each directory as a filesystem may be unmounted
and moved to another host at any time. The filesystems are SAN-based, so
unlike a NFS server there is no 'central home' where it would be reasonable to
hardcode each individual directory into a stanza. As
it happens, each /some/path/XX is a home directory, but they aren't all Oracle
installations and so copying it to just 'homes/network/admin/tnsnames.ora'
doesn't seem very elegant. I
am looking at several scenarios like this, so the solution can't be Oracle
specific (as in 'use Oracle Internet Directory' or 'define TNS_ADMIN to a
central directory'), however the Oracle one is the easiest to explain. I
have a feeling that the underlying problem is the same one mentioned at http://lists.gnu.org/archive/html/help-cfengine/2005-04/msg00094.html,
and that CFE 3 is the only solution aside from a custom shellcommand. However,
I thought I would ask anyway. Does anyone have any suggestions on how I might
approach this? Thanks,
|
[Prev in Thread] | Current Thread | [Next in Thread] |