From c2d150d6be20d3be70a81c401f2385e3345721ab Mon Sep 17 00:00:00 2001
From: Kevin TIBI <kodokuu@gmail.com>
Date: Mon, 13 Nov 2017 10:26:14 +0000
Subject: [PATCH] Change listen for mdns

The service listening port of MDNS can be override by dns_interface.
If so, the pool conf use the wrong IP for join mdns service.

Change-Id: I8a3678955ecf5f769da7090fe5dad68e027c102b
---
 ansible/roles/designate/templates/pools.yaml.j2           | 8 ++++----
 .../notes/add-designate-bind-mdns-123e79587bb06072.yaml   | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)
 create mode 100644 releasenotes/notes/add-designate-bind-mdns-123e79587bb06072.yaml

diff --git a/ansible/roles/designate/templates/pools.yaml.j2 b/ansible/roles/designate/templates/pools.yaml.j2
index f35ef5a9f..02a129104 100644
--- a/ansible/roles/designate/templates/pools.yaml.j2
+++ b/ansible/roles/designate/templates/pools.yaml.j2
@@ -25,8 +25,8 @@
       description: BIND9 Server {{ hostvars[bind_host]['ansible_' + hostvars[bind_host]['api_interface']]['ipv4']['address'] }}
       masters:
 {% for mdns_host in groups['designate-mdns'] %}
-        - host: {{ hostvars[mdns_host]['ansible_' + hostvars[mdns_host]['api_interface']]['ipv4']['address'] }}
-          port: 5354
+        - host: {{ hostvars[mdns_host]['ansible_' + hostvars[mdns_host]['dns_interface']]['ipv4']['address'] }}
+          port: {{ designate_mdns_port }}
 {% endfor %}
       options:
         host: {{ hostvars[bind_host]['ansible_' + hostvars[bind_host]['api_interface']]['ipv4']['address'] }}
@@ -41,8 +41,8 @@
       description: BIND9 Server {{ bind_host }}
       masters:
 {% for mdns_host in groups['designate-mdns'] %}
-        - host: {{ hostvars[mdns_host]['ansible_' + hostvars[mdns_host]['api_interface']]['ipv4']['address'] }}
-          port: 5354
+        - host: {{ hostvars[mdns_host]['ansible_' + hostvars[mdns_host]['dns_interface']]['ipv4']['address'] }}
+          port: {{ designate_mdns_port }}
 {% endfor %}
       options:
         host: {{ bind_host }}
diff --git a/releasenotes/notes/add-designate-bind-mdns-123e79587bb06072.yaml b/releasenotes/notes/add-designate-bind-mdns-123e79587bb06072.yaml
new file mode 100644
index 000000000..49bc9eaf9
--- /dev/null
+++ b/releasenotes/notes/add-designate-bind-mdns-123e79587bb06072.yaml
@@ -0,0 +1,3 @@
+---
+fixes:
+  - Change the service listening port of MDNS by dns_interface.
-- 
GitLab