Add possibility to set tags

Change-Id: Ib49cc6d19f30bd648c85df83907906f64a419dc5
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index 330906d..cad0222 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -8,7 +8,9 @@
 {% set SALT_MODELS_SYSTEM_REPOSITORY = os_env('SALT_MODELS_SYSTEM_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/reclass-system') %}
 {% set SALT_MODELS_SYSTEM_COMMIT = os_env('SALT_MODELS_SYSTEM_COMMIT','') %}
 {% set SALT_MODELS_SYSTEM_REF_CHANGE = os_env('SALT_MODELS_SYSTEM_REF_CHANGE','') %}
+{% set SALT_MODELS_SYSTEM_TAG = os_env('SALT_MODELS_SYSTEM_TAG','') %}
 {% set COOKIECUTTER_REF_CHANGE = os_env('COOKIECUTTER_REF_CHANGE','') %}
+{% set COOKIECUTTER_TAG = os_env('COOKIECUTTER_TAG','') %}
 {% set COOKIECUTTER_TEMPLATE_COMMIT = os_env('COOKIECUTTER_TEMPLATE_COMMIT','') %}
 {% set ENVIRONMENT_TEMPLATE_REF_CHANGE = os_env('ENVIRONMENT_TEMPLATE_REF_CHANGE','') %}
 
@@ -239,6 +241,12 @@
     pushd classes/system/;
     git checkout {{ SALT_MODELS_SYSTEM_COMMIT }};
     popd;
+    {%- if SALT_MODELS_SYSTEM_TAG != '' %}
+    pushd classes/system/;
+    git fetch --all --tags --prune
+    git checkout tags/{{ SALT_MODELS_SYSTEM_TAG }};
+    popd;
+    {%- endif %}
     {%- elif SALT_MODELS_SYSTEM_REF_CHANGE != '' %}
     pushd classes/system/ && \
     {%- for item in SALT_MODELS_SYSTEM_REF_CHANGE.split(" ") %}
@@ -340,6 +348,13 @@
     popd
     {%- endif %}
 
+    {%- if COOKIECUTTER_TAG != '' %}
+    pushd /tmp/cookiecutter-templates
+    git fetch --all --tags --prune
+    git checkout tags/{{ COOKIECUTTER_TAG }}
+    popd
+    {%- endif %}
+
     mkdir -p /srv/salt/reclass/classes/cluster/
     mkdir -p /srv/salt/reclass/classes/system/
     mkdir -p /srv/salt/reclass/classes/service/