[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trying to set defaultroute to a $(variable)
From: |
Chip Seraphine |
Subject: |
Trying to set defaultroute to a $(variable) |
Date: |
Tue, 07 Oct 2003 15:37:06 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.2.1) Gecko/20030121 |
I have a module that consults an administrative database and sets the
variable $(dfltrt) to the IP address of the correct gateway for that
host. So far, so good.
However, the problem I am seeing is that no matter what I try with the
actionsequence or imports, cfengine (2.0.6) always wants to hit the
"defaultroute" section before the variable is set by the module. I've
tried numerous permutations of importing chains and running the module
at various points along it, but it seems like this is just unavoidable.
The funny part is, I seem to recall getting this to work once before
when I was testing this, but I can no longer reproduce that.
Basically, it looks like this:
control:
AddInstallable = ( found_dfltrt )
actionsequence = ( "module:get_dfltrt" shellcommands netconfig )
defaultroute:
found_dfltrt::
$(dfltrt)
shellcommands:
"/bin/echo got dfltrt $(dfltrt)
Obviously, the reality is a bit trickier, but this is the gist.
Removing the 'found_dfltrt::' line results in a syntax error as the
unexpanded variable $(dfltrt) is not valid.
The module spits out this output:
+found_dfltrt
=dfltrt=10.10.1.1
The echo statement in shellcommands prints the correct value of the
variable just fine.
If I hardcode $(dflrt) in the control: section, things work fine. This
problem only occurs if I set it via module.
Any suggestions would be greatly appreciated!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Trying to set defaultroute to a $(variable),
Chip Seraphine <=