Skip to content

Commit 3cb5135

Browse files
committed
fix: issue a single certificate per site
1 parent e76bebb commit 3cb5135

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ansible/roles/distributed_press/tasks/main.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@
206206
name: nginx
207207

208208
- name: "Register certbot certificate"
209-
shell: "certbot --nginx --non-interactive -d {{distributed_press_domain}} {{ distributed_press_served_sites | map('regex_replace', '^', '-d ') | join(' ') }} {% if (social_inbox_enabled) %} -d {{ social_inbox_domain }} {% endif %}--expand --agree-tos --no-eff-email --email {{distributed_press_letsencrypt_email}}"
209+
shell: "certbot --nginx --non-interactive -d {{distributed_press_domain}} {% if (social_inbox_enabled) %} -d {{ social_inbox_domain }} {% endif %}--expand --agree-tos --no-eff-email --email {{distributed_press_letsencrypt_email}}"
210+
211+
- name: "Register certbot certificate for each site"
212+
shell: "certbot --nginx --non-interactive -d {{item}} --expand --agree-tos --no-eff-email --email {{distributed_press_letsencrypt_email}}"
213+
loop: "{{distributed_press_served_sites}}"
210214

211215
- name: "Copy over default site config"
212216
template:

ansible/roles/distributed_press/templates/nginx-static.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ server {
3636

3737
listen [::]:443 ssl; # managed by Certbot
3838
listen 443 ssl; # managed by Certbot
39-
ssl_certificate /etc/letsencrypt/live/{{distributed_press_cert_name}}/fullchain.pem; # managed by Certbot
40-
ssl_certificate_key /etc/letsencrypt/live/{{distributed_press_cert_name}}/privkey.pem; # managed by Certbot
39+
ssl_certificate /etc/letsencrypt/live/{{item}}/fullchain.pem; # managed by Certbot
40+
ssl_certificate_key /etc/letsencrypt/live/{{item}}/privkey.pem; # managed by Certbot
4141
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
4242
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
4343
}

0 commit comments

Comments
 (0)