Update offline states

Include next:
* Update docker repo
* switch ubuntu to mirror.mcp and new repo fromat
* Add install packages on vswitch node as a firt step

Change-Id: Ie724d5762d4b74c1faba61a03ad4d958d63fdf1d
diff --git a/tcp_tests/templates/virtual-offline-pike-ovs-dpdk/vswitch-config.yaml b/tcp_tests/templates/virtual-offline-pike-ovs-dpdk/vswitch-config.yaml
index 705e9be..df9fd73 100644
--- a/tcp_tests/templates/virtual-offline-pike-ovs-dpdk/vswitch-config.yaml
+++ b/tcp_tests/templates/virtual-offline-pike-ovs-dpdk/vswitch-config.yaml
@@ -1,6 +1,21 @@
+{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'proposed') %}
+{% set OPENSTACK_PIKE_REPOSITORY = os_env('OPENSTACK_PIKE_REPOSITORY', "deb [arch=amd64] http://mirror.mirantis.local.test/" + REPOSITORY_SUITE + "/openstack-pike/xenial/ xenial main") %}
+{% set UBUNTU_KEY_SERVER = os_env('UBUNTU_KEY_SERVER', 'keyserver.ubuntu.com') %}
+{% set UBUNTU_KEY_ID = os_env('UBUNTU_KEY_ID', '0E08A149DE57BFBE') %}
+
 
 {%- macro MACRO_CONFIGURE_VSWITCH(NODE_NAME, IP) %}
 {#################################################}
+- description: 'Enable openstack repo for needed packages '
+  cmd: |
+    apt-key adv --keyserver "{{UBUNTU_KEY_SERVER}}" --recv-keys "{{ UBUNTU_KEY_ID}}"
+    echo "{{ OPENSTACK_PIKE_REPOSITORY }}" > /etc/apt/sources.list.d/openstack.list
+    eatmydata apt-get clean;
+    apt-get update;
+    sync;
+  node_name: {{ NODE_NAME }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
 
 - description: 'Install openvswitch-vtep package and configure it'
   cmd: |
@@ -8,9 +23,9 @@
     ifconfig ens4 up
 
     apt-get update
-    apt-get -y install openvswitch-switch
+    apt-get -y install openvswitch-switch --allow-unauthenticated
     service openvswitch-switch stop
-    apt-get -y install openvswitch-vtep bridge-utils
+    apt-get -y install openvswitch-vtep bridge-utils --allow-unauthenticated
 
     ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
     ovsdb-tool create /etc/openvswitch/vswitch.db /usr/share/openvswitch/vswitch.ovsschema
@@ -67,7 +82,13 @@
   skip_fail: false
 
 - description: 'Refresh pillar data after L2GW enablement'
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar;  sleep 15
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: 'Sync all'
+  cmd:  salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && sleep 5
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
@@ -75,7 +96,7 @@
 - description: 'Check L2GW is enabled'
   cmd: salt 'gtw01*' pillar.get neutron:gateway:l2gw:enabled | grep True
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 3, delay: 5}
   skip_fail: false
 
 {%- endmacro %}