chore(dns): allow pointing CNAMES to FQDNs

This commit is contained in:
Johanna Dorothea Reichmann 2021-06-15 15:08:00 +02:00
parent e8db39ad82
commit e44e0ee329
No known key found for this signature in database
GPG key ID: 03624C433676E465
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ CNAME entries can be specified in a list of dicts in `dns_cnames`, and each entr
with the keys `zone` and `names`.
`zone` is the zone where the CNAMEs should be created, and `names` is an array of dicts describing each CNAME.
This dict has a mandatory entry called `name`, which is the CNAME itself.
It is supported to also have a key called `target`, which can be used to point the CNAME to `target`.`zone`,
It is supported to also have a key called `target`, which can be used to point the CNAME to `target` directly,
the default is `dns_host_name_short`.`zone`.
### SRV records

View file

@ -49,7 +49,7 @@
type: CNAME
zone: "{{ item.0.zone }}"
record: "{{ item.1.name }}"
value: "{{ item.1.target|default(dns_host_name_short) }}.{{ item.0.zone }}"
value: "{{ item.1.target|default([dns_host_name_short, item.0.zone]|join('.')) }}"
api_token: "{{ dns_cloudflare_api_key }}"
loop: "{{ dns_cnames | subelements('names') }}"
when: dns_management_method == "cloudflare"