summaryrefslogtreecommitdiff
path: root/run-single.sh
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-06-10 19:31:04 +0300
committerLars Wirzenius <liw@liw.fi>2018-06-10 19:31:04 +0300
commit363fbccdbe5e9e6774f9a949cc1d8670d6287c48 (patch)
tree4b234f43749f92c79a3338fc1d440a895d6523ec /run-single.sh
parentb123157dd5c08529515edb170d29e8be9accd8e1 (diff)
downloadick2-ansible-363fbccdbe5e9e6774f9a949cc1d8670d6287c48.tar.gz
Change: put all of ick in one host for ick2.yml
Diffstat (limited to 'run-single.sh')
-rwxr-xr-xrun-single.sh38
1 files changed, 24 insertions, 14 deletions
diff --git a/run-single.sh b/run-single.sh
index b36258d..4033b22 100755
--- a/run-single.sh
+++ b/run-single.sh
@@ -3,29 +3,39 @@
set -eu
-hosts_in="$1"
-shift 1
-
-
getip()
{
- awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in"
+ awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" |
+ sed 's/ansible_ssh_host=//'
}
mkhosts()
{
cat <<EOF
-[ick]
-qvisqve hostname=qvisqve ansible_ssh_host=$(getip qvisqve)
-ick2 hostname=ick ansible_ssh_host=$(getip ick2)
+single ansible_ssh_host=$(getip single)
+
+[qvisqve]
+single
+
+[controller]
+single
+
+[workers]
+single
EOF
}
+
+hosts_in="$1"
+shift 1
mkhosts > hosts.tmp
-ansible-playbook -i hosts.tmp ick2.yml \
- -e "qvisqve_domain=$(getip qvisqve)" \
- -e "controller_domain=$(getip ick2)" \
- -e "artifact_store_domain=$(getip ick2)" \
- -e "apt_domain=$(getip ick2)" \
- "$@"
+ansible-playbook \
+ -i hosts.tmp \
+ ick2.yml \
+ -e qvisqve_domain="$(getip single)" \
+ -e controller_domain="$(getip single)" \
+ -e artifact_store_domain="$(getip single)" \
+ -e apt_domain="$(getip single)" \
+ -e notify_domain="$(getip single)" \
+ "$@"