This commit is contained in:
@@ -11,12 +11,12 @@
|
||||
dns_serial: "{{ ansible_date_time.epoch }}"
|
||||
web_hostname_block: |-
|
||||
{% for webserver in groups['webservers'] | sort -%}
|
||||
{% for web_hostname in (hostvars[webserver]['web_hostname'] | selectattr('host', 'match', item.name) | map(attribute='host') | sort) -%}
|
||||
{% if web_hostname | match((\S+\.){2}) %}
|
||||
@ IN A {{ global_public_ip_address }}
|
||||
@ IN AAAA {{ hostvars[webserver].proxmox_net0.ip6 | default(hostvars[webserver].ansible_default_ipv4.address) | ansible.utils.ipaddr('address') }}
|
||||
{% for web_hostname in (hostvars[webserver]['web_hostname'] | selectattr('host', 'match', '.*' ~ item.name) | map(attribute='host') | sort) -%}
|
||||
{% if web_hostname is match("(\S+\.){2}") %}
|
||||
{{ web_hostname | regex_replace('\.' ~ item.name ~ '$', '') }} IN CNAME {{ hostvars[webserver].ansible_host }}.
|
||||
{% else %}
|
||||
{{ web_hostname | regex_replace('\.' ~ item.name ~ '$', '') }} IN CNAME {{ webserver }}.
|
||||
@ IN A {{ global_public_ip_address }}
|
||||
@ IN AAAA {{ hostvars[webserver].proxmox_net0.ip6 | default(hostvars[webserver].ansible_default_ipv6.address) | ansible.utils.ipaddr('address') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user