diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-15 12:28:53 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-15 12:28:53 +0200 |
commit | 144844a35f3a33a2e16d0a99daae4521235455ed (patch) | |
tree | b99fdca5848edaa5103e08512caf4b907761545a /run-workers.sh | |
parent | 5779fea13ff662a4fa183a9332c1c9903695303e (diff) | |
download | ick2-ansible-144844a35f3a33a2e16d0a99daae4521235455ed.tar.gz |
workers install
Diffstat (limited to 'run-workers.sh')
-rwxr-xr-x | run-workers.sh | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/run-workers.sh b/run-workers.sh index 0332027..99cdf61 100755 --- a/run-workers.sh +++ b/run-workers.sh @@ -3,50 +3,11 @@ set -eu -getaddr() -{ - awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" | - sed 's/ansible_ssh_host=//' -} +controller_domain="$1" +shift 1 - -count_workers() -{ - grep -Ec '^worker[[:digit:]]+' "$1" -} - - -mkhosts() -{ - local n="$1" - for i in $(seq "$n") - do - echo "worker$i hostname=worker$i ansible_ssh_host=$(getaddr worker$i)" - done - echo - - echo "[ickhost]" - for i in $(seq "$n") - do - echo "worker$i" - done - echo - - echo "[workers]" - for i in $(seq "$n") - do - echo "worker$i" - done -} - -hosts_in="$1" -controller_domain="$2" -apt_domain="$controller_domain" -shift 2 - -nw="$(count_workers "$hosts_in")" -mkhosts "$nw" > hosts.tmp -ansible-playbook -i hosts.tmp ick-workers.yml \ +ansible-playbook -i hosts ick-workers.yml \ -e "controller_domain=$controller_domain" \ - -e "apt_domain=$apt_domain)" \ + -e "apt_domain=$controller_domain" \ + -e @liw.yml \ "$@" |