summaryrefslogtreecommitdiffstats
path: root/config.d
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-07-28 20:06:16 +1000
committerMartin Schwenke <martin@meltin.net>2014-07-28 20:06:16 +1000
commitaa02a12144fe70147a22601be9452f43989a62b6 (patch)
tree97fec48caed8d13750cc7906884a7707572484fc /config.d
parent2a42a372ca8c436ecedee03aadb6a0cee44a2d1a (diff)
downloadautocluster-aa02a12144fe70147a22601be9452f43989a62b6.tar.gz
autocluster-aa02a12144fe70147a22601be9452f43989a62b6.tar.xz
autocluster-aa02a12144fe70147a22601be9452f43989a62b6.zip
node_name_format_* functions should produce the node name
No use having them print the format string. That actually makes it more restrictive. Instead, have the functions take cluster name and index as arguments - these can then be passed to printf in either order depending on the format string. Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r--config.d/50node_nas.defconf5
-rw-r--r--config.d/51node_rhel_base.defconf5
-rw-r--r--config.d/52node_build.defconf5
-rw-r--r--config.d/55node_storage_gpfs.defconf5
-rw-r--r--config.d/57node_ad.defconf5
-rw-r--r--config.d/60tsm.defconf7
6 files changed, 25 insertions, 7 deletions
diff --git a/config.d/50node_nas.defconf b/config.d/50node_nas.defconf
index 65c14fd..2b19b56 100644
--- a/config.d/50node_nas.defconf
+++ b/config.d/50node_nas.defconf
@@ -2,7 +2,10 @@
node_name_format_nas ()
{
- echo '%snas%d'
+ local cluster="$1"
+ local index="$2"
+
+ printf '%snas%d' "$cluster" "$index"
}
node_is_ctdb_node_nas ()
diff --git a/config.d/51node_rhel_base.defconf b/config.d/51node_rhel_base.defconf
index ddb90b5..65e98d3 100644
--- a/config.d/51node_rhel_base.defconf
+++ b/config.d/51node_rhel_base.defconf
@@ -2,5 +2,8 @@
node_name_format_rhel_base ()
{
- echo '%sbase%d'
+ local cluster="$1"
+ local index="$2"
+
+ printf '%sbase%d' "$cluster" "$index"
}
diff --git a/config.d/52node_build.defconf b/config.d/52node_build.defconf
index c9fc3e0..c58123e 100644
--- a/config.d/52node_build.defconf
+++ b/config.d/52node_build.defconf
@@ -2,7 +2,10 @@
node_name_format_build ()
{
- echo '%sbuild%d'
+ local cluster="$1"
+ local index="$2"
+
+ printf '%sbuild%d' "$cluster" "$index"
}
cluster_setup_tasks_build ()
diff --git a/config.d/55node_storage_gpfs.defconf b/config.d/55node_storage_gpfs.defconf
index 08f9811..fb4bfc5 100644
--- a/config.d/55node_storage_gpfs.defconf
+++ b/config.d/55node_storage_gpfs.defconf
@@ -4,7 +4,10 @@ NODES_STORAGE_GPFS=
node_name_format_storage_gpfs ()
{
- echo '%sstorage%d'
+ local cluster="$1"
+ local index="$2"
+
+ printf '%sstorage%d' "$cluster" "$index"
}
create_node_storage_gpfs ()
diff --git a/config.d/57node_ad.defconf b/config.d/57node_ad.defconf
index 8cc791c..4e69829 100644
--- a/config.d/57node_ad.defconf
+++ b/config.d/57node_ad.defconf
@@ -11,7 +11,10 @@ defconf AD_NETBIOS_NAME "samba4" \
node_name_format_ad ()
{
- echo '%sad%d'
+ local cluster="$1"
+ local index="$2"
+
+ printf '%sad%d' "$cluster" "$index"
}
cluster_setup_tasks_ad ()
diff --git a/config.d/60tsm.defconf b/config.d/60tsm.defconf
index c831188..2dd6dc5 100644
--- a/config.d/60tsm.defconf
+++ b/config.d/60tsm.defconf
@@ -27,11 +27,14 @@ defconf TSM_TEMPLATE "$installdir/templates/tsmserver.xml" \
node_name_format_tsm ()
{
+ local cluster="$1"
+ local index="$2"
+
# If only 1 tsm_server node then don't number it.
if [ "${NODES/tsm_server:/}" = "${NODES//tsm_server:/}" ] ; then
- echo '%stsm'
+ printf '%stsm' "$cluster"
else
- echo '%stsm%d'
+ printf '%stsm%d' "$cluster" "$index"
fi
}