From 548b8659b57b8e2dd331c6be3ecbe80f16e4bcec Mon Sep 17 00:00:00 2001 From: Elias Hackradt Date: Thu, 21 Apr 2022 13:05:43 +0200 Subject: [PATCH] FIX permission change and hook creation only if folder exists already --- tasks/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 56d77c2..37e58a0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,6 +20,10 @@ groups: "{{ coturn_tls_group }}" append: true when: coturn_tls_group is defined + - name: Get file info of TLS Folder + stat: + path: "{{ coturn_tls_cert_dir }}" + register: stat_coturn_tls_cert_dir - name: Grant turnserver user access to certificate folder acl: path: "{{ coturn_tls_cert_dir }}" @@ -28,6 +32,7 @@ permissions: rx recursive: yes state: present + when: stat_coturn_tls_cert_dir.stat.exists - name: Setup certbot post hook template: src: "certbot/permission_fix.sh.j2" @@ -35,7 +40,7 @@ owner: "root" group: "root" mode: "0755" - when: coturn_tls_cert_dir == "/etc/letsencrypt" + when: stat_coturn_tls_cert_dir.stat.exists - name: Copy Diffie-Hellmann parameter (from https://ssl-config.mozilla.org/ffdhe2048.txt) copy: src: dhparam.pem