From 1d6a53457ca86b5104a665ab45567764cc9d2045 Mon Sep 17 00:00:00 2001
From: Gorka Benguria <gorka.benguria@tecnalia.com>
Date: Fri, 16 Sep 2022 18:17:08 +0200
Subject: [PATCH] removes defaults and force to have value

---
 piacere_monitoring/main.yml | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/piacere_monitoring/main.yml b/piacere_monitoring/main.yml
index d25c4c0..0668b33 100644
--- a/piacere_monitoring/main.yml
+++ b/piacere_monitoring/main.yml
@@ -2,14 +2,14 @@
   pre_tasks:
     - name: Check parameters
       fail:
-        msg: 'variable {{item}} not defined'
-      when: (item is not defined) or (item|length == 0)
+        msg: 'variable {{item}} empty'
+      when:  item | length == 0
       with_items:
-        - pma_deployment_id
-        - pma_influxdb_bucket
-        - pma_influxdb_token
-        - pma_influxdb_org
-        - pma_influxdb_addr
+        - "{{ pma_deployment_id }}"
+        - "{{ pma_influxdb_bucket }}"
+        - "{{ pma_influxdb_token }}"
+        - "{{ pma_influxdb_org }}"
+        - "{{ pma_influxdb_addr }}"
     - name: Print parameters
       debug:
         msg: 
@@ -17,7 +17,8 @@
           - "pma_influxdb_bucket: {{ pma_influxdb_bucket }}"
           - "pma_influxdb_token: {{ pma_influxdb_token }}"
           - "pma_influxdb_org: {{ pma_influxdb_org }}"
-          - "pma_influxdb_addr: {{ pma_influxdb_addr }}"
+          - "pma_influxdb_addr: {{ pma_influxdb_addr | length }}"
+          - "monjon: {{ monjon | length  }}"
     - name: Ensure gnupg package
       package:
         name: gnupg
-- 
GitLab