help-cfengine
[Top][All Lists]
Advanced

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

How to define variables using a plugin


From: Adrian Phillips
Subject: How to define variables using a plugin
Date: 31 Jul 2001 11:43:01 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Good day,

I'm trying to define variables using a shell script as a plugin but
the variables are not being used in actions later in the
actionsequence. Is this possible ?

A simple example :-

control:

        domain = ( oslo.dnmi.no )

        master_server = ( freeze )

        actionsequence = (
                "module:defvars ${cache}"
                copy
        )

copy:

        ${kernel_dir} server=${master_server} exclude=*~ dest=/usr/src recurse=1

>From the debug:

    ---------------------------------------------------------------------
    Plug-in `module:defvarstest'
    ---------------------------------------------------------------------

    Currently non existent variable $(cache)
    GetLock(actionseq,module_defvarstest,time=996572156), ExpireAfter=120, 
IfElapsed=0
    GetLastLock()
    CheckOldLock()
    
SetLock(/var/run/cfengine/lock._etc_cfengine_cf_test.pcedb86.actionseq.module_defvarstest)
    Exec module [/etc/cfengine/modules/module:defvarstest $(cache)]
    cfpopen(/etc/cfengine/modules/module:defvarstest $(cache))
    AddMacroValue(kernel_dir=/var/lib/cfengine/linux/kernel/up)
    Added Macro at hash address 515: 
kernel_dir=/var/lib/cfengine/linux/kernel/up
    cfpclose(pp)
    .
    .
    .
    ---------------------------------------------------------------------
    Checking file images:
    ---------------------------------------------------------------------

    New server....
    Opening server connnection to freeze
    Trying to connect to freeze = 157.249.16.34, port h=48148
    Sending on socket...3
    Identifying as 157.249.16.216 i.e. pcedb86.oslo.dnmi.no, with signature 0
    Authentic connection verified
    Checking copy from freeze:$(kernel_dir) to /usr/src

So kernel_dir is not substituted. I understand the problem with
variables being defined in import files not being usable in the main
cfengine conf. file, is this the same problem, in which case what is
the use of being able to define variables using a plugin ?

Thanks for any ehlp,

Sincerely,

Adrian Phillips

-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]



reply via email to

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