[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setting variables with a pluging
From: |
Mark . Burgess |
Subject: |
Re: setting variables with a pluging |
Date: |
Fri, 4 Oct 2002 07:27:14 +0200 (MET DST) |
THe reason seems to be that the variable expansion was a few lines
too late in the code to work as it was intended. However, if you
just want to choose a server based on IP address, why don't you
do something like this:
copy:
128_38_89::
/src1 dest=/dest server=server1
128_39_74||192_0_2_1::
/src2 dest=dest server=2
Meanwhile, I'll fix the otherthing in the coming weeks.
best,
Mark
On 2 Oct, Bettilyon, Allen wrote:
> 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
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~