simplify acme config

master
HgO 2020-12-30 14:27:29 +01:00
parent 3365215ceb
commit b0b5d8c24a
2 changed files with 2 additions and 9 deletions

View File

@ -1,7 +1,6 @@
mumble_domain: "{{ inventory_hostname }}.local" mumble_domain: "{{ inventory_hostname }}.local"
acme_enabled: no acme_enabled: no
acme_account_email: acme@example.com
acme_domains: acme_domains:
- name: "{{ mumble_domain }}" - name: "{{ mumble_domain }}"
hooks: | hooks: |
@ -10,13 +9,7 @@ acme_domains:
'systemctl restart umurmur' if umurmur_enabled else None, 'systemctl restart umurmur' if umurmur_enabled else None,
'systemctl restart mumble-server' if murmur_enabled else None 'systemctl restart mumble-server' if murmur_enabled else None
) | reject("none") | list }} ) | reject("none") | list }}
acme_config: acme_directory_url: https://acme-v02.api.letsencrypt.org/directory
account:
private_key: "{{ acme_accounts_dir }}/acme_account.key"
email: "{{ acme_account_email }}"
directory_url: https://acme-v02.api.letsencrypt.org/directory
challenge_dir: /var/www/acme/.well-known/acme-challenge
domains: "{{ acme_domains }}"
mumble_web_enabled: no mumble_web_enabled: no
mumble_web_domain: "{{ mumble_domain }}" mumble_web_domain: "{{ mumble_domain }}"

View File

@ -11,7 +11,7 @@ server {
{% if acme_enabled %} {% if acme_enabled %}
location ^~ /.well-known/acme-challenge/ { location ^~ /.well-known/acme-challenge/ {
allow all; allow all;
alias {{ acme_config.challenge_dir + (acme_config.challenge_dir.endswith('/') | ternary('', '/')) }}; root {{ acme_root_dir }};
try_files $uri =404; try_files $uri =404;
} }
{% endif %} {% endif %}