Rework package installation during post-boot configuration
authorMartin Schwenke <martin@meltin.net>
Tue, 24 Jun 2014 03:46:54 +0000 (13:46 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 2 Jul 2014 04:17:17 +0000 (14:17 +1000)
* New script install_packages.sh is the single entry-point for
  installing packages outside kickstart.

* New configuration variable CONFIG_EXTRA_PACKAGES has space-separated
  list of extra packages to install.  This can help if dependencies
  are broken.

* Rename install_gpfs_nas.sh to just install_nas.sh, now just installs
  packages (e.g. samba, ctdb, rssh) to support protocols.

* Rename install_gpfs.sh to install_clusterfs_gpfs.sh to provide a
  hook to support installation of alternate cluster filesystem
  packages.

Signed-off-by: Martin Schwenke <martin@meltin.net>
autocluster
base/all/root/scripts/install_clusterfs_gpfs.sh [moved from base/all/root/scripts/install_gpfs.sh with 82% similarity]
base/all/root/scripts/install_gpfs_nas.sh [deleted file]
base/all/root/scripts/install_nas.sh [new file with mode: 0755]
base/all/root/scripts/install_packages.sh [new file with mode: 0755]
config.d/00base.defconf

index a4f6d709df1386b70daa101e59e8fcf8f3f595a9..efeca1232d0328150ddc2054dadc71b8bfb52201 100755 (executable)
@@ -598,7 +598,7 @@ cluster_configure ()
                sed -n -e 's/Name: *//p')
 
            for i in $nodes ; do
-               $ssh "$i" ./scripts/install_gpfs_nas.sh
+               $ssh "$i" ./scripts/install_packages.sh clusterfs nas
            done
            $ssh "$n1" ./scripts/setup_gpfs.sh
 
similarity index 82%
rename from base/all/root/scripts/install_gpfs.sh
rename to base/all/root/scripts/install_clusterfs_gpfs.sh
index 39b08279997353f56fcbdf81aa9499f423e09de2..86eadcbb61ef82d59e2a65e134a74c32cfc0e0fc 100755 (executable)
@@ -1,11 +1,10 @@
 #!/bin/sh
 
-# we have to force the base GPFS package first, due to the way gpfs updates work
+# Must force the base GPFS package first, due to the way GPFS updates
+# work.
 echo "Installing GPFS base"
 yum -y install gpfs.base-@@GPFS_BASE_VERSION@@.@@RHEL_ARCH@@
 
-# then update it
-
 echo "Updating GPFS base"
 yum -y update
 
diff --git a/base/all/root/scripts/install_gpfs_nas.sh b/base/all/root/scripts/install_gpfs_nas.sh
deleted file mode 100755 (executable)
index e971008..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Make this explicit so we only get RHEL updates to make things nice
-# and clear.  This duplicates what happens in basic-postinstall.sh but
-# we may have just rewound the cluster, so we might be running this on
-# the node install of from kickstart.
-echo "Updating from YUM repositories"
-yum -y update
-
-$(dirname $0)/install_gpfs.sh
-
-echo "Installing tdb tools packages"
-yum -y install tdb-tools
-
-echo "Installing ctdb packages"
-yum -y install ctdb ctdb-debuginfo ctdb-devel ctdb-tests
-
-echo "Installing samba packages"
-yum -y install samba samba-debuginfo samba-client samba-doc
-
-echo "Installing rssh"
-yum -y install rssh
diff --git a/base/all/root/scripts/install_nas.sh b/base/all/root/scripts/install_nas.sh
new file mode 100755 (executable)
index 0000000..32425ec
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+echo "Installing tdb tools packages"
+yum -y install tdb-tools
+
+echo "Installing ctdb packages"
+yum -y install ctdb ctdb-debuginfo ctdb-devel ctdb-tests
+
+echo "Installing samba packages"
+yum -y install samba samba-debuginfo samba-client samba-doc
+
+echo "Installing rssh"
+yum -y install rssh
diff --git a/base/all/root/scripts/install_packages.sh b/base/all/root/scripts/install_packages.sh
new file mode 100755 (executable)
index 0000000..9b023c0
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+echo "Updating from YUM repositories"
+yum -y update
+
+extra_packages="@@CONFIG_EXTRA_PACKAGES@@"
+if [ -n "$extra_packages" ] ; then
+    yum -y install $extra_packages
+fi
+
+dn=$(dirname $0)
+
+for task ; do
+    case "$task" in
+       clusterfs)
+           type="@@CLUSTERFS_TYPE@@"
+           file="install_clusterfs_${type}.sh"
+           ;;
+       *)
+           file="install_${task}.sh"
+    esac
+
+    path="${dn}/${file}"
+
+    if [ ! -x "$path" ] ; then
+       echo "Unable to find script \"${file}\" to install task \"${task}\""
+       exit 1
+    fi
+
+    "$path"
+done
index e4519a8d8d7ca056675067d2200b3934d3ef38e4..3fe969bf63d8c8f11530482ca3e2feb68eb67678 100644 (file)
@@ -509,6 +509,9 @@ defconf ISO "@uto" \
 defconf INSTALL_SERVER "http://10.0.0.1/mediasets" \
         "<url>" "URL of install server"
 
+defconf CONFIG_EXTRA_PACKAGES "" \
+       "<packages>" "list of extra packages to install at configuration time"
+
 # the yum repositories to use. Choose the one appropriate for the
 # system you are installing
 defconf YUM_TEMPLATE "$_YUM_TEMPLATE" \