Use list for ENVIRONMENT_CONTEXT_NAMES to provide several contexts
Change-Id: Iad59dde5f9fd0a9df2b13b4f801cc35283ee3e5d
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index 9fcbb83..43f2ce8 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -167,6 +167,14 @@
{%- macro MACRO_GENERATE_COOKIECUTTER_MODEL(IS_CONTRAIL_LAB=false) %}
{###################################################################}
+{%- set CLUSTER_CONTEXT_PATH = '/tmp/environment/' + CLUSTER_CONTEXT_NAME %}
+- description: "[EXPERIMENTAL] Upload cookiecutter-templates context to {{ HOSTNAME_CFG01 }}"
+ upload:
+ local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
+ local_filename: {{ CLUSTER_CONTEXT_NAME }}
+ remote_path: /tmp/environment/
+ node_name: {{ HOSTNAME_CFG01 }}
+
- description: Create cluster model from cookiecutter templates
cmd: |
set -e;
@@ -255,6 +263,7 @@
{%- macro MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() %}
{########################################################}
+
- description: "[EXPERIMENTAL] Upload 'environment' to {{ HOSTNAME_CFG01 }}"
upload:
local_path: {{ config.salt_deploy.environment_template_dir }}
@@ -262,19 +271,14 @@
node_name: {{ HOSTNAME_CFG01 }}
skip_fail: false
-- description: "[EXPERIMENTAL] Upload cookiecutter-templates context to {{ HOSTNAME_CFG01 }}"
- upload:
- local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
- local_filename: {{ CLUSTER_CONTEXT_NAME }}
- remote_path: /tmp/environment/
- node_name: {{ HOSTNAME_CFG01 }}
-
+{%- for ENVIRONMENT_CONTEXT_NAME in ENVIRONMENT_CONTEXT_NAMES %}
- description: "[EXPERIMENTAL] Upload environment inventory to {{ HOSTNAME_CFG01 }}"
upload:
local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
local_filename: {{ ENVIRONMENT_CONTEXT_NAME }}
remote_path: /tmp/environment/
node_name: {{ HOSTNAME_CFG01 }}
+{%- endfor %}
- description: "[EXPERIMENTAL] Remove linux.network.interface object from the cluster/system models and use fixed 'environment' model instead"
cmd: |
@@ -311,7 +315,7 @@
ln -s '/tmp/environment/environment_template/{{ '{# roles #}' }}' '/tmp/environment/environment_template/{{ '{{ cookiecutter._env_name }}' }}/';
reclass-tools render --template-dir /tmp/environment/environment_template/ \
--output-dir /srv/salt/reclass/classes/environment/ \
- --context {{ ENVIRONMENT_CONTEXT_PATH }} \
+ {{ ' --context /tmp/environment/'.join(ENVIRONMENT_CONTEXT_NAMES) }} \
--env-name {{ ENVIRONMENT_MODEL_INVENTORY_NAME }}
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 5}