Adding ability to operate with interface parameter

Since NTP uses UDP it listen for ports even in client mode.
This patch adds the ability to manage interfaces for listening from
client pillar also.

Added support for enabling mode7 from client pillar

Prod-related: #PROD-28867 (PROD:28867)
Prod-related: #PROD-28576 (PROD:28576)

Change-Id: I67b4a07dc47e24bf69c180a3b5e3d93dd1cf2808
diff --git a/README.rst b/README.rst
index 2f844a2..1ef273e 100644
--- a/README.rst
+++ b/README.rst
@@ -59,6 +59,24 @@
               server: ntp.nic.cz
               key_id: 2
 
+* The NTP client definition enabling the ``listen`` and ``ignore`` actions on
+  specific addresses:
+
+  .. code-block:: yaml
+
+      ntp:
+        client:
+          interface:
+            1:
+              value: wildcard
+              action: ignore
+            2:
+              value: ::1
+              action: listen
+            3:
+              value: 192.168.31.1
+              action: listen
+
 * The NTP server with MD5 auth configuration:
 
   .. code-block:: yaml
@@ -127,6 +145,7 @@
 
       ntp:
         server:
+          interface:
             1:
               value: wildcard
               action: ignore
diff --git a/ntp/files/ntp.conf b/ntp/files/ntp.conf
index e2cbe14..1b7043c 100644
--- a/ntp/files/ntp.conf
+++ b/ntp/files/ntp.conf
@@ -25,6 +25,20 @@
 {%- endfor %}
 {%- endif -%}
 
+{%- if client.interface is defined and client.interface != None %}
+
+# Interface control
+{%- for _, iface in client.interface.items() %}
+interface {{ iface.action }} {{ iface.value }}
+{%- endfor -%}
+{%- endif -%}
+
+{%- if client.get('mode7', False) %}
+
+# mode7 is required for collectd monitoring
+enable mode7
+{%- endif %}
+
 {%- endif -%}
 
 {%- if server.get('enabled', False) %}
@@ -34,6 +48,8 @@
 {%- endif %}
 
 {%- if server.interface is defined and server.interface != None %}
+
+# Interface control
 {%- for _, iface in server.interface.items() %}
 interface {{ iface.action }} {{ iface.value }}
 {%- endfor -%}
@@ -86,8 +102,9 @@
 restrict 127.0.0.1
 restrict ::1
 
+{%- if server.get('mode7', False) %}
+
 # mode7 is required for collectd monitoring
-{%- if server.get('mode7') %}
 enable mode7
 {%- endif %}