Align static template to runtestmanager

* Add gtw 122 for external net for offline static
* remove post test resources creation in offline static

* Add docker repo for gtw node on ovs and ctl01 on contral
  templates, as for tempest run we need the docker
  and better install it from mirantis repo then from unpredictable source

Change-Id: I9feee9d4b91d840c07002e97fe0f87b0cfcfadc0
diff --git a/tcp_tests/templates/virtual-offline-ssl/openstack.yaml b/tcp_tests/templates/virtual-offline-ssl/openstack.yaml
index e84ed31..02ef0a3 100644
--- a/tcp_tests/templates/virtual-offline-ssl/openstack.yaml
+++ b/tcp_tests/templates/virtual-offline-ssl/openstack.yaml
@@ -240,181 +240,9 @@
   retry: {count: 10, delay: 30}
   skip_fail: false
 
-# Configure cinder-volume salt-call
-#- description: Set disks 01
-#  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-#  node_name: {{ HOSTNAME_CTL01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Set disks 02
-#  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-#  node_name: {{ HOSTNAME_CTL02 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Set disks 03
-#  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-#  node_name: {{ HOSTNAME_CTL03 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Create partitions 01
-#  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-#  node_name: {{ HOSTNAME_CTL01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Create partitions 02
-#  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-#  node_name: {{ HOSTNAME_CTL02 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Create partitions 03
-#  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-#  node_name: {{ HOSTNAME_CTL03 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: create volume_group
-#  cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Install cinder-volume
-#  cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Install crudini
-#  cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Temporary WR set enabled backends value 01
-#  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-#  node_name: {{ HOSTNAME_CTL01 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Temporary WR set enabled backends value 02
-#  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-#  node_name: {{ HOSTNAME_CTL02 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Temporary WR set enabled backends value 03
-#  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-#  node_name: {{ HOSTNAME_CTL03 }}
-#  retry: {count: 1, delay: 30}
-#  skip_fail: false
-#
-#- description: Restart cinder volume
-#  cmd: |
-#    salt -C 'I@cinder:controller' service.restart cinder-volume;
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 2, delay: 5}
-#  skip_fail: false
-#
-- description: Upload cirros image on ctl01
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 2, delay: 30}
-  skip_fail: false
-
-- description: Create net04_external
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create subnet_external
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create net04
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron net-create net04'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create subnet_net04
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create router
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron router-create net04_router01'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Set geteway
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description:  Add interface
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
 - description: sync time
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
     'service ntp stop; ntpd -gq;  service ntp start'
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 30}
   skip_fail: false
-
-
-- description: Enable local docker repo
-  cmd: |
-    set -e;
-    echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list;
-    apt-get clean; apt-get update;
-  node_name: {{ HOSTNAME_GTW01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Install docker-ce on gtw
-  cmd: salt-call cmd.run 'apt-get install docker-ce -y'
-  node_name: {{ HOSTNAME_GTW01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Enable forward policy on gtw
-  cmd: |
-    set -e;
-    iptables --policy FORWARD ACCEPT;
-  node_name: {{ HOSTNAME_GTW01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: create rc file on cfg
-  cmd: scp ctl01:/root/keystonercv3 /root
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Copy rc file
-  cmd: scp /root/keystonercv3 gtw01:/root
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
diff --git a/tcp_tests/templates/virtual-offline-ssl/salt.yaml b/tcp_tests/templates/virtual-offline-ssl/salt.yaml
index 22cf917..9898bec 100644
--- a/tcp_tests/templates/virtual-offline-ssl/salt.yaml
+++ b/tcp_tests/templates/virtual-offline-ssl/salt.yaml
@@ -58,6 +58,18 @@
   retry: {count: 1, delay: 10}
   skip_fail: false
 
+- description: '*Workaround* to remove apt key until migrate on CC'
+  cmd: salt-key -d apt01.virtual-offline-pike-ovs-dpdk  -y
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 1}
+  skip_fail: true
+
+- description: '*Workaround* stop minion on apt like proxy node'
+  cmd: systemctl stop salt-minion.service
+  node_name: {{ HOSTNAME_APT01 }}
+  retry: {count: 1, delay: 1}
+  skip_fail: true
+
 {{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='"linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon" "prometheus" "telegraf" "elasticsearch" "powerdns" "fluentd" "backupninja" "watchdog" "dogtag" "runtest" "manila" "auditd" "logrotate" "gnocchi"') }}
 
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
@@ -74,9 +86,9 @@
   retry: {count: 1, delay: 10}
   skip_fail: false
 
-- description: Workaround to avoid reboot cmp nodes bring OVS interfaces UP
-  cmd: |
-    salt 'cmp*' cmd.run "ifup br-mesh";
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 10}
-  skip_fail: false
+#- description: Workaround to avoid reboot cmp nodes bring OVS interfaces UP
+#  cmd: |
+#    salt 'cmp*' cmd.run "ifup br-mesh";
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 10}
+#  skip_fail: false
diff --git a/tcp_tests/templates/virtual-offline-ssl/underlay.yaml b/tcp_tests/templates/virtual-offline-ssl/underlay.yaml
index 6277d6a..84a1629 100644
--- a/tcp_tests/templates/virtual-offline-ssl/underlay.yaml
+++ b/tcp_tests/templates/virtual-offline-ssl/underlay.yaml
@@ -60,6 +60,7 @@
         net: {{ os_env('ADMIN_ADDRESS_POOL01', '10.70.0.0/16:24') }}
         params:
           ip_reserved:
+            gateway: +122
             l2_network_device: +1
             default_{{ HOSTNAME_APT01 }}: +122
             default_{{ HOSTNAME_CFG01 }}: +90
@@ -102,6 +103,7 @@
         net: {{ os_env('EXTERNAL_ADDRESS_POOL01', '10.90.0.0/16:24') }}
         params:
           ip_reserved:
+            gateway: +1
             l2_network_device: +1
             default_{{ HOSTNAME_APT01 }}: +122
             default_{{ HOSTNAME_CFG01 }}: +100