summaryrefslogtreecommitdiffstats
path: root/config.d
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-07-02 11:08:45 +1000
committerMartin Schwenke <martin@meltin.net>2014-07-02 20:26:52 +1000
commit55d315b1118283c60edaf365ef9b123eaea27bed (patch)
treeea94c380ae841f32dea2505f05d296f89f5c8e31 /config.d
parentfa26aa2e805ff739f3969892e7e302daa1eaef60 (diff)
downloadautocluster-55d315b1118283c60edaf365ef9b123eaea27bed.tar.gz
autocluster-55d315b1118283c60edaf365ef9b123eaea27bed.tar.xz
autocluster-55d315b1118283c60edaf365ef9b123eaea27bed.zip
Remove NUMNODES and WITH_TSM_NODE configuration variables
The backward compatibility hacking is horrible! Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r--config.d/00base.defconf18
-rw-r--r--config.d/60tsm.defconf54
2 files changed, 28 insertions, 44 deletions
diff --git a/config.d/00base.defconf b/config.d/00base.defconf
index d750e33..c39026f 100644
--- a/config.d/00base.defconf
+++ b/config.d/00base.defconf
@@ -13,9 +13,6 @@ defconf CLUSTERFS_DEFAULT_MOUNTPOINT "/clusterfs" \
defconf NODES "nas:0-3 rhel_base:4" \
"<nodes>" "list of node types to create, with associated IP offsets"
-defconf NUMNODES "" \
- "<n>" "number of nodes to build, not including TSM server"
-
# a directory on the host which will be mounted via NFS onto the nodes
# as $NFS_MOUNTPOINT, giving a nice common area independent of the
# cluster filesystem. This is useful for compiles, RPMs, devel
@@ -239,7 +236,20 @@ defconf NETWORKS "10.0.0.0/24,eth0,gw=10.0.0.1 10.0.1.0/24,eth1 10.0.2.0/24,eth2
make_public_addresses()
{
local firstip="${1:-$[${FIRSTIP} + ${PUBLIC_IP_OFFSET}]}"
- local num_addrs="${2:-${NUMNODES}}"
+ local num_addrs="$2"
+
+ # By default the number of addresses on each public network is
+ # the same as the number of nodes
+ if [ -z "$num_addrs" ] ; then
+ num_addrs=0
+ _count_ctdb_nodes ()
+ {
+ if [ "$4" = "1" ] ; then
+ num_addrs=$(($num_addrs + 1))
+ fi
+ }
+ for_each_node _count_ctdb_nodes
+ fi
if [ $(( $firstip + $num_addrs - 1 )) -gt 254 ]; then
die "make_public_addresses: last octet > 254 - change PUBLIC_IP_OFFSET"
diff --git a/config.d/60tsm.defconf b/config.d/60tsm.defconf
index 1e22f1d..e0ed1c6 100644
--- a/config.d/60tsm.defconf
+++ b/config.d/60tsm.defconf
@@ -1,8 +1,5 @@
# Hey Emacs, this is a -*- shell-script -*- !!!
-defconf WITH_TSM_NODE "" \
- "<0|1>" "1 if a TSM node should be created"
-
defconf TSMDISKSIZE "50G" \
"<n>G" "size of the TSM storage disk"
@@ -32,43 +29,20 @@ register_hook hack_nodes_functions hack_nodes_tsm_server
hack_nodes_tsm_server ()
{
-
- # Compatibility code to handle WITH_TSM_NODE.
- if [ "$WITH_TSM_NODE" = 0 -a "${NODES/tsm_server:/}" != "$NODES" ] ; then
- # No tsm_server nodes desired but some configured - remove,
- # see create_node_null.
- NODES="${NODES//tsm_server:/null:}"
- elif [ "$WITH_TSM_NODE" = 1 -a "${NODES/tsm_server:/}" = "$NODES" ] ; then
- # tsm_server desired but none configured. Try to create one
- # at IP offset 0.
- local n
- for n in $NODES ; do
- case "$n" in
- *:0)
- die "Can't use WITH_TSM_NODE to add tsm_server node at IP offset 0 because this offset is already in use. You need to set NODES instead - please read the documentation."
- esac
- done
- NODES="${NODES}${NODES:+ }tsm_server:0"
- fi
-
- if [ "${NODES/tsm_server:/}" != "$NODES" ] ; then
-
- local node_count_tsm_server=0
- # If only 1 tsm_server node then don't number it.
- [ "${NODES/tsm_server:/}" = "${NODES//tsm_server:/}" ] && \
- node_count_tsm_server=""
- hack_filter ()
- {
- case "$node_type" in
- tsm_server)
- [ -n "$node_count_tsm_server" ] && \
- node_count_tsm_server=$(($node_count_tsm_server + 1))
- name="${CLUSTER}tsm${node_count_tsm_server}"
- ctdb_node=0
- esac
- }
- hack_all_nodes_with hack_filter
- fi
+ local node_count_tsm_server=0
+ # If only 1 tsm_server node then don't number it.
+ [ "${NODES/tsm_server:/}" = "${NODES//tsm_server:/}" ] && \
+ node_count_tsm_server=""
+ hack_filter ()
+ {
+ if [ "$node_type" = "tsm_server" ] ; then
+ [ -n "$node_count_tsm_server" ] && \
+ node_count_tsm_server=$(($node_count_tsm_server + 1))
+ name="${CLUSTER}tsm${node_count_tsm_server}"
+ ctdb_node=0
+ fi
+ }
+ hack_all_nodes_with hack_filter
}
create_node_tsm_server ()