- name: Install haproxy and certbot apt: pkg: - haproxy - certbot - python3-certbot-dns-digitalocean - python3-certbot-dns-cloudflare 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 - name: Install weekly haproxy reload cron: name: "haproxy reload" special_time: weekly job: "/bin/systemctl reload haproxy"