|
From: | Guolin Cheng |
Subject: | How to use cfengine modules? |
Date: | Tue, 14 Sep 2004 11:33:24 -0700 |
Hi,
I try to test cfengine module functions, and find there are two places I don’t understand.
1, The classes defined in modules has to be “declared” with “AddInstallable” statement(s) in control section. This seems not convenient. For my case, my module script defined a dynamic number of classes, depending on the machines’ status. So, is it possible to “dynamically” define classes without declaration with “AddInstallable” statements?
[root@Server inputs]# cat ../modules/linuxProbeServicesStatus
#! /bin/bash
############################################################
##
## cfengine helper modules
## probe which services ( /etc/init.d/*) are on.
##
############################################################
for i in `/sbin/chkconfig --list | /bin/grep "3:on" | /bin/awk '{ print $1 }'`
do
/bin/echo "+${i}ServiceTurnedOn"
done
2, The module name seems can not include a normal “.sh” suffix, and will not report error if the module file is not executable. I have tried several times to debug it out with “-v –d2” options to cfagent. Before that my script is named “linuxProbeServicesStatus.sh” and my CVS system kicked off the executable bit of the module script file by mistake.
Classes defined in module files take effect only on sections behind module:* in actionsequence statement in same configuration file. They will not affect other imported siblings files (not child files or parent files). I haven’t testes imported child files yet.
I’ll send another email about my implementation of cfengine, share my “experience” and ask for further help.
Thanks.
--Guolin Cheng
[Prev in Thread] | Current Thread | [Next in Thread] |