help-cfengine
[Top][All Lists]
Advanced

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

Imports act weird...any good workarounds?


From: Paul Krizak
Subject: Imports act weird...any good workarounds?
Date: Thu, 29 Apr 2004 13:38:09 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

I'm working on deploying cfengine for our cluster of around 2800 hosts. One of the problems I've run in to is that the "import:" directive doesn't function as expected. According to the documentation, imports are processed *after* the main script runs (as oppsed to before, like pretty much all other languages). I've got a file, cf.classes, that contains information about the global classes (and some global variables) that I'd like to be able to use in other cf.* files. When I use the import: directive in one of these files, for example:

import:
 any::
   cf.classes

editfiles:
 tx::
    do some TX stuff

 ca::
    do some CA stuff

the "tx" and "ca" classes are defined in the cf.classes file, but have no effect in this file. Is there any way to force cfagent to apply the settings in import: directives *before* it runs the rest of the script?

The only workaround I can think of is "running" cf.classes, and defining some environment variable so that cf.classes sets up the global stuff, then *it* imports the cf.* file that I want to run. This solution is kludgy, though; I'd rather have the cf.* files be more script-ish and use the import: directive as expected.

--
Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, Tx  78741
MPD Linux Systems                   Phone: (512) 602-5860
Paul.Krizak@amd.com






reply via email to

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