summaryrefslogtreecommitdiff
path: root/run-ickweb.yml
blob: 82fdace5a3f47771c7378fc5db49c2cebaf9eb88 (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
#!/bin/bash

set -eu


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


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

[ickwebhost]
demo
EOF
}


hosts_in="$1"
shift 1
mkhosts > hosts.tmp
ansible-playbook \
    ickweb.yml \
    -i hosts.tmp \
    -e ickweb_domain_name="$(getaddr demo)" \
    "$@"