Refactor reclass cloning
SALT_MODELS_REF_CHANGE SALT_MODELS_COMMIT are both exclusive. If
SALT_MODELS_REF_CHANGE is specified then it means we don't need to do a
checkout to special commit. SALT_MODELS_COMMIT is specified but
SALT_MODELS_REF_CHANGE is not, then we need to checkout that commit.
* This change refactor the logic across all templates.
* This change introduce for loop for SALT_MODELS_REF_CHANGE. Several
commits can be specified using space as separator. Here is an example
export SALT_MODELS_REF_CHANGE='refs/changes/12/8412/2 refs/changes/58/8458/1'
All commits should not have any conflicts. In case of conflicts create
dependant commits and use top one.
* The 'cmd:' for the step "Clone reclass models with submodules" was moved
to shared-salt.yaml and included to other templates as a jinja2 'macro'.
* SALT_MODELS_SYSTEM_COMMIT now works as expected. If not specified then
will be used the 'system' commit specified in the cluster model
submodule.
Doc-Impact
Change-Id: I0d57b1eea79a7c011231dcf7f46fb3599a62c33f
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
Reviewed-on: https://review.gerrithub.io/372906
Reviewed-by: Sergii Golovatiuk <holser@gmail.com>
Reviewed-by: Dennis Dmitriev <dis.xcom@gmail.com>
Tested-by: Dennis Dmitriev <dis.xcom@gmail.com>
diff --git a/tcp_tests/templates/virtual-mcp10-ovs.new/salt.yaml b/tcp_tests/templates/virtual-mcp10-ovs.new/salt.yaml
index 28ee21d..d9bbf6b 100644
--- a/tcp_tests/templates/virtual-mcp10-ovs.new/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp10-ovs.new/salt.yaml
@@ -1,7 +1,11 @@
{% from 'virtual-mcp10-ovs/map.jinja' import HOSTNAME_CFG01 with context %}
-# Install salt to the config node
+{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
+# Other salt model repository parameters see in shared-salt.yaml
+{% import 'shared-salt.yaml' as SHARED with context %}
+
+# Install salt to the config node
- description: Configure repository on the cfg01 node
cmd:
@@ -71,9 +75,7 @@
- description: Clone reclass models with submodules
cmd: |
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts;
- git clone -b master --recurse-submodules https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab /srv/salt/reclass;
- mkdir -p /srv/salt/reclass/classes/service;
+{{ SHARED.MACRO_CLONE_RECLASS_MODELS() }}
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 1}
skip_fail: false