Add possibility to change default tag for update repos
Change-Id: Iac591ba795160695c3105c9678757a93127934cc
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index c3bc0f3..c8c56ac 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -34,6 +34,7 @@
{% set UBUNTU_SECURITY_REPOSITORY = os_env('UBUNTU_SECURITY_REPOSITORY', "deb [arch=amd64] http://mirror.mirantis.com/" + REPOSITORY_SUITE + "/ubuntu/ ${DISTRIB_CODENAME}-security main restricted universe") %}
{% set UBUNTU_KEY_SERVER = os_env('UBUNTU_KEY_SERVER', 'keyserver.ubuntu.com') %}
{% set UBUNTU_KEY_ID = os_env('UBUNTU_KEY_ID', '0E08A149DE57BFBE') %}
+{% set UPDATE_REPO_CUSTOM_TAG = os_env('UPDATE_REPO_CUSTOM_TAG', '') %}
{# Address pools for reclass cluster model are taken in the following order:
# 1. environment variables,
@@ -621,6 +622,18 @@
retry: {count: 1, delay: 1}
skip_fail: false
+{%- if UPDATE_REPO_CUSTOM_TAG != '' %}
+- description: "[EXPERIMENTAL] Change update repos tag acording to defined in job"
+ cmd: |
+ . /root/venv-reclass-tools/bin/activate;
+ reclass-tools add-key parameters._param.linux_system_repo_update_url 'http://mirror.mirantis.com/update/{{ UPDATE_REPO_CUSTOM_TAG }}/' /srv/salt/reclass/classes/cluster/{{ CLUSTER_NAME }}/openstack/init.yml;
+ # Replace ubuntu_updates repo tag independently, because it has another url structure
+ reclass-tools add-key parameters.linux.system.repo.ubuntu_updates.source 'deb [arch=amd64] http://mirror.mirantis.com/{{ UPDATE_REPO_CUSTOM_TAG }}/ubuntu/ ${_param:linux_system_codename}-updates main restricted universe' /srv/salt/reclass/classes/cluster/{{ CLUSTER_NAME }}/infra/apt_repos.yml;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 5}
+ skip_fail: false
+{%- endif %}
+
{%- endmacro %}