From 464c9fecb1cb938a68f403c33ed548a915b9790b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 14 Apr 2022 23:34:50 +0200 Subject: [PATCH] non-interactive certbot shittery --- roles/webgateway/tasks/main.yaml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/roles/webgateway/tasks/main.yaml b/roles/webgateway/tasks/main.yaml index 464010e..2f1efab 100644 --- a/roles/webgateway/tasks/main.yaml +++ b/roles/webgateway/tasks/main.yaml @@ -32,29 +32,15 @@ state: restarted enabled: yes -- name: "Check if proxy domains have certificate available" - stat: - path: "/etc/letsencrypt/live/{{ item.domain }}" - register: "{{ item.domain }}_available" - with_items: "{{ proxy }}" - -- name: "Check if statically served domains have certificate available" - stat: - path: "/etc/letsencrypt/live/{{ item.domain }}" - register: "{{ item.domain }}_available" - with_items: "{{ static }}" - - name: Generate certificate for all proxied domains command: - cmd: certbot certonly --nginx -d {{item.domain}} + cmd: certbot certonly --non-interactive --agree-tos -m tormakristof@tormakristof.eu --nginx -d {{item.domain}} with_items: "{{ proxy }}" - when: not {{ item.domain }}_available.stat.exists - name: Generate certificate for all static sites command: - cmd: certbot certonly --nginx -d {{item.domain}} + cmd: certbot certonly --non-interactive --agree-tos -m tormakristof@tormakristof.eu --nginx -d {{item.domain}} with_items: "{{ static }}" - when: not {{ item.domain }}_available.stat.exists - name: "Generate certbot script" ansible.builtin.template: