You've already forked role_dnsmasq
feat: Add new variable for ipv6 subnet
This commit is contained in:
@@ -3,15 +3,10 @@
|
||||
{% for host in groups[dnsmasq_ansible_group] %}
|
||||
{%- set ipv4 = hostvars[host]['ansible_host'] %}
|
||||
{%- set ipv6_suffix = hostvars[host]['ansible_host'] | split('.') | last %}
|
||||
{%- set ipv6 = (dnsmasq_ipv6_subnet | split('/') | first) + ipv6_suffix %}
|
||||
{%- set aliases = [host] + hostvars[host].get('dnsmasq_host_aliases', []) %}
|
||||
|
||||
# {{ host }}
|
||||
{{ ipv4 }} {{ aliases | join(' ') }}
|
||||
{% if (ipv6_suffix | int) < 10 %}
|
||||
2a01:e0a:ee5:8b0::d00{{ ipv6_suffix }} {{ aliases | join(' ') }}
|
||||
{% elif (ipv6_suffix | int) < 100 %}
|
||||
2a01:e0a:ee5:8b0::d0{{ ipv6_suffix }} {{ aliases | join(' ') }}
|
||||
{% else %}
|
||||
2a01:e0a:ee5:8b0::d{{ ipv6_suffix }} {{ aliases | join(' ') }}
|
||||
{% endif %}
|
||||
{{ ipv6 }} {{ aliases | join(' ') }}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user