Check if pillar 'prometheus:exporters' exists before run state
According to the workflow in the pipeline, prometheus:exporters
is not mandatory state and should run only if the pillar exists.
Change-Id: Iac68b836d92e80846ae50a794496b5bf9c4de678
Reviewed-on: https://review.gerrithub.io/376726
Reviewed-by: Dennis Dmitriev <dis.xcom@gmail.com>
Tested-by: Dennis Dmitriev <dis.xcom@gmail.com>
diff --git a/tcp_tests/templates/virtual-mcp11-k8s-calico/sl.yaml b/tcp_tests/templates/virtual-mcp11-k8s-calico/sl.yaml
index 8309364..3369f63 100644
--- a/tcp_tests/templates/virtual-mcp11-k8s-calico/sl.yaml
+++ b/tcp_tests/templates/virtual-mcp11-k8s-calico/sl.yaml
@@ -56,8 +56,11 @@
retry: {count: 2, delay: 10}
skip_fail: false
-- description: Configure Prometheus exporters
- cmd: salt -C 'I@prometheus:exporters' state.sls prometheus
+- description: Configure Prometheus exporters, if pillar 'prometheus:exporters' exists on any server
+ cmd: |
+ if salt -C 'I@prometheus:exporters' match.pillar 'prometheus:exporters' ; then
+ salt -C 'I@prometheus:exporters' state.sls prometheus
+ fi
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 10}
skip_fail: false