Add possibility to change mdns listening address and port

Change-Id: I5a1f8f53629a1616323f9d3a053d5dddcccdd85c
Related-Bug: https://mirantis.jira.com/browse/PROD-14930
diff --git a/README.rst b/README.rst
index 0192058..9ca7da7 100644
--- a/README.rst
+++ b/README.rst
@@ -43,6 +43,9 @@
           tenant: service
           user: designate
           password: passw0rd
+        mdns:
+          address: 0.0.0.0
+          port: 5354
         message_queue:
           engine: rabbitmq
           members:
@@ -88,6 +91,11 @@
    it defaults to http://*server:bind:api:address*:9001/.
 
 .. note::
+   *server:mdns:address* and *server:mdns:port* options allow to change MDNS listening address and
+   port. Changes to server:pools:*:targets will be also required if the MDNS's address and port are
+   being used there.
+
+.. note::
    *worker:enabled* sets worker role and installs designate-worker and designate-producer packages
    which services will push changes to backend DNS servers.
    *pool_manager:enabled* should be a default role for older releases of OpenStack, older than
diff --git a/designate/files/liberty/designate.conf.Debian b/designate/files/liberty/designate.conf.Debian
index f284672..9419a83 100644
--- a/designate/files/liberty/designate.conf.Debian
+++ b/designate/files/liberty/designate.conf.Debian
@@ -192,10 +192,10 @@
 #threads = 1000
 
 # mDNS Bind Host
-#host = 0.0.0.0
+host = {{ server.mdns.address }}
 
 # mDNS Port Number
-#port = 5354
+port = {{ server.mdns.port }}
 
 # mDNS TCP Backlog
 #tcp_backlog = 100
diff --git a/designate/files/mitaka/designate.conf.Debian b/designate/files/mitaka/designate.conf.Debian
index 62a472c..5c63b5e 100644
--- a/designate/files/mitaka/designate.conf.Debian
+++ b/designate/files/mitaka/designate.conf.Debian
@@ -282,10 +282,10 @@
 #threads = 1000
 
 # mDNS Bind Host
-#host = 0.0.0.0
+host = {{ server.mdns.address }}
 
 # mDNS Port Number
-#port = 5354
+port = {{ server.mdns.port }}
 
 # mDNS TCP Backlog
 #tcp_backlog = 100
diff --git a/designate/files/ocata/designate.conf.Debian b/designate/files/ocata/designate.conf.Debian
index b5ac5dc..28534b7 100644
--- a/designate/files/ocata/designate.conf.Debian
+++ b/designate/files/ocata/designate.conf.Debian
@@ -280,7 +280,7 @@
 #threads = 1000
 
 # mDNS bind host+port pairs, comma separated
-#listen = 0.0.0.0:5354
+listen = {{ server.mdns.address }}:{{ server.mdns.port }}
 
 # mDNS TCP Backlog
 #tcp_backlog = 100
diff --git a/designate/map.jinja b/designate/map.jinja
index 70ace07..244d8c9 100644
--- a/designate/map.jinja
+++ b/designate/map.jinja
@@ -10,6 +10,10 @@
     'default': {
         'api': {
             'base_uri': 'http://' + api_address + ':' + api_port + '/'
+        },
+        'mdns' : {
+            'address': '0.0.0.0',
+            'port': '5354'
         }
     },
     'Debian': {
diff --git a/tests/pillar/designate_liberty.sls b/tests/pillar/designate_liberty.sls
index bef5e4a..3ed12f5 100644
--- a/tests/pillar/designate_liberty.sls
+++ b/tests/pillar/designate_liberty.sls
@@ -6,6 +6,9 @@
     region: RegionOne
     domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
     version: liberty
+    mdns:
+      address: 0.0.0.0
+      port: 5354
     message_queue:
       members:
         - host: 127.0.0.1
diff --git a/tests/pillar/designate_mitaka.sls b/tests/pillar/designate_mitaka.sls
index e0e3f67..90775a5 100644
--- a/tests/pillar/designate_mitaka.sls
+++ b/tests/pillar/designate_mitaka.sls
@@ -6,6 +6,9 @@
     region: RegionOne
     domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
     version: mitaka
+    mdns:
+      address: 0.0.0.0
+      port: 5354
     message_queue:
       members:
         - host: 127.0.0.1
diff --git a/tests/pillar/designate_ocata.sls b/tests/pillar/designate_ocata.sls
index adbd8ad..0656fd9 100644
--- a/tests/pillar/designate_ocata.sls
+++ b/tests/pillar/designate_ocata.sls
@@ -26,6 +26,9 @@
       tenant: service
       user: designate
       password: passw0rd
+    mdns:
+      address: 0.0.0.0
+      port: 5354
     message_queue:
       engine: rabbitmq
       members: