fix(nginx): make Let's Encrypt opt-in per service
certbot cannot issue for internal hostnames (*.nas.local), which made nginx-enabled services with internal names fail on deploy. Add a <service>_nginx_letsencrypt flag (default false) and computed <service>_nginx_ssl_certificate/_key paths: when off the vhost uses the shared self-signed cert (nginx_default_ssl_cert), when on it uses the Let's Encrypt lineage. Gate the certbot include on the flag and apply the pattern to all service roles (deluge, fdroid, gitea, grafana, immich, metabase, ntfy, prowlarr, radarr, seerr, static_web, uptime_kuma).
This commit is contained in:
@@ -5,12 +5,16 @@
|
||||
# - certbot_hostname: the domain to provision (e.g. "apk.jokester.fr")
|
||||
# - acme_email: Let's Encrypt account email (typically from host_vars)
|
||||
#
|
||||
# Let's Encrypt only issues for publicly-resolvable hostnames, so gate the
|
||||
# include on the service's `<service>_nginx_letsencrypt` flag (default false;
|
||||
# internal names fall back to the shared self-signed cert).
|
||||
#
|
||||
# Usage from a service role:
|
||||
# - name: Provision TLS certificate
|
||||
# ansible.builtin.include_tasks: "{{ role_path }}/../nginx/tasks/certbot.yml"
|
||||
# vars:
|
||||
# certbot_hostname: "{{ myservice_nginx_hostname }}"
|
||||
# when: myservice_nginx_enabled
|
||||
# when: myservice_nginx_enabled and myservice_nginx_letsencrypt
|
||||
|
||||
- name: Validate certbot requirements
|
||||
ansible.builtin.assert:
|
||||
|
||||
Reference in New Issue
Block a user