summaryrefslogtreecommitdiffstats
path: root/scripts/service.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/service.sh')
-rwxr-xr-xscripts/service.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/service.sh b/scripts/service.sh
new file mode 100755
index 0000000..ff458bc
--- /dev/null
+++ b/scripts/service.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+if [[ $# -ne 2 ]]
+then
+ echo "Must have at least two arguments. The first is name of the service and the second is the action to be done with the service."
+ exit 1
+fi
+for odl_hostname in `grep -Eo 'overcloud-controller-[0-9]' /etc/hosts`
+do
+ echo "Executing service $1 $2 on $odl_hostname"
+ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $odl_hostname service $1 $2 2> /dev/null
+done