|
|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
--- |
|
|
|
|
- name: main haproxy block |
|
|
|
|
vars: |
|
|
|
|
install_certbot: true |
|
|
|
|
vars: {} |
|
|
|
|
block: |
|
|
|
|
- debug: |
|
|
|
|
var: groups['containers'] |
|
|
|
|
@ -9,6 +8,7 @@
|
|
|
|
|
- name: install pakages |
|
|
|
|
apk: |
|
|
|
|
name: [ haproxy ] |
|
|
|
|
state: installed |
|
|
|
|
|
|
|
|
|
- name: create haproxy routes for other containers |
|
|
|
|
template: |
|
|
|
|
@ -21,10 +21,23 @@
|
|
|
|
|
enabled: yes |
|
|
|
|
state: restarted |
|
|
|
|
|
|
|
|
|
- name: cerbot block |
|
|
|
|
when: install_certbot |
|
|
|
|
block: |
|
|
|
|
- name: install certbot |
|
|
|
|
apk: |
|
|
|
|
name: [ certbot ] |
|
|
|
|
when: install_certbot |
|
|
|
|
|
|
|
|
|
# TODO: route web roots for each container in haproxy.conf |
|
|
|
|
# NOTE: can use *.lxd domain names in haproxy container |
|
|
|
|
- name: add certbot hooks |
|
|
|
|
include_tasks: install_certbot_hooks.yml |
|
|
|
|
loop: [ "stop", "start" ] |
|
|
|
|
|
|
|
|
|
- name: add certbot autorenew cron job |
|
|
|
|
template: |
|
|
|
|
src: templates/certbot_renew_cron.sh.j2 |
|
|
|
|
dest: /etc/periodic/weekly/certbot_renew.sh |
|
|
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: add task to upload existing certificates |
|
|
|
|
# TODO: add task to create initial certificates |
|
|
|
|
|