1
0
Fork 0
home-stack-ansible/roles/haproxy/tasks/main.yml

43 lines
943 B
YAML

- name: Install haproxy and certbot
apt:
pkg:
- haproxy
- certbot
- python3-certbot-dns-digitalocean
update_cache: yes
state: present
- name: Install haproxy.cfg
vars:
https_routing: '{{ haproxy.routing.https }}'
tcp_routing: '{{ haproxy.routing.tcp }}'
template:
src: haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
notify: Restart haproxy
- name: Create certbot configuration directory
file:
path: /opt/certbot
state: directory
- name: Install certbot-creds.ini
template:
src: certbot-creds.ini
dest: /opt/certbot/certbot-creds.ini
mode: '0600'
notify: Run certbot
- name: Install certbot-run.sh
template:
src: certbot-run.sh
dest: /opt/certbot/certbot-run.sh
mode: '0700'
notify: Run certbot
- name: Install certbot-deploy.sh
template:
src: certbot-deploy.sh
dest: /opt/certbot/certbot-deploy.sh
mode: '0700'
notify: Run certbot