summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-15 12:28:53 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-15 12:28:53 +0200
commit144844a35f3a33a2e16d0a99daae4521235455ed (patch)
treeb99fdca5848edaa5103e08512caf4b907761545a
parent5779fea13ff662a4fa183a9332c1c9903695303e (diff)
downloadick2-ansible-144844a35f3a33a2e16d0a99daae4521235455ed.tar.gz
workers install
-rw-r--r--ick-workers.yml9
-rwxr-xr-xrun-workers.sh49
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 \
"$@"