help-cfengine
[Top][All Lists]
Advanced

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

setting variables with a pluging


From: Bettilyon, Allen
Subject: setting variables with a pluging
Date: Wed, 02 Oct 2002 11:33:12 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020826

Hello,

Wondering why this is not working:


control:

   actionsequence = (
       module:base_class
       copy
   )

copy:

   /some/file    dest=/some/file
                       server=$(update_host)


When the output of module:base_class has the following line:

=update_host=10.11.1.252


The error I get is:

cf:host1:/var/cfengine/inputs/update.conf:49: DNS lookup failure. Unknown host
Culprit: ${update_host}
Make sure that fully qualified names can be looked up at your site!
i.e. www.gnu.org, not just www. If you use NIS or /etc/hosts
make sure that the full form is registered too as an alias!
gethostbyname: : No such file or directory

I know the variable is getting set, becuause if I swap the copy for the following shellcommand:
  "/bin/echo update_host: $(update_hosts)"

Than I see the output of the proper ip address according to the logic in the plugin.


I'm guessing it has to do with a parseing order. The copy context is checked before the module is executed. Anyone have any sudgestions on how to achieve this differently? I'm trying to create a global update.conf that I can push to all hosts that is intelligent enough to know where to grab the updates from, based on ip address.
- Allen









reply via email to

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