Rework interface roles to match cookiecutter template options

Change-Id: I26ddff3af840b805319ba2805e1cc80af22a5735
Reviewed-on: https://review.gerrithub.io/377228
Reviewed-by: Dennis Dmitriev <dis.xcom@gmail.com>
Tested-by: Dennis Dmitriev <dis.xcom@gmail.com>
diff --git a/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/salt.yaml b/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/salt.yaml
index 1b34002..478e9dd 100644
--- a/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/salt.yaml
+++ b/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/salt.yaml
@@ -25,12 +25,17 @@
     mkdir -p /srv/salt/reclass/classes/service/
     mkdir -p /srv/salt/reclass/nodes/
 
-    sed -i 's/cluster_name:.*/cluster_name: {{ LAB_CONFIG_NAME }}/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/cluster_domain:.*/cluster_domain: {{ DOMAIN_NAME }}/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
+    {%- set CONTEXT_PATH = '/tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml' %}
+
+    # Override some context parameters
+    sed -i 's/cluster_name:.*/cluster_name: {{ LAB_CONFIG_NAME }}/g' {{ CONTEXT_PATH }}
+    sed -i 's/cluster_domain:.*/cluster_domain: {{ DOMAIN_NAME }}/g' {{ CONTEXT_PATH }}
+    sed -i 's/control_vlan:.*/control_vlan: \"2416\"/g' {{ CONTEXT_PATH }}
+    sed -i 's/tenant_vlan:.*/tenant_vlan: \"2417\"/g' {{ CONTEXT_PATH }}
 
     # Temporary workaround (with hardcoded address .90 -> .15) of bug https://mirantis.jira.com/browse/PROD-14377
-    sed -i 's/salt_master_address:.*/salt_master_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.15/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/salt_master_management_address:.*/salt_master_management_address: {{ SHARED.IPV4_NET_ADMIN_PREFIX }}.15/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
+    sed -i 's/salt_master_address:.*/salt_master_address: {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.15/g' {{ CONTEXT_PATH }}
+    sed -i 's/salt_master_management_address:.*/salt_master_management_address: {{ SHARED.IPV4_NET_ADMIN_PREFIX }}.15/g' {{ CONTEXT_PATH }}
 
     # Replace firstly to an intermediate value to avoid intersection between
     # already replaced and replacing networks.
@@ -38,19 +43,19 @@
     # 192.168.10 -> 10.16.0 (generated network for admin)
     # 10.16.0 -> <external network>
     # So let's replace constant networks to the keywords, and then keywords to the desired networks.
-    sed -i 's/10\.167\.5/==IPV4_NET_ADMIN_PREFIX==/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/10\.167\.4/==IPV4_NET_CONTROL_PREFIX==/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/10\.167\.6/==IPV4_NET_TENANT_PREFIX==/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/172\.17\.16\./==IPV4_NET_EXTERNAL_PREFIX==/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
+    sed -i 's/10\.167\.5/==IPV4_NET_ADMIN_PREFIX==/g' {{ CONTEXT_PATH }}
+    sed -i 's/10\.167\.4/==IPV4_NET_CONTROL_PREFIX==/g' {{ CONTEXT_PATH }}
+    sed -i 's/10\.167\.6/==IPV4_NET_TENANT_PREFIX==/g' {{ CONTEXT_PATH }}
+    sed -i 's/172\.17\.16\./==IPV4_NET_EXTERNAL_PREFIX==/g' {{ CONTEXT_PATH }}
 
-    sed -i 's/==IPV4_NET_ADMIN_PREFIX==/{{ SHARED.IPV4_NET_ADMIN_PREFIX }}/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/==IPV4_NET_CONTROL_PREFIX==/{{ SHARED.IPV4_NET_CONTROL_PREFIX }}/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ SHARED.IPV4_NET_TENANT_PREFIX }}/g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
-    sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ SHARED.IPV4_NET_EXTERNAL_PREFIX }}./g' /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml
+    sed -i 's/==IPV4_NET_ADMIN_PREFIX==/{{ SHARED.IPV4_NET_ADMIN_PREFIX }}/g' {{ CONTEXT_PATH }}
+    sed -i 's/==IPV4_NET_CONTROL_PREFIX==/{{ SHARED.IPV4_NET_CONTROL_PREFIX }}/g' {{ CONTEXT_PATH }}
+    sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ SHARED.IPV4_NET_TENANT_PREFIX }}/g' {{ CONTEXT_PATH }}
+    sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ SHARED.IPV4_NET_EXTERNAL_PREFIX }}./g' {{ CONTEXT_PATH }}
 
     for i in $(ls /tmp/cookiecutter-templates/cluster_product/); do
       cookiecutter /tmp/cookiecutter-templates/cluster_product/$i \
-        --config-file /tmp/cookiecutter-templates/contexts/openstack_ovs_dvr_vxlan.yml \
+        --config-file {{ CONTEXT_PATH }} \
         --output-dir /srv/salt/reclass/classes/cluster/ \
         --no-input -f;
     done
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index 850df92..bc9a14e 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -436,7 +436,7 @@
   cmd: salt -C "I@linux:network:interface:*:type:bond" cmd.run 'modprobe bonding'
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
-  skip_fail: false
+  skip_fail: true
 
 - description: '*Workaround* install bridge-utils before running linux formula'
   # The formula removes default route and then tries to install the package, fails.