summaryrefslogtreecommitdiff
path: root/run-single.sh
blob: 4b9ad06479e71d90d51be1522c468814d2b65a95 (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
42
43
44
45
46
47
48
49
50
#!/bin/bash

set -eu


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


mkhosts()
{
    cat <<EOF
ick ansible_ssh_host=$(getaddr ick)

[ickhost]
ick

[controller]
ick

[qvisqve]
ick

[apt]
ick

[notify]
ick

[workers]
ick
EOF
}


hosts_in="$1"
shift 1
mkhosts > hosts.tmp
ansible-playbook \
    -i hosts.tmp \
    ick2.yml \
    -e qvisqve_domain="$(getaddr ick)" \
    -e controller_domain="$(getaddr ick)" \
    -e artifact_store_domain="$(getaddr ick)" \
    -e apt_domain="$(getaddr ick)" \
    -e notify_domain="$(getaddr ick)" \
    "$@"