[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cfengine 2.0.3 andplugins
From: |
José M. Fandiño |
Subject: |
Re: cfengine 2.0.3 andplugins |
Date: |
Tue, 13 Aug 2002 19:52:33 +0200 |
Hello Patrice,
I probed your solutions without any luck. Maybe, I'm losing anything. :-?
paguerlais@airfrance.fr wrote:
>
> Never forget that cfengine parser is a one pass parser, and that the
> syntactic tree is calculted during that one pass. So, when cfengine parser
> analyze your script, it sees :
> - first, a call for a module, with a parameter which is undefined as a
> cfengine variable. Then it does no substitution, and relies on a shell to
> give the variable value (some sort of an environment variable)
> - then, a value for a variable. But it is too late for actionsequence, the
> parser has already done its job.
>
> You should write :
> <solution 1>
> control:
> ender_cc_s::
> ip_vpn_peer = ( 172.16.18.19 )
> any::
> actionsequence = ( "module:link.no $ip_vpn_peer " )
>
> </solution 1>
# test 1 ###############################################
#!/var/cfengine/bin/cfagent -f
control:
AddInstallable = ( no )
Inform = ( on )
SecureInput = ( on )
SplayTime = ( 0 )
Syslog = ( log )
Verbose = ( on )
AllowUsers = ( root )
moduledirectory = ( /var/cfengine/modules )
IfElapsed = ( 0 )
ender_cc_s::
ip_vpn_peer = ( 172.16.18.19 )
any::
actionsequence = ( "module:link.no $ip_vpn_peer " )
./p1
Checksum database is /var/cfengine/checksum.db
Sleeping for SplayTime 0 seconds
Reference time set to Tue Aug 13 17:45:28 2002
Job start time set to Tue Aug 13 17:45:28 2002
*********************************************************************
Main Tree Sched: module:link.no $ip_vpn_peer pass 1 @ Tue Aug 13 17:45:28 2002
*********************************************************************
---------------------------------------------------------------------
Plug-in `module:link'
---------------------------------------------------------------------
Exec module [/var/cfengine/modules/module:link $ip_vpn_peer ]
cfengine:ender-cc-s:module:link: ping: unknown host: $ip_vpn_peer
Job start time set to Tue Aug 13 17:45:28 2002
> or (my prefered one) :
> <solution 1>
> control:
> ender_cc_s::
> ip_vpn_peer = ( 172.16.18.19 )
>
> control:
> actionsequence = ( "module:link.no $ip_vpn_peer " )
> </solution 1>
# test 2 ###############################################
#!/var/cfengine/bin/cfagent -f
control:
AddInstallable = ( no )
Inform = ( on )
SecureInput = ( on )
SplayTime = ( 0 )
Syslog = ( log )
Verbose = ( on )
AllowUsers = ( root )
moduledirectory = ( /var/cfengine/modules )
IfElapsed = ( 0 )
ender_cc_s::
ip_vpn_peer = ( 172.16.18.19 )
control:
actionsequence = ( "module:link.no $ip_vpn_peer " )
./p2
Checksum database is /var/cfengine/checksum.db
Sleeping for SplayTime 0 seconds
Reference time set to Tue Aug 13 17:46:01 2002
Job start time set to Tue Aug 13 17:46:01 2002
*********************************************************************
Main Tree Sched: module:link.no $ip_vpn_peer pass 1 @ Tue Aug 13 17:46:01 2002
*********************************************************************
---------------------------------------------------------------------
Plug-in `module:link'
---------------------------------------------------------------------
Exec module [/var/cfengine/modules/module:link $ip_vpn_peer ]
cfengine:ender-cc-s:module:link: ping: unknown host: $ip_vpn_peer
Job start time set to Tue Aug 13 17:46:01 2002
> I prefer the second because you don't have to use the class any, so it
> seems to me simpler to read and maintain. But it is just my
> point of view.
>
> Patrice
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d- s+:+() a- C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w---
O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++
G++ e- h+(++) !r !z
------END GEEK CODE BLOCK------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: cfengine 2.0.3 andplugins,
José M. Fandiño <=