Make possible to override the docker images for SL
Use the macro in the salt.yaml:
{{ SHARED.ADJUST_SL_OPTS(OVERRIDES_FILENAME='path/to/stacklight/server.yml') }}
and the following environment variables for image paths:
DOCKER_IMAGE_ALERTMANAGER
DOCKER_IMAGE_PUSHGATEWAY
DOCKER_IMAGE_PROMETHEUS
DOCKER_IMAGE_REMOTE_AGENT
DOCKER_IMAGE_REMOTE_STORAGE_ADAPTER
DOCKER_IMAGE_PROMETHEUS_RELAY
DOCKER_IMAGE_GRAFANA
, or manage the tag of the images using the single
variable:
DOCKER_IMAGES_SL_TAG= # latest, 2017.12, ...
Change-Id: Icf5039d9346f631ffb4391588b5090396268bc53
diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index ccefbe1..e34e519 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -764,8 +764,9 @@
{%- endmacro %}
+
{%- macro ADJUST_K8S_OPTS() %}
-{#########################################}
+{############################}
- description: Set k8s deploy parameters
cmd: |
@@ -780,8 +781,31 @@
{%- endmacro %}
+
+{%- macro ADJUST_SL_OPTS(OVERRIDES_FILENAME='') %}
+{#############################################}
+- description: Set SL docker images deploy parameters
+ cmd: |
+ {#- For cookiecutter-generated model, use overrides.yml from environment model instead of cluster model #}
+ {%- for sl_opt, value in config.sl_deploy.items() %}
+ {%- if value|string() %}
+ {%- if OVERRIDES_FILENAME %}
+ salt-call reclass.cluster_meta_set name={{ sl_opt }} value={{ value }} file_name={{ OVERRIDES_FILENAME }};
+ {%- else %}
+ salt-call reclass.cluster_meta_set name={{ sl_opt }} value={{ value }};
+ {%- endif %}
+ {%- endif %}
+ {%- endfor %}
+ salt '*' saltutil.refresh_pillar;
+ sleep 10
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 1}
+ skip_fail: false
+{%- endmacro %}
+
+
{%- macro REGISTER_COMPUTE_NODES() %}
-{#########################################}
+{###################################}
{% for ssh in config.underlay.ssh %}
{% if ssh["node_name"].startswith("cmp") %}