alternate_names als Liste

This commit is contained in:
David Kilias 2021-02-14 17:41:27 +01:00 committed by Gitea
parent 9ff8f0ad6c
commit cbe0368ac1
2 changed files with 4 additions and 2 deletions

View file

@ -8,7 +8,9 @@ Ansible role to configure domains for use with dehydrated
vars:
dehydrated_domains:
- name: example.com
alternate_names: "www.example.com web.example.com"
alternate_names:
- www.example.com
- web.example.com
deploy_challenge_hook: printf 'server 127.0.0.1\nupdate add _acme-challenge.%s 300 IN TXT "%s"\nsend\n' "${DOMAIN}" "${TOKEN_VALUE}" | nsupdate -k /var/run/named/session.key
clean_challenge_hook: printf 'server 127.0.0.1\nupdate delete _acme-challenge.%s TXT "%s"\nsend\n' "${DOMAIN}" "${TOKEN_VALUE}" | nsupdate -k /var/run/named/session.key

View file

@ -14,6 +14,6 @@
- name: Ensure Domains are in domains.txt
lineinfile:
path: "{{ dehydrated_config_dir }}/domains.txt"
line: "{{ item.name }} {{ item.alternate_names|default(omit) }}"
line: "{{ item.name }}{% for an in item.alternate_names %} {{ an|default(omit) }}{% endfor %}"
with_items: dehydrated_domains
notify: dehydrated cron