summaryrefslogtreecommitdiffstats
path: root/node-admin/scripts
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2016-06-28 21:10:07 +0200
committerHarald Musum <musum@yahoo-inc.com>2016-06-28 21:10:07 +0200
commitfb31f9337a770cfad3cd714c2e2560f3dfeeaff6 (patch)
treea67e9a8eb1235d580ba4cebe98f71872c21307f2 /node-admin/scripts
parent0ff2ee573d5882a6b88b2c40e0b13dc63ff2414d (diff)
Change add-host command to provision both Docker host and nodes at the same time
Diffstat (limited to 'node-admin/scripts')
-rwxr-xr-xnode-admin/scripts/node-repo.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/node-admin/scripts/node-repo.sh b/node-admin/scripts/node-repo.sh
index f5b811fb600..82c770bd645 100755
--- a/node-admin/scripts/node-repo.sh
+++ b/node-admin/scripts/node-repo.sh
@@ -14,8 +14,9 @@ Script for manipulating the Node Repository.
Commands
add [-c <configserverhost>] -p <parenthostname> <hostname>...
Provision node <hostname> in node repo with flavor "docker".
- add-host [-c <configserverhost>] <hostname>
- Provision Docker host <hostname> in node repo with type "host".
+ add-host [-c <configserverhost>] <parenthostname> <parenthostname flavor> [<hostname>...]
+ Provision Docker host <parenthostname> in node repo with type "host" and flavor as given.
+ Provision Docker nodes <hostname> (0 or more) in node repo with flavor "docker".
reprovision [-c <configserverhost>] -p <parenthostname> <hostname>...
Fail node <hostname>, then rm and add.
rm [-c <configserverhost>] <hostname>...
@@ -242,7 +243,7 @@ function AddHostCommand {
Fail "No hostname was specified"
fi
- local hostname="$1"
+ local parent_hostname="$1"
shift
if (($# == 0))
@@ -252,12 +253,22 @@ function AddHostCommand {
local flavor="$1"
shift
- echo -n "Provisioning Docker host $hostname with flavor $flavor"
-
+ echo "Provisioning Docker host $parent_hostname with flavor $flavor"
ProvisionDockerHost "$config_server_hostname" \
- "$hostname" \
+ "$parent_hostname" \
"$flavor"
+
+ echo -n "Provisioning $# nodes with parent host $parent_hostname"
+ local container_hostname
+ for container_hostname in "$@"
+ do
+ ProvisionDockerNode "$config_server_hostname" \
+ "$container_hostname" \
+ "$parent_hostname"
+ echo -n .
+ done
+
echo " done"
}