[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. debian/0.10-4-ga1f5b8c

Andreas B. Mundt andi at debian.org
Mon May 13 18:17:06 UTC 2013


The following commit has been merged in the master branch:
commit a1f5b8c9a9ea4104214a4fa7d841bfb3fb2c4c67
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sun May 12 16:12:36 2013 +0200

    Enable dialog to choose setup variant.  Fixes.
    
    During installation or conversion the admin can choose between two
    variants:  Mainserver including the gateway (2 NICs) or dedicated
    gateway on a separate machine.  A single CD image is sufficient.
    Thanks to Andreas Schockenhoff for the idea.
    
    Fix setting up git as vcs for the config space.  Allow users to see
    the config space, as no secrets need to be hidden.
    
    Make sure home directory paths created by 'add2gosa' are accessible.

diff --git a/fai/config/class/SERVER_A.var b/fai/config/class/SERVER_A.var
index 43e82f1..8ea8229 100644
--- a/fai/config/class/SERVER_A.var
+++ b/fai/config/class/SERVER_A.var
@@ -32,15 +32,31 @@ KDC_MASTER_PW=
 ## created and saved in $DATADIR.
 LDAP_ADMIN_PW=
 
-## Variables that define the network.  If you choose the same IP
-## address for mainserver ($MAINSERVER_IPADDR) and gateway ($GATEWAY),
-## the mainserver is configured as gateway to the external network.
-## You'll need two network cards in that case.
+## Variables that define the network.  You can choose the same IP
+## address for mainserver ($MAINSERVER_IPADDR) and gateway ($GATEWAY)
+## interactively during installation, see below.
 MAINSERVER_IPADDR="10.0.0.10"
 GATEWAY="10.0.0.1"
 BROADCAST="10.0.255.255"
 NAMESERVER_IPADDR=""  # leave empty to use mainserver's IP address
 
+if [ "$GATEWAY" != "$MAINSERVER_IPADDR" ] && \
+   [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
+    ## Dialog to choose setup:
+    inp=$(dialog --insecure --stdout --backtitle " Network Setup " --radiolist \
+        "There are two variants available:\n\n\
+   SEPARATE: The mainserver and the network's gateway\n\
+             are separate machines.\n\n\
+   COMBINED: The mainserver is configured as gateway\n\
+             to the external network (2 NICs needed)." 15 63 2 \
+        SEPARATE " mainserver: ${MAINSERVER_IPADDR}, gateway: ${GATEWAY} " on \
+        COMBINED " mainserver == gateway: ${GATEWAY}, 2 NICs " off )
+    if [ "$inp" = "COMBINED" ] ; then
+        MAINSERVER_IPADDR=$GATEWAY
+    fi
+    unset inp
+fi
+
 SUBNET="10.0.0.0"
 NETMASK="255.255.0.0"
 SUBNETMASK="10.0.0.0/16"
diff --git a/fai/config/files/usr/local/sbin/add2gosa/GOSA b/fai/config/files/usr/local/sbin/add2gosa/GOSA
index 491d9e3..0bc922c 100755
--- a/fai/config/files/usr/local/sbin/add2gosa/GOSA
+++ b/fai/config/files/usr/local/sbin/add2gosa/GOSA
@@ -5,6 +5,8 @@
 
 set -e
 
+umask 0022
+
 sync_nscd(){
     if pidof nscd 1>&2 > /dev/null ; then
         ## Clear tables to have database up to date:
diff --git a/fai/config/scripts/FAISERVER/20-configspace b/fai/config/scripts/FAISERVER/20-configspace
index 2d1c124..14557cd 100755
--- a/fai/config/scripts/FAISERVER/20-configspace
+++ b/fai/config/scripts/FAISERVER/20-configspace
@@ -14,8 +14,12 @@ if [ "$FAI_ACTION" == "install" ] ; then
     cp -a /var/lib/fai/config/* $target/$CONFDIR
     echo "New config space copied to faiserver."
 fi
-chmod 770 $target/$CONFDIR
-chown root:adm $target/$CONFDIR
+
+if [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
+    ## Replace the IP addresses with the chosen ones (cf. class/SERVER_A.var):
+    sed -i -e "s/^MAINSERVER_IPADDR=.*/MAINSERVER_IPADDR=\"$MAINSERVER_IPADDR\"/" \
+        -e "s/^GATEWAY=.*/GATEWAY=\"$GATEWAY\"/" $target/$CONFDIR/class/SERVER_A.var
+fi
 
 if [ ! -d $target/$CONFDIR/.git ] ; then
     ## Use git to track modifications of the config space:
@@ -24,6 +28,6 @@ if [ ! -d $target/$CONFDIR/.git ] ; then
     $ROOTCMD git config --global user.email root@$HOSTNAME
     $ROOTCMD git config --global color.ui auto
     $ROOTCMD git init $CONFDIR
-    $ROOTCMD git --git-dir=$CONFDIR/.git --work-tree=$CONFDIR add .
+    $ROOTCMD git --git-dir=$CONFDIR/.git --work-tree=$CONFDIR add $CONFDIR
     $ROOTCMD git --git-dir=$CONFDIR/.git commit -m "Initial commit"
 fi

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list