From 144844a35f3a33a2e16d0a99daae4521235455ed Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 15 Mar 2021 12:28:53 +0200 Subject: workers install --- ick-workers.yml | 9 +++++++-- run-workers.sh | 49 +++++-------------------------------------------- 2 files changed, 12 insertions(+), 46 deletions(-) diff --git a/ick-workers.yml b/ick-workers.yml index 9cda47c..737cc9f 100644 --- a/ick-workers.yml +++ b/ick-workers.yml @@ -1,5 +1,5 @@ - hosts: workers - remote_user: root + remote_user: debian become: yes roles: - sane_debian_system @@ -7,4 +7,9 @@ - unix_users - ick-worker vars: - verify_tls: yes + sane_debian_system_version: 1 + sane_debian_system_codename: buster + + unix_users_version: 2 + + verify_tls: no 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 \ "$@" -- cgit v1.2.1