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

49 lines
1.1 KiB
YAML
Raw Normal View History

2021-08-25 04:33:56 +00:00
- 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'
2022-07-21 03:35:49 +00:00
notify: Run certbot
- name: Install weekly haproxy reload
cron:
name: "haproxy reload"
special_time: weekly
job: "/bin/systemctl reload haproxy"