Add workaround proposed in PROD-10894
diff --git a/tcp_tests/helpers/env_config.py b/tcp_tests/helpers/env_config.py
index 84ed286..48749c9 100644
--- a/tcp_tests/helpers/env_config.py
+++ b/tcp_tests/helpers/env_config.py
@@ -257,11 +257,11 @@
class EnvironmentConfig(object):
def __init__(self):
super(EnvironmentConfig, self).__init__()
- self._config = None
+ self.__config = None
@property
def config(self):
- return self._config
+ return self.__config
@config.setter
def config(self, config):
@@ -269,11 +269,11 @@
:param config: dict
"""
- self._config = fix_devops_config(config)
+ self.__config = fix_devops_config(config)
def __getitem__(self, key):
- if self._config is not None:
- conf = self._config['template']['devops_settings']
+ if self.__config is not None:
+ conf = self.__config['template']['devops_settings']
return copy.deepcopy(conf.get(key, None))
else:
return None
@@ -287,7 +287,7 @@
"""
if self.config is None:
raise exceptions.DevopsConfigIsNone()
- conf = self._config['template']['devops_settings']
+ conf = self.__config['template']['devops_settings']
set_value_for_dict_by_keypath(conf, keypath, value)
def save(self, filename):
@@ -295,12 +295,12 @@
:param filename: string
"""
- if self._config is None:
+ if self.__config is None:
raise exceptions.DevopsConfigIsNone()
with open(filename, 'w') as f:
f.write(
yaml.dump(
- self._config, default_flow_style=False
+ self.__config, default_flow_style=False
)
)
diff --git a/tcp_tests/managers/envmanager_devops.py b/tcp_tests/managers/envmanager_devops.py
index 21dd3c9..355d6f6 100644
--- a/tcp_tests/managers/envmanager_devops.py
+++ b/tcp_tests/managers/envmanager_devops.py
@@ -44,7 +44,7 @@
descriebe environment status.
"""
self.__devops_config = env_config.EnvironmentConfig()
- self._env = None
+ self.__env = None
self.__config = config
if config.hardware.conf_path is not None:
@@ -103,7 +103,7 @@
:rtype: dict
"""
result = {}
- for node in self._env.get_nodes(role__in=ext.UNDERLAY_NODE_ROLES):
+ for node in self.__env.get_nodes(role__in=ext.UNDERLAY_NODE_ROLES):
lvm = filter(lambda x: x.volume.name == 'lvm', node.disk_devices)
if len(lvm) == 0:
continue
@@ -130,10 +130,10 @@
:param name: string
"""
- self._env = models.Environment.get(name=name)
+ self.__env = models.Environment.get(name=name)
def _get_default_node_group(self):
- return self._env.get_group(name='default')
+ return self.__env.get_group(name='default')
def _get_network_pool(self, net_pool_name):
default_node_group = self._get_default_node_group()
@@ -149,7 +149,7 @@
raise Exception("No roles specified for the environment!")
config_ssh = []
- for d_node in self._env.get_nodes(role__in=roles):
+ for d_node in self.__env.get_nodes(role__in=roles):
ssh_data = {
'node_name': d_node.name,
'roles': [d_node.role],
@@ -176,16 +176,16 @@
self.__config.hardware.current_snapshot = name
LOG.info("Set current snapshot in config to '{0}'".format(
self.__config.hardware.current_snapshot))
- if self._env is not None:
+ if self.__env is not None:
LOG.info('trying to suspend ....')
- self._env.suspend()
+ self.__env.suspend()
LOG.info('trying to snapshot ....')
- self._env.snapshot(name, description=description, force=True)
+ self.__env.snapshot(name, description=description, force=True)
LOG.info('trying to resume ....')
- self._env.resume()
+ self.__env.resume()
else:
raise exceptions.EnvironmentIsNotSet()
- settings_oslo.save_config(self.__config, name, self._env.name)
+ settings_oslo.save_config(self.__config, name, self.__env.name)
if settings.VIRTUAL_ENV:
venv_msg = "source {0}/bin/activate;\n".format(
@@ -209,7 +209,7 @@
def _get_snapshot_config_name(self, snapshot_name):
"""Get config name for the environment"""
- env_name = self._env.name
+ env_name = self.__env.name
if env_name is None:
env_name = 'config'
test_config_path = os.path.join(
@@ -227,10 +227,10 @@
:param name: string
"""
LOG.info("Reverting from snapshot named '{0}'".format(name))
- if self._env is not None:
- self._env.revert(name=name)
+ if self.__env is not None:
+ self.__env.revert(name=name)
LOG.info("Resuming environment after revert")
- self._env.resume()
+ self.__env.resume()
else:
raise exceptions.EnvironmentIsNotSet()
@@ -261,7 +261,7 @@
LOG.error('Environment name is not set!')
raise exceptions.EnvironmentNameIsNotSet()
try:
- self._env = models.Environment.create_environment(
+ self.__env = models.Environment.create_environment(
settings.config
)
except db.IntegrityError:
@@ -270,7 +270,7 @@
' in template.'.format(env_name)
)
raise
- self._env.define()
+ self.__env.define()
LOG.info(
'Environment "{0}" created'.format(env_name)
)
@@ -279,11 +279,11 @@
"""Method for start environment
"""
- if self._env is None:
+ if self.__env is None:
raise exceptions.EnvironmentIsNotSet()
- self._env.start()
- LOG.info('Environment "{0}" started'.format(self._env.name))
- for node in self._env.get_nodes(role__in=ext.UNDERLAY_NODE_ROLES):
+ self.__env.start()
+ LOG.info('Environment "{0}" started'.format(self.__env.name))
+ for node in self.__env.get_nodes(role__in=ext.UNDERLAY_NODE_ROLES):
LOG.info("Waiting for SSH on node '{}...'".format(node.name))
timeout = 480
helpers.wait(
@@ -293,28 +293,28 @@
node.name, timeout
)
)
- LOG.info('Environment "{0}" ready'.format(self._env.name))
+ LOG.info('Environment "{0}" ready'.format(self.__env.name))
def resume(self):
"""Resume environment"""
- if self._env is None:
+ if self.__env is None:
raise exceptions.EnvironmentIsNotSet()
- self._env.resume()
+ self.__env.resume()
def suspend(self):
"""Suspend environment"""
- if self._env is None:
+ if self.__env is None:
raise exceptions.EnvironmentIsNotSet()
- self._env.suspend()
+ self.__env.suspend()
def stop(self):
"""Stop environment"""
- if self._env is None:
+ if self.__env is None:
raise exceptions.EnvironmentIsNotSet()
- self._env.destroy()
+ self.__env.destroy()
def has_snapshot(self, name):
- return self._env.has_snapshot(name)
+ return self.__env.has_snapshot(name)
def has_snapshot_config(self, name):
test_config_path = self._get_snapshot_config_name(name)
@@ -325,7 +325,7 @@
"""
LOG.debug("Deleting environment")
- self._env.erase()
+ self.__env.erase()
def __get_nodes_by_role(self, node_role):
"""Get node by given role name
@@ -334,7 +334,7 @@
:rtype: devops.models.Node
"""
LOG.debug('Trying to get nodes by role {0}'.format(node_role))
- return self._env.get_nodes(role=node_role)
+ return self.__env.get_nodes(role=node_role)
@property
def master_nodes(self):
@@ -370,7 +370,7 @@
@property
def nameserver(self):
- return self._env.router(ext.NETWORK_TYPE.admin)
+ return self.__env.router(ext.NETWORK_TYPE.admin)
def set_dns_config(self):
# Set local nameserver to use by default
@@ -381,5 +381,5 @@
def set_address_pools_config(self):
"""Store address pools CIDRs in config object"""
- for ap in self._env.get_address_pools():
+ for ap in self.__env.get_address_pools():
self.__config.underlay.address_pools[ap.name] = ap.net
diff --git a/tcp_tests/managers/envmanager_empty.py b/tcp_tests/managers/envmanager_empty.py
index 702d723..b9ab8e1 100644
--- a/tcp_tests/managers/envmanager_empty.py
+++ b/tcp_tests/managers/envmanager_empty.py
@@ -18,7 +18,7 @@
class EnvironmentManagerEmpty(object):
"""Class-helper for creating VMs via devops environments"""
- _config = None
+ __config = None
def __init__(self, config=None):
"""Initializing class instance and create the environment
@@ -28,12 +28,12 @@
:param config.hardware.current_snapshot: name of the snapshot that
descriebe environment status.
"""
- self._config = config
+ self.__config = config
def lvm_storages(self):
"""Returns data of lvm_storages on nodes in environment
- It's expected that data of self._config.lvm_storages will be
+ It's expected that data of self.__config.lvm_storages will be
like this:
{
"node1": {
@@ -48,7 +48,7 @@
}
:rtype: dict
"""
- return self._config.underlay.lvm
+ return self.__config.underlay.lvm
def get_ssh_data(self, roles=None):
raise Exception("EnvironmentManagerEmpty doesn't have SSH details. "
@@ -60,24 +60,24 @@
- Store the state of the environment <name> to the 'config' object
- Save 'config' object to a file 'config_<name>.ini'
"""
- self._config.hardware.current_snapshot = name
- settings_oslo.save_config(self._config, name)
+ self.__config.hardware.current_snapshot = name
+ settings_oslo.save_config(self.__config, name)
def revert_snapshot(self, name):
"""Check the current state <name> of the environment
- Check that the <name> matches the current state of the environment
- that is stored in the 'self._config.hardware.current_snapshot'
+ that is stored in the 'self.__config.hardware.current_snapshot'
- Try to reload 'config' object from a file 'config_<name>.ini'
If the file not found, then pass with defaults.
- Set <name> as the current state of the environment after reload
:param name: string
"""
- if self._config.hardware.current_snapshot != name:
+ if self.__config.hardware.current_snapshot != name:
raise Exception(
"EnvironmentManagerEmpty cannot revert nodes from {} to {}"
- .format(self._config.hardware.current_snapshot, name))
+ .format(self.__config.hardware.current_snapshot, name))
def start(self):
"""Start environment"""
@@ -96,10 +96,10 @@
pass
def has_snapshot(self, name):
- return self._config.hardware.current_snapshot == name
+ return self.__config.hardware.current_snapshot == name
def has_snapshot_config(self, name):
- return self._config.hardware.current_snapshot == name
+ return self.__config.hardware.current_snapshot == name
def delete_environment(self):
"""Delete environment"""
diff --git a/tcp_tests/managers/opencontrail_manager.py b/tcp_tests/managers/opencontrail_manager.py
index 1bb7f43..fb4e982 100644
--- a/tcp_tests/managers/opencontrail_manager.py
+++ b/tcp_tests/managers/opencontrail_manager.py
@@ -20,12 +20,12 @@
__config = None
__underlay = None
- _openstack_actions = None
+ __openstack_actions = None
def __init__(self, config, underlay, openstack_deployed):
self.__config = config
self.__underlay = underlay
- self._openstack_actions = openstack_deployed
+ self.__openstack_actions = openstack_deployed
super(OpenContrailManager, self).__init__(
config=config, underlay=underlay)
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 4a83e12..304ff75 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -39,86 +39,62 @@
def __init__(self, config, underlay, host=None, port='6969'):
self.__config = config
self.__underlay = underlay
- self._port = port
- self._host = host
- self._api = None
- self._user = settings.SALT_USER
- self._password = settings.SALT_PASSWORD
- self._salt = self
+ self.__port = port
+ self.__host = host
+ self.__api = None
+ self.__user = settings.SALT_USER
+ self.__password = settings.SALT_PASSWORD
super(SaltManager, self).__init__(config=config, underlay=underlay)
def install(self, commands):
- if commands[0].get('do'):
- self.install2(commands)
- else:
- self.install1(commands)
+ #if self.__config.salt.salt_master_host == '0.0.0.0':
+ # # Temporary workaround. Underlay should be extended with roles
+ # salt_nodes = self.__underlay.node_names()
+ # self.__config.salt.salt_master_host = \
+ # self.__underlay.host_by_node_name(salt_nodes[0])
- def install1(self, commands):
- if self.__config.salt.salt_master_host == '0.0.0.0':
- # Temporary workaround. Underlay should be extended with roles
- salt_nodes = self.__underlay.node_names()
- self.__config.salt.salt_master_host = \
- self.__underlay.host_by_node_name(salt_nodes[0])
-
- # self.__underlay.execute_commands(commands=commands,
- # label="Install and configure salt")
- self.execute_commands(commands=commands,
- label="Install and configure salt")
-
- def install2(self, commands):
- if self.__config.salt.salt_master_host == '0.0.0.0':
- # Temporary workaround. Underlay should be extended with roles
- salt_nodes = self.__underlay.node_names()
- self.__config.salt.salt_master_host = \
- self.__underlay.host_by_node_name(salt_nodes[0])
-
- # self.run_commands(commands=commands,
- # label="Install and configure salt")
self.execute_commands(commands=commands,
label="Install and configure salt")
@property
def port(self):
- return self._port
+ return self.__port
@property
def host(self):
- if self._host:
- return self._host
- elif self.__config.salt.salt_master_host == '0.0.0.0':
- # Temporary workaround. Underlay should be extended with roles
- salt_nodes = self.__underlay.node_names()
- self.__config.salt.salt_master_host = \
- self.__underlay.host_by_node_name(salt_nodes[0])
-
- return self.__config.salt.salt_master_host
+ if self.__host:
+ return self.__host
+ else:
+ #TODO(ddmitriev): consider to add a check and raise
+ # exception if 'salt_master_host' is not initialized.
+ return self.__config.salt.salt_master_host
@property
def api(self):
def login():
LOG.info("Authentication in Salt API")
- self._api.login(
- username=self._user,
- password=self._password,
+ self.__api.login(
+ username=self.__user,
+ password=self.__password,
eauth='pam')
return datetime.now()
- if self._api:
+ if self.__api:
if (datetime.now() - self.__session_start).seconds < 5 * 60:
- return self._api
+ return self.__api
else:
# FIXXME: Change to debug
LOG.info("Session's expired")
self.__session_start = login()
- return self._api
+ return self.__api
- LOG.info("Connect to Salt API")
url = "http://{host}:{port}".format(
host=self.host, port=self.port)
- self._api = Pepper(url)
+ LOG.info("Connecting to Salt API {0}".format(url))
+ self.__api = Pepper(url)
self.__session_start = login()
- return self._api
+ return self.__api
def local(self, tgt, fun, args=None, kwargs=None):
return self.api.local(tgt, fun, args, kwargs, expr_form='compound')
diff --git a/tcp_tests/settings_oslo.py b/tcp_tests/settings_oslo.py
index b11e02b..609fd69 100644
--- a/tcp_tests/settings_oslo.py
+++ b/tcp_tests/settings_oslo.py
@@ -94,6 +94,8 @@
salt_opts = [
ct.Cfg('salt_master_host', ct.IPAddress(),
help="", default='0.0.0.0'),
+ ct.Cfg('salt_master_port', ct.String(),
+ help="", default='6969'),
]
common_services_deploy_opts = [
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml b/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
index 751da3f..ad91de5 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
index 405beab..0772a15 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
diff --git a/tcp_tests/templates/virtual-mcp11-dvr/salt.yaml b/tcp_tests/templates/virtual-mcp11-dvr/salt.yaml
index f10b334..ec519c3 100644
--- a/tcp_tests/templates/virtual-mcp11-dvr/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp11-dvr/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp11-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp11-dvr/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
diff --git a/tcp_tests/templates/virtual-mcp11-ovs-dpdk/salt.yaml b/tcp_tests/templates/virtual-mcp11-ovs-dpdk/salt.yaml
index 039338d..e4178e2 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs-dpdk/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs-dpdk/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp11-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp11-ovs-dpdk/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
diff --git a/tcp_tests/templates/virtual-mcp11-ovs.new/salt.yaml b/tcp_tests/templates/virtual-mcp11-ovs.new/salt.yaml
index adadd79..98de9a6 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs.new/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs.new/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp11-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp11-ovs/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
diff --git a/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml b/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
index adadd79..98de9a6 100644
--- a/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp11-ovs/salt.yaml
@@ -1,4 +1,5 @@
{% from 'virtual-mcp11-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'virtual-mcp11-ovs/underlay.yaml' import REPOSITORY_SUITE with context %}
{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
@@ -112,6 +113,8 @@
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+ find /srv/salt/reclass/ -type f -exec sed -i 's/apt_mk_version:.*/apt_mk_version: {{ REPOSITORY_SUITE }}/g' {} +
+
# Disable checkouting the model from remote repository
cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
# local storage
@@ -226,25 +229,19 @@
retry: {count: 1, delay: 1}
skip_fail: false
-#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
-# cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-# -C 'I@salt:master' state.sls reclass;
-# salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
-# node_name: {{ HOSTNAME_CFG01 }}
-# retry: {count: 1, delay: 5}
-# skip_fail: true
-
-
-- description: Run 'salt' formula on cfg01
+- description: Run 'salt.master' formula on cfg01
cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@salt:master' state.sls salt.master.service;
- salt-call --hard-crash --state-output=mixed --state-verbose=False
- state.sls salt.master,salt.api,salt.minion.ca;
- systemctl restart salt-minion;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}
- skip_fail: true
+ skip_fail: false
+- description: Run 'salt' formula on cfg01 with workaround proposed in PROD-10894
+ cmd: salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt;
+ systemctl restart salt-minion;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 2, delay: 5}
+ skip_fail: false
- description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
cmd: salt --hard-crash --state-output=mixed --state-verbose=False