nginx: support certificates for multiple domains
Uses `tls_domains` config context property from NetBox.
This commit is contained in:
parent
554bf1f711
commit
c970c562a9
3
roles/nginx/README.md
Normal file
3
roles/nginx/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Install nginx, set up generic HTTPS redirects and the .well-known directory.
|
||||||
|
|
||||||
|
Acquire Let’s Encrypt certificates for the primary IP `dns_name` and any domains listed in the `tls_domains` context property.
|
|
@ -26,7 +26,11 @@
|
||||||
|
|
||||||
- name: Get LE certificate
|
- name: Get LE certificate
|
||||||
command:
|
command:
|
||||||
cmd: certbot certonly --non-interactive --agree-tos --register-unsafely-without-email --webroot --webroot-path /srv/http -d {{ dns_name }}
|
cmd: >
|
||||||
|
certbot certonly
|
||||||
|
--non-interactive --agree-tos --register-unsafely-without-email
|
||||||
|
--webroot --webroot-path /srv/http
|
||||||
|
-d {{ ([dns_name] + tls_domains|default([])) | join(',') }}
|
||||||
creates: '/etc/letsencrypt/renewal/{{ dns_name }}.conf'
|
creates: '/etc/letsencrypt/renewal/{{ dns_name }}.conf'
|
||||||
|
|
||||||
- name: Install certificate renewal deployment hook
|
- name: Install certificate renewal deployment hook
|
||||||
|
|
Loading…
Reference in a new issue