class dependencies

Raphaël Pinson raphink at gmail.com
Tue Sep 9 23:04:19 CEST 2008


Hi Ingo,

Nice work.

I had sent a patch to FAI some months ago which allowed inherited classes,
but it never got taken into FAI, don't remember why [0].


Raphael

[0] https://lists.uni-koeln.de/pipermail/linux-fai-devel/2008q1/000516.html


On Tue, Sep 9, 2008 at 10:31 PM, Ingo Wichmann <iw at linuxhotel.de> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20080909/14c1bb12/attachment.htm 


More information about the linux-fai-devel mailing list