class dependencies

Ingo Wichmann iw at linuxhotel.de
Tue Sep 9 22:31:57 CEST 2008


Hi fai,

I just wrote a script that implements dependencies between fai classes and 
ask for including it in fai.

how does it work?
put this script in $FAI/class and make it executable. Now,
e.g. you have a class WORDPRESS that depends on the classes VHOST and 
POSTGRES . VHOST again may depend on WEBSERVER.
So if you want to install the blogging software wordpress, you add a file

$FAI/class/WORDPRESS.deps

that contains the words
VHOST
POSTGRES

and a file
$FAI/class/VHOST.deps

that contains the word
WEBSERVER

The order often is important, so this script is taking care of it. The order 
of the example above would be:
WEBSERVER VHOST POSTGRES WORDPRESS
That way, in $FAI/scripts/ first the webserver would be configured, then the 
vhosts, ...

It removes double entries from FAI_CLASSES and handles circular dependencies[1].



Calling this file from withing defclass is not perfect: dependencies for 
$HOSTNAME and LAST are not possible. A solution could be, to call this 
script right after fai-class is called in task defclass.

Somebody willing to include this? To do so 3 changes are necessary:
1. add a line
   fai-deps
right after
   fai-class -T $FAI/class $LOGDIR/FAI_CLASSES
in
/usr/lib/fai/subroutines ( task_defclass() )
2. add this script as
/usr/bin/fai-class
3. new dependency to libgraph-perl for fai-class

It should not break existing configurations, because it only acts if 
non-executable files $FAI/class/*.deps exist.

Ingo


[1] I do not recommend using circular dependencies, but if you accidentally 
define them, they will not break your neck. But you'll get a warning ...

-- 
Linuxhotel GmbH, Geschäftsführer Dipl.-Ing. Ingo Wichmann
HRB 20463 Amtsgericht Essen, UStID DE 814 943 641
Antonienallee 1, 45279 Essen, Tel.: 0201 8536-600, http://www.linuxhotel.de
-------------- nächster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : 90-class-dependencies.gz
Dateityp    : application/x-gzip
Dateigr??e  : 2820 bytes
Beschreibung: nicht verf?gbar
URL         : http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20080909/7c76f312/attachment.bin 


More information about the linux-fai-devel mailing list