* Single entry point is now setup_cluster.sh.
* Rename old setup_cluster.sh to setup_cluster_nas.sh.
* Split setup_ad_server.sh into install_ad_server.sh and
setup_cluster_ad_server.sh.
* Split setup_build.sh into install_build.sh and
setup_cluster_build.sh.
* Rename setup_gpfs.sh to setup_clusterfs_gpfs.sh.
Signed-off-by: Martin Schwenke <martin@meltin.net>
case "$CLUSTER_TYPE" in
"build")
- # Build node doesn't really need CTDB/Samba to be
- # installed, if the packages are not present in the repo,
- # they're skipped.
- $ssh "$n1" "./scripts/setup_build.sh || true"
+ $ssh "$n1" ./scripts/install_packages.sh clusterfs build
+ $ssh "$n1" ./scripts/setup_cluster.sh build
;;
"ad")
- $ssh "$n1" ./scripts/setup_ad_server.sh
+ $ssh "$n1" ./scripts/install_packages.sh ad_server
+ $ssh "$n1" ./scripts/configure_cluster.sh ad_server
;;
"samba")
for i in $nodes ; do
$ssh "$i" ./scripts/install_packages.sh clusterfs nas
done
- $ssh "$n1" ./scripts/setup_gpfs.sh
- if [ "$AUTH_METHOD" = "winbind" ]; then
- args="-UAdministrator%${AD_ADMIN_PASS}"
- else
- args=""
- fi
- $ssh "$n1" ./scripts/setup_cluster.sh "$args"
+ $ssh "$n1" ./scripts/setup_cluster.sh clusterfs nas
;;
esac
}
--- /dev/null
+#!/bin/sh
+
+set -e
+
+echo "Installing Samba4 packages"
+yum -y install samba4-dc samba4-python
#!/bin/sh
-#
-# Setup build node
-#
-
-$(dirname $0)/install_gpfs.sh
-
# Setup RPM development
echo "Installing RPM developing and setting up rpm build"
yum -y install rpmdevtools
-rpmdev-setuptree
# Install the performance co-pilot packages to allow building of the
# CTDB pmda code. It is OK if this fails (these packages are only
echo "Installing Samba build dependencies"
yum -y install readline-devel libacl-devel e2fsprogs-devel \
libxslt docbook-utils docbook-style-xsl
+
+exit 0
-#!/bin/bash
-
-# Configure a simple NAS cluster as generated by autocluster..
-
-set -e
-
-domain_auth="administrator"
-auth_type="files"
-
-conf_file="/root/scripts/nas.conf"
-
-wait_until_healthy ()
-{
- local timeout="${1:-120}"
-
- echo -n "Wait until healthy [<${timeout}] "
-
- local count=0
- while [ $count -lt $timeout ] ; do
- if ctdb nodestatus all >/dev/null ; then
- echo "[${count}]"
- return 0
- fi
- echo -n "."
- count=$(($count + 1))
- sleep 1
- done
-
- echo "[TIMEOUT]"
- return 1
-}
-
-####################
-# show program usage
-usage ()
-{
- cat >&2 <<EOF
-Usage: setup_samba.sh [OPTION]
- options:
- -x enable script debugging
- -c config_file config file to load
- -U username%password domain authentication
-EOF
- exit 1
-}
-
-
-############################
-# parse command line options
-temp=$(getopt -n "$prog" -o "axhU:c:" -l help -- "$@")
-[ $? != 0 ] && usage
-eval set -- "$temp"
-while true ; do
- case "$1" in
- -x) set -x; shift ;;
- -c) conf_file="$2" ; shift 2 ;;
- -U) domain_auth="$2" ; shift 2 ;;
- --) shift ; break ;;
- -h|--help|*) usage ;;
+#!/bin/sh
+
+dn=$(dirname $0)
+
+for task ; do
+ case "$task" in
+ clusterfs)
+ type="@@CLUSTERFS_TYPE@@"
+ file="setup_clusterfs_${type}.sh"
+ ;;
+ *)
+ file="setup_cluster_${task}.sh"
esac
-done
-
-auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind)[[:space:]]*$@\1@p' "$conf_file")
-
-case "$auth_type" in
- winbind|files) : ;;
- *)
- echo "Unsupported authentication type \"${auth_type}\""
- usage
-esac
-
-domain=$(sed -r -n -e 's@^domain[[:space:]]*=[[:space:]]*([^ ]*)[[:space:]]*$@\1@p' "$conf_file" | tr '[a-z]' '[A-Z]')
-
-kdc=$(sed -r -n -e 's@^kdc[[:space:]]*=[[:space:]]*([^ ]*)[[:space:]]*$@\1@p' "$conf_file")
-
-mmgetstate | grep active > /dev/null || {
- echo "GPFS must be running to setup Samba"
- exit 1
-}
-echo "Enabling ctdb..."
-onnode -p all chkconfig ctdb on
+ path="${dn}/${file}"
-case "$auth_type" in
- winbind)
- echo "Setting up NSS, PAM, KRB5..."
- onnode -p all authconfig --update --nostart \
- --enablewinbindauth --enablewinbind \
- --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain
- ;;
- files)
- echo "Setting up NSS, PAM, KRB5..."
- onnode -p all authconfig --update --nostart \
- --disablewinbindauth --disablewinbind \
- --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain
- ;;
-esac
+ if [ ! -x "$path" ] ; then
+ echo "Unable to find script \"${file}\" to setup task \"${task}\""
+ exit 1
+ fi
-echo "Configuring services..."
-onnode -p all "(cd scripts/cluster_configure && \
- ./cluster-configure.py -t 'templates/rhel/' -vv '$conf_file')"
-
-case "$auth_type" in
- winbind)
- echo "Joining domain"
- net ads join -U"$domain_auth"
- ;;
-esac
-
-echo "Restarting ctdb"
-onnode -p all "service ctdb restart"
-
-# let's hit this with a big hammer...
-for i in $(seq 1 5) ; do
- wait_until_healthy 60 && break
- echo "Nope, restart ctdb..."
- onnode -p all "service ctdb restart"
+ "$path" || exit $?
done
-
-wait_until_healthy
-
-echo "Setup done"
-#!/bin/bash
+#!/bin/sh
-# catch errors
set -e
-set -E
-trap 'es=$?;
- echo ERROR: failed in function \"${FUNCNAME}\" at line ${LINENO} of ${BASH_SOURCE[0]} with code $es;
- exit $es' ERR
-# 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
-
-# Install samba4 packages
-echo "Installing Samba4 packages"
-yum -y install samba4-dc samba4-python
+# Assume that an AD server cluster is always a single node :-)
# Remove samba3 configuration file
rm -f /etc/samba/smb.conf
--- /dev/null
+#!/bin/sh
+
+# Assume that a build cluster is always a single node :-)
+
+echo "Running rpmdev-setuptree"
+rpmdev-setuptree
+
+echo "Removing .rpmmacros"
+rm -vf /root/.rpmmacros
--- /dev/null
+#!/bin/bash
+
+# Configure a simple NAS cluster as generated by autocluster..
+
+set -e
+
+ad_admin_pass="@@AD_ADMIN_PASS@@"
+domain_auth="administrator${ad_admin_pass:+%}${ad_admin_pass}"
+
+conf_file="/root/scripts/nas.conf"
+
+wait_until_healthy ()
+{
+ local timeout="${1:-120}"
+
+ echo -n "Wait until healthy [<${timeout}] "
+
+ local count=0
+ while [ $count -lt $timeout ] ; do
+ if ctdb nodestatus all >/dev/null ; then
+ echo "[${count}]"
+ return 0
+ fi
+ echo -n "."
+ count=$(($count + 1))
+ sleep 1
+ done
+
+ echo "[TIMEOUT]"
+ return 1
+}
+
+####################
+# show program usage
+usage ()
+{
+ cat >&2 <<EOF
+Usage: setup_samba.sh [OPTION]
+ options:
+ -x enable script debugging
+ -c config_file config file to load
+ -U username%password domain authentication
+EOF
+ exit 1
+}
+
+
+############################
+# parse command line options
+temp=$(getopt -n "$prog" -o "axhU:c:" -l help -- "$@")
+[ $? != 0 ] && usage
+eval set -- "$temp"
+while true ; do
+ case "$1" in
+ -x) set -x; shift ;;
+ -c) conf_file="$2" ; shift 2 ;;
+ --) shift ; break ;;
+ -h|--help|*) usage ;;
+ esac
+done
+
+auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind)[[:space:]]*$@\1@p' "$conf_file")
+
+case "$auth_type" in
+ winbind|files) : ;;
+ *)
+ echo "Unsupported authentication type \"${auth_type}\""
+ usage
+esac
+
+domain=$(sed -r -n -e 's@^domain[[:space:]]*=[[:space:]]*([^ ]*)[[:space:]]*$@\1@p' "$conf_file" | tr '[a-z]' '[A-Z]')
+
+kdc=$(sed -r -n -e 's@^kdc[[:space:]]*=[[:space:]]*([^ ]*)[[:space:]]*$@\1@p' "$conf_file")
+
+echo "Enabling ctdb..."
+onnode -p all chkconfig ctdb on
+
+case "$auth_type" in
+ winbind)
+ echo "Setting up NSS, PAM, KRB5..."
+ onnode -p all authconfig --update --nostart \
+ --enablewinbindauth --enablewinbind \
+ --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain
+ ;;
+ files)
+ echo "Setting up NSS, PAM, KRB5..."
+ onnode -p all authconfig --update --nostart \
+ --disablewinbindauth --disablewinbind \
+ --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain
+ ;;
+esac
+
+echo "Configuring services..."
+onnode -p all "(cd scripts/cluster_configure && \
+ ./cluster-configure.py -t 'templates/rhel/' -vv '$conf_file')"
+
+case "$auth_type" in
+ winbind)
+ echo "Joining domain"
+ net ads join -U"$domain_auth"
+ ;;
+esac
+
+echo "Restarting ctdb"
+onnode -p all "service ctdb restart"
+
+# let's hit this with a big hammer...
+for i in $(seq 1 5) ; do
+ wait_until_healthy 60 && break
+ echo "Nope, restart ctdb..."
+ onnode -p all "service ctdb restart"
+done
+
+wait_until_healthy
+
+echo "Setup done"