[virtual-mcp11-k8s-contrail] Add multiple workarounds

- Add workaround for keepalived
https://mirantis.jira.com/browse/PROD-12798
- Fix regex for linklocal workaround
- Set retry count for 2 for opencontrail installation
on computes
- Fix cmd for time sync

Change-Id: I0d8417e60bbc1664793091f550b46ff23a86178f
Reviewed-on: https://review.gerrithub.io/368592
Reviewed-by: <vrovachev@mirantis.com>
Reviewed-by: Tatyanka Leontovich <tleontovich@mirantis.com>
Tested-by: Tatyanka Leontovich <tleontovich@mirantis.com>
diff --git a/tcp_tests/templates/virtual-mcp11-k8s-contrail/k8s.yaml b/tcp_tests/templates/virtual-mcp11-k8s-contrail/k8s.yaml
index ea906cf..f72e1e9 100644
--- a/tcp_tests/templates/virtual-mcp11-k8s-contrail/k8s.yaml
+++ b/tcp_tests/templates/virtual-mcp11-k8s-contrail/k8s.yaml
@@ -3,15 +3,15 @@
 # Change environment configuration before deploy
 
 - description: Add workaround for linklocal incorrect installation
-  cmd: perl -pi -e 's/ipf_addresses:.*/ipf_addresses: \${_param:cluster_node01_address}/g'
-  /srv/salt/reclass/classes/system/opencontrail/client/resource/k8s_api.yml
+  cmd: sed -i "s/ipf_addresses:.*/ipf_addresses:\ \${_param:cluster_node01_address}/g"
+    /srv/salt/reclass/classes/system/opencontrail/client/resource/k8s_api.yml
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 1}
   skip_fail: false
 
 - description: Sync time on nodes
-  cmd: salt '*' cmd.run 'service ntp stop; ntpd -gq ;
-  service ntp start; ntp-wait || exit 1'
+  cmd: salt '*' cmd.run "service ntp stop; ntpd -gq ;
+    service ntp start; ntp-wait || exit 1"
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 2, delay: 1}
   skip_fail: false
@@ -98,6 +98,13 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@opencontrail:control' service.restart 'keepalived'
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 # OpenContrail vrouters
 - description: Install Opencontrail client
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
@@ -110,14 +117,14 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Install Opencontrail on computes
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@opencontrail:compute' state.sls 'opencontrail'
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Test Opencontrail
@@ -177,6 +184,13 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@kubernetes:master' service.restart 'keepalived'
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Run Kubernetes master without setup
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
      -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup