32 lines
1,020 B
YAML
32 lines
1,020 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"
|
||
|
|
||
|
- 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"
|
||
|
loop: "{{ postfix_domains }}"
|
||
|
notify: Get certificate
|
||
|
|
||
|
- name: "MTA-STS | Copy Nginx configuration"
|
||
|
ansible.builtin.template:
|
||
|
src: nginx/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
|
||
|
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
|
||
|
when: item.mta-sts is defined and item.mta-sts
|
||
|
loop: "{{ postfix_domains }}"
|
||
|
notify: reload nginx
|