ansible-role-postfix/tasks/mta-sts.yml
2023-04-18 00:08:33 +02:00

29 lines
967 B
YAML

---
- name: "MTA-STS | Copy file"
ansible.builtin.template:
src: nginx/mta-sts.txt.j2
dest: /var/www/html/mta-sts.txt
mode: "0644"
when: item.mta_sts is defined and item.mta_sts
- name: "MTA-STS | Get certificate"
ansible.builtin.lineinfile:
path: /etc/dehydrated/domains.txt
line: "mta-sts.{{ item.name }}"
when: "'dehydrated' in ansible_facts.packages and item.mta_sts is defined and item.mta_sts"
notify: Get certificate
- name: "MTA-STS | Copy Nginx configuration"
ansible.builtin.template:
src: nginx/mta-sts.j2
dest: "/etc/nginx/sites-available/mta-sts.{{ item.name }}"
mode: "0644"
when: item.mta_sts is defined and item.mta_sts
- name: "MTA-STS | Enable Nginx configuration"
ansible.builtin.file:
src: "/etc/nginx/sites-available/mta-sts.{{ item.name }}"
dest: "/etc/nginx/sites-enabled/mta-sts.{{ item.name }}"
state: link
when: item.mta_sts is defined and item.mta_sts
notify: reload nginx