From f180c14e068c101cd202cb525be666a2924d76a4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 8 Jan 2024 19:35:01 +0100 Subject: [PATCH] Solved certbot bug --- roles/nginx-domain-redirect/tasks/main.yml | 7 +++++-- tasks/recieve-certbot-certificate.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/nginx-domain-redirect/tasks/main.yml b/roles/nginx-domain-redirect/tasks/main.yml index 0dccac71..616bfa8a 100644 --- a/roles/nginx-domain-redirect/tasks/main.yml +++ b/roles/nginx-domain-redirect/tasks/main.yml @@ -2,12 +2,15 @@ - name: "include task receive certbot certificate" include_tasks: recieve-certbot-certificate.yml vars: - domain: "{{ domain }}" + domain: "{{item.source}}" + loop: "{{domain_mappings}}" - name: configure nginx redirect configurations vars: domain: "{{item.source}}" target_domain: "{{item.target}}" - template: src=redirect.domain.nginx.conf.j2 dest={{nginx_servers_directory}}{{ domain }}.conf + template: + src: redirect.domain.nginx.conf.j2 + dest: "{{nginx_servers_directory}}{{ domain }}.conf" loop: "{{domain_mappings}}" notify: restart nginx diff --git a/tasks/recieve-certbot-certificate.yml b/tasks/recieve-certbot-certificate.yml index c0bd9218..2b72abfe 100644 --- a/tasks/recieve-certbot-certificate.yml +++ b/tasks/recieve-certbot-certificate.yml @@ -1,4 +1,4 @@ -- name: recieve certbot certificate for {{ domain }} +- name: "recieve certbot certificate for {{ domain }}" command: >- certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ domain }}