Enable DNS servers with OVS port intefaces
The template for ovs_port in linux formula do not
have nameservers option so the server become without
any nameservers configuration.
Add parameter for name servers to ovs_port type
interface template.
PROD-31606
Change-Id: If44c7ca3f12069ecd5f68069ce89fa9eb3ee42b9
diff --git a/README.rst b/README.rst
index c315aee..4cc43a3 100644
--- a/README.rst
+++ b/README.rst
@@ -1699,6 +1699,28 @@
type: ovs_port
ovs_bridge: br-ens7
bridge: br-ens7
+ ens6:
+ enabled: true
+ proto: manual
+ type: eth
+ ovs_bridge: br-ctl
+ br-ctl:
+ enabled: true
+ type: ovs_bridge
+ internal-br-ctl-port:
+ enabled: true
+ proto: static
+ address: 172.172.0.10
+ netmask: 255.255.0.0
+ name_servers:
+ - 8.8.8.8
+ - 172.172.172.172
+ name: port-br-ctl
+ bridge: br-ctl
+ ovs_type: ovs_port
+ type: ovs_port
+ port_type: internal
+ mtu: 65000
Debian manual proto interfaces
diff --git a/linux/files/ovs_port b/linux/files/ovs_port
index 20c256c..8377e48 100644
--- a/linux/files/ovs_port
+++ b/linux/files/ovs_port
@@ -20,3 +20,6 @@
{%- if port.hwaddress is defined %}
hwaddress {{ port.hwaddress }}
{%- endif %}
+{%- if port.name_servers is defined %}
+dns-nameservers {{ port.name_servers|join(' ') }}
+{%- endif %}
diff --git a/tests/pillar/network_openvswitch.sls b/tests/pillar/network_openvswitch.sls
index 80c482a..dae30e7 100644
--- a/tests/pillar/network_openvswitch.sls
+++ b/tests/pillar/network_openvswitch.sls
@@ -48,3 +48,25 @@
type: ovs_port
ovs_bridge: br-ens0
bridge: br-ens0
+ ens6:
+ enabled: true
+ proto: manual
+ type: eth
+ ovs_bridge: br-ctl
+ br-ctl:
+ enabled: true
+ type: ovs_bridge
+ internal-br-ctl-port:
+ enabled: true
+ proto: static
+ address: 10.10.0.10
+ netmask: 255.255.255.0
+ name_servers:
+ - 8.8.8.8
+ - 172.172.172.172
+ name: port-br-ctl
+ bridge: br-ctl
+ ovs_type: ovs_port
+ type: ovs_port
+ port_type: internal
+ mtu: 65000