Move kickstart options to new 02kickstart.defconf
authorMartin Schwenke <martin@meltin.net>
Tue, 24 Jun 2014 01:27:16 +0000 (11:27 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 2 Jul 2014 04:17:17 +0000 (14:17 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
config.d/00base.defconf
config.d/02kickstart.defconf [new file with mode: 0644]

index af846723ce59ef86949dc23b676a00a24cdcbc5e..a2b6b557d2c084c1363b8d17c25c41b8f312097a 100644 (file)
@@ -162,9 +162,6 @@ defconf SYSTEM_DISK_MOUNTS "@uto" \
 defconf TIMEZONE "" \
        "<tz>" "timezone for each node"
 
-defconf KS_KEYBOARD "us" \
-       "<kbd>" "keyboard layout for each node"
-
 # how much disk space to use on each node
 # note that it will only use what is actually occupied,
 # so start this larger than you think you'll need
@@ -195,9 +192,6 @@ defconf NICMODEL "e1000" \
 defconf ROOTPASSWORD "password" \
        "<string>" "initial root password for each node"
 
-defconf KS_LANGUAGE "${LANG:-en_US.UTF-8}" \
-       "<locale>" "locale for installer to use"
-
 defconf NUMCPUS 2 \
        "<n>" "number of virtual CPUs per node"
 
@@ -415,16 +409,6 @@ get_kvm_path ()
 
 }
 
-ks_get_packages ()
-{
-    echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.packages"
-}
-
-ks_get_services ()
-{
-    echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.services"
-}
-
 rhel_get_install_kernel_options ()
 {
     case "$RHEL_VERSION" in
@@ -486,14 +470,6 @@ rhel_post_config_hook ()
        KVM=$(get_kvm_path) || exit $?
     fi
 
-    if [ "$KS_RHEL_PACKAGES" = "@uto" ] ; then
-       KS_RHEL_PACKAGES=$(ks_get_packages) || exit $?
-    fi
-
-    if [ "$KS_RHEL_SERVICES" = "@uto" ] ; then
-       KS_RHEL_SERVICES=$(ks_get_services) || exit $?
-    fi
-
     if [ "$INSTALL_KERNEL_OPTIONS" = "@uto" ] ; then
        INSTALL_KERNEL_OPTIONS=$(rhel_get_install_kernel_options) || exit $?
     fi
@@ -515,10 +491,6 @@ defconf RHEL_ARCH "x86_64" \
 defconf RHEL_VERSION "6.2" \
        "<version>" "version of Red Hat Enterprise Linux to configure"
 
-defconf KS_RHEL_PACKAGES "@uto"
-
-defconf KS_RHEL_SERVICES "@uto"
-
 defconf RHEL_MULTIPATH_MAGIC "@uto"
 
 defconf ISO_DIR "/virtual/ISO" \
@@ -527,9 +499,6 @@ defconf ISO_DIR "/virtual/ISO" \
 defconf ISO "@uto" \
        "<file>" "ISO image for base image creation"
 
-defconf KICKSTART "$installdir/templates/nas-kickstart.cfg" \
-       "<file>" "choice of kickstart file"
-
 # the install server where we will get local packages from
 defconf INSTALL_SERVER "http://10.0.0.1/mediasets" \
         "<url>" "URL of install server"
@@ -539,26 +508,6 @@ defconf INSTALL_SERVER "http://10.0.0.1/mediasets" \
 defconf YUM_TEMPLATE "$_YUM_TEMPLATE" \
        "<file>" "location of template for yum repositories"
 
-# any extra packages to install. List one on each line. To force a package
-# not to be installed, list it with a leading - 
-defconf KS_EXTRA_PACKAGES '' \
-       "<list>" "extra packages for kickstart to install"
-
-defconf KS_EXTRA_CHKCONFIGS "" \
-       "<chkconfigs>" "extra chkconfig commands to run in post-install"
-
-defconf KS_STANDARD_POSTINSTALL "$installdir/templates/basic-postinstall.sh" \
-       "<file>" "standard kickstart postinstall script - change with care"
-
-defconf KS_POSTINSTALL_TEMPLATE "" \
-       "<file>" "extra script to be incorporated into kickstart post-install"
-
-defconf KS_KERNEL_OPTS "rhgb console=tty1 console=ttyS0,19200 nodmraid nompath" \
-       "<opts>" "options passed by kickstart to the kernel"
-
-defconf KS_DONE_MESSAGE "you may safely reboot your system|System halted.|Power down." \
-       "<string>" "string indicating kickstart install is complete"
-
 defconf INSTALL_KS_DEVICE_TEMPLATE "@uto"
 
 ##############################
diff --git a/config.d/02kickstart.defconf b/config.d/02kickstart.defconf
new file mode 100644 (file)
index 0000000..a09dec4
--- /dev/null
@@ -0,0 +1,57 @@
+# Hey Emacs, this is a -*- shell-script -*- !!!
+
+defconf KICKSTART "$installdir/templates/nas-kickstart.cfg" \
+       "<file>" "choice of kickstart file"
+
+defconf KS_KEYBOARD "us" \
+       "<kbd>" "keyboard layout for each node"
+
+defconf KS_LANGUAGE "${LANG:-en_US.UTF-8}" \
+       "<locale>" "locale for installer to use"
+
+defconf KS_RHEL_PACKAGES "@uto"
+
+defconf KS_RHEL_SERVICES "@uto"
+
+# any extra packages to install. List one on each line. To force a package
+# not to be installed, list it with a leading - 
+defconf KS_EXTRA_PACKAGES '' \
+       "<list>" "extra packages for kickstart to install"
+
+defconf KS_EXTRA_CHKCONFIGS "" \
+       "<chkconfigs>" "extra chkconfig commands to run in post-install"
+
+defconf KS_STANDARD_POSTINSTALL "$installdir/templates/basic-postinstall.sh" \
+       "<file>" "standard kickstart postinstall script - change with care"
+
+defconf KS_POSTINSTALL_TEMPLATE "" \
+       "<file>" "extra script to be incorporated into kickstart post-install"
+
+defconf KS_KERNEL_OPTS "rhgb console=tty1 console=ttyS0,19200 nodmraid nompath" \
+       "<opts>" "options passed by kickstart to the kernel"
+
+defconf KS_DONE_MESSAGE "you may safely reboot your system|System halted.|Power down." \
+       "<string>" "string indicating kickstart install is complete"
+
+ks_get_packages ()
+{
+    echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.packages"
+}
+
+ks_get_services ()
+{
+    echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.services"
+}
+
+ks_post_config_hook ()
+{
+    if [ "$KS_RHEL_PACKAGES" = "@uto" ] ; then
+       KS_RHEL_PACKAGES=$(ks_get_packages) || exit $?
+    fi
+
+    if [ "$KS_RHEL_SERVICES" = "@uto" ] ; then
+       KS_RHEL_SERVICES=$(ks_get_services) || exit $?
+    fi
+}
+
+register_hook post_config_hooks ks_post_config_hook