3 # Configure a simple NAS cluster as generated by autocluster..
7 conf_file="/root/scripts/nas.conf"
9 ad_admin_pass="@@AD_ADMIN_PASS@@"
10 domain_auth="administrator${ad_admin_pass:+%}${ad_admin_pass}"
14 local timeout="${1:-120}"
16 echo -n "Wait until healthy [<${timeout}] "
19 while [ $count -lt $timeout ] ; do
20 if ctdb nodestatus all >/dev/null ; then
33 auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind)[[:space:]]*$@\1@p' "$conf_file")
38 net ads join -U"$domain_auth"
42 echo "Restarting ctdb (up to 5 times)"
43 # Just in case the cluster doesn't become healthy the first time,
44 # repeat a few times...
45 for i in $(seq 1 5) ; do
46 onnode -p all "service ctdb restart"
47 if wait_until_healthy ; then
48 echo "NAS cluster setup complete"