Merge "Unbound: remove incorrect config of forwarding"

This commit is contained in:
Zuul 2022-09-14 19:20:01 +00:00 committed by Gerrit Code Review
commit 948a5f23d8
2 changed files with 10 additions and 11 deletions

View File

@ -60,7 +60,16 @@
selevel: s0
setype: container_file_t
when:
- tripleo_unbound_forward_resolvers is defined and tripleo_unbound_forward_resolvers != ""
- tripleo_unbound_forward_resolvers is defined and ( tripleo_unbound_forward_resolvers | length ) > 0
register: _unbound_fwd_config_result
- name: Remove the TripleO Unbound forwarders configuration if no forwarders are configured
become: true
ansible.builtin.file:
path: "{{ tripleo_unbound_config_basedir }}/tripleo-forwarder-unbound.conf"
state: absent
when:
- tripleo_unbound_forward_resolvers is not defined or ( tripleo_unbound_forward_resolvers | length ) == 0
register: _unbound_fwd_config_result
- name: Restart Unbound

View File

@ -19,16 +19,6 @@ forward-zone:
{% for forwarder in tripleo_unbound_forward_resolvers %}
forward-addr: {{ forwarder }}
{% endfor %}
{% if tripleo_unbound_forward_resolvers|length == 0 %}
{% if groups.designate_bind is defined %}
{% for server in groups.designate_bind %}
forward-addr: {{ hostvars[server].tripleo_dns_listen_interfaces[0] }}
{% endfor %}
{% endif %}
{% for server in tripleo_external_bind_servers %}
forward-addr: {{ server.host }}
{% endfor %}
{% endif %}
{% if tripleo_unbound_forward_fallback and tripleo_unbound_allow_recursion %}
forward-first: yes
{% else %}