<div dir="ltr">Hi Ingo,<br><br>Nice work.<br><br>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]. <br><br><br>Raphael<br><br>[0] <a href="https://lists.uni-koeln.de/pipermail/linux-fai-devel/2008q1/000516.html">https://lists.uni-koeln.de/pipermail/linux-fai-devel/2008q1/000516.html</a><br>
<br><br><div class="gmail_quote">On Tue, Sep 9, 2008 at 10:31 PM, Ingo Wichmann <span dir="ltr"><<a href="mailto:iw@linuxhotel.de">iw@linuxhotel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi fai,<br>
<br>
I just wrote a script that implements dependencies between fai classes and ask for including it in fai.<br>
<br>
how does it work?<br>
put this script in $FAI/class and make it executable. Now,<br>
e.g. you have a class WORDPRESS that depends on the classes VHOST and POSTGRES . VHOST again may depend on WEBSERVER.<br>
So if you want to install the blogging software wordpress, you add a file<br>
<br>
$FAI/class/WORDPRESS.deps<br>
<br>
that contains the words<br>
VHOST<br>
POSTGRES<br>
<br>
and a file<br>
$FAI/class/VHOST.deps<br>
<br>
that contains the word<br>
WEBSERVER<br>
<br>
The order often is important, so this script is taking care of it. The order of the example above would be:<br>
WEBSERVER VHOST POSTGRES WORDPRESS<br>
That way, in $FAI/scripts/ first the webserver would be configured, then the vhosts, ...<br>
<br>
It removes double entries from FAI_CLASSES and handles circular dependencies[1].<br>
<br>
<br>
<br>
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.<br>
<br>
Somebody willing to include this? To do so 3 changes are necessary:<br>
1. add a line<br>
fai-deps<br>
right after<br>
fai-class -T $FAI/class $LOGDIR/FAI_CLASSES<br>
in<br>
/usr/lib/fai/subroutines ( task_defclass() )<br>
2. add this script as<br>
/usr/bin/fai-class<br>
3. new dependency to libgraph-perl for fai-class<br>
<br>
It should not break existing configurations, because it only acts if non-executable files $FAI/class/*.deps exist.<br>
<br>
Ingo<br>
<br>
<br>
[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 ...<br><font color="#888888">
<br>
-- <br>
Linuxhotel GmbH, Geschäftsführer Dipl.-Ing. Ingo Wichmann<br>
HRB 20463 Amtsgericht Essen, UStID DE 814 943 641<br>
Antonienallee 1, 45279 Essen, Tel.: 0201 8536-600, <a href="http://www.linuxhotel.de" target="_blank">http://www.linuxhotel.de</a><br>
</font></blockquote></div><br></div>