Update to 2025-09-29 18:00

This commit is contained in:
Daniel Berteaud
2025-09-29 18:00:28 +02:00
parent 5844fe3c39
commit c8b4455cba
2 changed files with 32 additions and 0 deletions

View File

@@ -36,6 +36,11 @@ consul_base_conf:
# An optional alternative domain # An optional alternative domain
# alt_domain: consul.example.org. # alt_domain: consul.example.org.
# dns_config:
# service_ttl:
# '*': 5s
# node_ttl: 5s
# Address that is advertised to the other nodes # Address that is advertised to the other nodes
advertise_addr: "{{ ansible_default_ipv4.address }}" advertise_addr: "{{ ansible_default_ipv4.address }}"
# You can also advertise the WAN addr # You can also advertise the WAN addr

View File

@@ -89,6 +89,33 @@ recursors = [
{% endfor %} {% endfor %}
] ]
{% if consul_conf.dns_config is defined %}
dns_config {
{% if consul_conf.dns_config.service_ttl is defined %}
service_ttl {
{% for service in consul_conf.dns_config.service_ttl.keys() | list %}
"{{ service }}" = "{{ consul_conf.dns_config.service_ttl[service] }}"
{% endfor %}
}
{% endif %}
{% for key in ["allow_stale", "enable_truncate", "only_passing", "enable_additional_node_meta_txt", "use_cache"] %}
{% if consul_conf.dns_config[key] is defined %}
{{ key }} = {{ (consul_conf.dns_config[key]) | ternary('true', 'false') }}
{% endif %}
{% endfor %}
{% for key in ["a_record_limit"] %}
{% if consul_conf.dns_config[key] is defined %}
{{ key }} = {{ (consul_conf.dns_config[key]) }}
{% endif %}
{% endfor %}
{% for key in ["node_ttl", "max_stale", "recursor_strategy", "recursor_timeout", "cache_max_age"] %}
{% if consul_conf.dns_config[key] is defined %}
{{ key }} = "{{ consul_conf.dns_config[key] }}"
{% endif %}
{% endfor %}
}
{% endif %}
{% if consul_conf.domain is defined %} {% if consul_conf.domain is defined %}
domain = "{{ consul_conf.domain }}" domain = "{{ consul_conf.domain }}"
{% endif %} {% endif %}