summaryrefslogtreecommitdiff
path: root/run-single.sh
blob: 4033b221b46b4a5af3825d9ce52be0df4798849a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

set -eu


getip()
{
    awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" |
        sed 's/ansible_ssh_host=//'
}


mkhosts()
{
    cat <<EOF
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 single)" \
    -e controller_domain="$(getip single)" \
    -e artifact_store_domain="$(getip single)" \
    -e apt_domain="$(getip single)" \
    -e notify_domain="$(getip single)" \
    "$@"