From 472ac725e5b1635b2195166332bf8ac44648b6fe Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 18 Apr 2023 00:08:33 +0200 Subject: [PATCH] Fixes --- tasks/main.yml | 3 +++ tasks/mta-sts.yml | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 3c8f5da..b74c99c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,6 +32,9 @@ ansible.builtin.include_tasks: mta-sts.yml tags: mta-sts loop: "{{ postfix_domains }}" + args: + apply: + delegate_to: "{{ gateway_host }}" - name: Hostname ansible.builtin.import_tasks: hostname.yml diff --git a/tasks/mta-sts.yml b/tasks/mta-sts.yml index 1ff8a83..f60bd0b 100644 --- a/tasks/mta-sts.yml +++ b/tasks/mta-sts.yml @@ -4,13 +4,13 @@ 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" - loop: "{{ postfix_domains }}" notify: Get certificate - name: "MTA-STS | Copy Nginx configuration" @@ -19,7 +19,6 @@ 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: @@ -27,5 +26,4 @@ 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