On 08-06-10 10:59, Vasiliy G Tolstov wrote:
> В Втр, 08/06/2010 в 10:39 +0200, Bas van der Vlies пишет:
>> On 08-06-10 09:38, Vasiliy G Tolstov wrote:
>>> Hello. I need to query current running system for installed services and
>>> modules and want to define classes like have_mysql or have_python, if
>>> the specific service or package installed.
>>>
>>> What is the best way to run only once this module in the bundle before
>>> other actions are performed (like methods)?
>>>
>>
>> Must these classes be GLOBAL defined? If yes then you must define them in a
>> common bundle. In a common bundle you can only use:
>> vars
>> classes
>> reports
>>
>> I am using usemodule() function to define global classes.
>>
>> regards
>>
>>
>
> Ok. But why in environment variables a can't see classes provided by
> cf-agent?
>
> my module:
>
> #!/bin/sh
> printenv
> exit 0;
I think i miss understood the question. I thought you want to define
classes via your own script/module. I am using this in my common bundle:
{{{
classes:
"GOT_INIT" expression => usemodule("init_sara","");
and in this module i have the following simple test:
#!/bin/sh
if [ -f /etc/lisa ]
then
echo +LISA
fi
--
********************************************************************
* Bas van der Vlies e-mail: [email protected] *
* SARA - Academic Computing Services Amsterdam, The Netherlands *
********************************************************************
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine