ansible-role-postfix/tasks/mta-sts.yml

32 lines
1,014 B
YAML
Raw Normal View History

2023-04-17 22:11:40 +02:00
---
- name: "MTA-STS | Copy file"
ansible.builtin.template:
src: nginx/mta-sts.txt.j2
dest: /var/www/html/mta-sts.txt
mode: "0644"
- name: "MTA-STS | Get certificate"
ansible.builtin.lineinfile:
path: /etc/dehydrated/domains.txt
line: "mta-sts.{{ item.name }}"
2023-04-17 23:17:22 +02:00
when: "'dehydrated' in ansible_facts.packages and item.mta_sts is defined and item.mta_sts"
2023-04-17 22:11:40 +02:00
loop: "{{ postfix_domains }}"
notify: Get certificate
- name: "MTA-STS | Copy Nginx configuration"
ansible.builtin.template:
2023-04-17 23:17:22 +02:00
src: nginx/mta-sts.j2
2023-04-17 22:11:40 +02:00
dest: "/etc/nginx/sites-available/mta-sts.{{ item.name }}"
mode: "0644"
2023-04-17 23:17:22 +02:00
when: item.mta_sts is defined and item.mta_sts
2023-04-17 22:11:40 +02:00
loop: "{{ postfix_domains }}"
- 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
2023-04-17 23:17:22 +02:00
when: item.mta_sts is defined and item.mta_sts
2023-04-17 22:11:40 +02:00
loop: "{{ postfix_domains }}"
notify: reload nginx