From cbe0368ac18dd4c0c7f01e2004c6232f325b4f8e Mon Sep 17 00:00:00 2001 From: David Kilias Date: Sun, 14 Feb 2021 17:41:27 +0100 Subject: [PATCH] alternate_names als Liste --- roles/dehydrated-domains/README.md | 4 +++- roles/dehydrated-domains/tasks/main.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/dehydrated-domains/README.md b/roles/dehydrated-domains/README.md index f368286..44f897d 100644 --- a/roles/dehydrated-domains/README.md +++ b/roles/dehydrated-domains/README.md @@ -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 diff --git a/roles/dehydrated-domains/tasks/main.yml b/roles/dehydrated-domains/tasks/main.yml index e4243cd..d082e39 100644 --- a/roles/dehydrated-domains/tasks/main.yml +++ b/roles/dehydrated-domains/tasks/main.yml @@ -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 \ No newline at end of file