[debian-lan-devel] More customization maybe for fai-cd?

Robert Rettig robert at rettig.bayern
Wed Mar 9 22:33:09 UTC 2016


@
http://anonscm.debian.org/cgit/collab-maint/debian-lan.git/tree/debian/READM
E.Debian#n75
I found a nice way to change the servername of "mainserver"

> cd /srv/fai/config/
>   for FILE in $(grep -rl mainserver *) ; \
>       do sed -i "s/mainserver/$HOSTNAME/g" $FILE ; done
>
>   mv files/etc/hosts/mainserver files/etc/hosts/$HOSTNAME

That is somewhat working. For some reason an unexpected manual intervention
was needed to enter the servername. On a second run I changed hostname in
boot params and it worked.
But how should I customize another important part? The 10.0.0.0/8 network is
more likely in use by other infrastructure and I need to change the subnet.
I tried to change the subnet in a similar way.

--NOT WORKING in creating fai-cd context--
> for FILE in $(grep -rl 10\.0 *) ; \
>    do sed -i "s/10\.0/$NETWORK/g" $FILE ; done

But it might be some more complicated because the scripts copy sample code
from installed system

> CONFDIR="${target}/etc/shorewall/"
> 
> prepare_shorewall(){
>     ## Use shorewall's "two-interfaces" example as base setup:
>     for FILE in interfaces masq policy stoppedrules rules zones ; do
>         cp -v
${target}/usr/share/doc/shorewall/examples/two-interfaces/$FILE $CONFDIR
>     done

Therefore it must be accomplished as script after installation. Is that
right?
Where would I add such script? Maybe there is already some hint in other
sample scripts. I will inspect them a little bit more.



More information about the debian-lan-devel mailing list