summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-15 11:21:21 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-15 11:21:21 +0200
commit6d28f6080a23ede497a7957aa4e15553e5874a37 (patch)
tree8df1e76b874bfbc6be7c02de6f254476205ccbc6
parent9b9d4c2ead73275e02f0413978642db5ad5c6df6 (diff)
downloadick2-ansible-6d28f6080a23ede497a7957aa4e15553e5874a37.tar.gz
fix: make apt_repositroy work
-rw-r--r--ick-cluster.yml23
-rw-r--r--roles/apt_repository/tasks/main.yml12
-rwxr-xr-xrun-cluster.sh50
3 files changed, 23 insertions, 62 deletions
diff --git a/ick-cluster.yml b/ick-cluster.yml
index 6cbfa3f..22fa365 100644
--- a/ick-cluster.yml
+++ b/ick-cluster.yml
@@ -1,20 +1,21 @@
-- hosts: controller
- remote_user: root
+- hosts: ick
+ remote_user: debian
become: yes
roles:
- sane_debian_system
- - unix_users
- comfortable
- apt_repository
- - haproxy
- - qvisqve
- - ick-controller
- - ick-artifact-store
- - ick-notifier
- - ickweb
- - muck
+ # - haproxy
+ # - qvisqve
+ # - ick-controller
+ # - ick-artifact-store
+ # - ick-notifier
+ # - ickweb
+ # - muck
vars:
- hostname: ickhost
+ sane_debian_system_version: 1
+ sane_debian_system_codename: buster
+
haproxy_domain: "{{ controller_domain }}"
qvisqve_domain: "{{ controller_domain }}"
artifact_store_domain: "{{ controller_domain }}"
diff --git a/roles/apt_repository/tasks/main.yml b/roles/apt_repository/tasks/main.yml
index 83b29e5..047af9e 100644
--- a/roles/apt_repository/tasks/main.yml
+++ b/roles/apt_repository/tasks/main.yml
@@ -138,9 +138,13 @@
group: apt
mode: 0755
+- name: "create incrontab for apt"
+ copy:
+ content: |
+ /srv/apt/incoming IN_CLOSE_WRITE /srv/apt/process-incoming
+ dest: /srv/apt/incrontab
+
- name: set up incrontab for processing incoming uploads
shell: |
- incrontab - << EOF
- /srv/apt/incoming IN_CLOSE_WRITE /srv/apt/process-incoming
- EOF
- become_user: apt
+ sudo -u apt incrontab /srv/apt/incrontab
+
diff --git a/run-cluster.sh b/run-cluster.sh
index 4c987ab..cb695ec 100755
--- a/run-cluster.sh
+++ b/run-cluster.sh
@@ -2,51 +2,7 @@
set -eu
-
-getaddr()
-{
- awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" |
- sed 's/ansible_ssh_host=//'
-}
-
-
-mkhosts()
-{
- cat <<EOF
-ick ansible_ssh_host=$(getaddr controller)
-worker1 hostname=worker1 ansible_ssh_host=$(getaddr worker1)
-worker2 hostname=worker2 ansible_ssh_host=$(getaddr worker2)
-
-[ickhost]
-ick
-worker1
-worker2
-
-[controller]
-ick
-
-[qvisqve]
-ick
-
-[apt]
-ick
-
-[notify]
-ick
-
-[workers]
-worker1
-worker2
-EOF
-}
-
-hosts_in="$1"
-shift 1
-mkhosts > hosts.tmp
-ansible-playbook -i hosts.tmp ick-cluster.yml \
- -e "qvisqve_domain=$(getaddr controller)" \
- -e "controller_domain=$(getaddr controller)" \
- -e "artifact_store_domain=$(getaddr controller)" \
- -e "apt_domain=$(getaddr controller)" \
- -e "notify_domain=$(getaddr controller)" \
+ansible-playbook -i hosts ick-cluster.yml \
+ -e controller_domain=controller \
+ -e @liw.yml \
"$@"