Client-Ansible-Setup/services/service_mail/prox-deploy-service.yml

43 lines
1.2 KiB
YAML
Executable File

- hosts:
- "{{ proxy_server_hostname }}"
# - "{{ proxy_server_hostname }}"-defaultport
become: 'yes'
vars:
ansible_become_method: doas
tasks:
- name: Temporarily disable doas pass prompt as doas persist does not work within scripts
replace:
path: /etc/doas.conf
regexp: 'persist'
replace: 'nopass'
# Haproxy is now handled globally again
#- name: Copy haproxy reverse proxy configuration to proxy
# ansible.builtin.template:
# src: "proxy_resources/etc/haproxy/haproxy.cfg"
# dest: "/etc/haproxy/haproxy.cfg"
# owner: root
# group: root
- name: Enable HAProxy
ansible.builtin.systemd:
name: haproxy
state: started
- name: Fetch SSL certificates
become: yes
synchronize:
src: /etc/letsencrypt/
dest: "data/certbot/certs"
mode: pull
rsync_path: doas rsync
- name: Switch back to doas persist
replace:
path: /etc/doas.conf
regexp: 'nopass'
replace: 'persist'
- name: Debug Finish message
debug:
msg: Ansible playbook has finished!