summaryrefslogtreecommitdiff
path: root/run-ickui.sh
blob: 8c5a80e68e2bfee517a314b10bbdabe1e722e39f (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
#!/bin/bash

set -eu


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


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

[ickhost]
ui
EOF
}

hosts_in="$1"
shift 1
mkhosts > hosts.tmp
ansible-playbook -i hosts.tmp ick-ui.yml \
                 "$@"