From 5913aa2d34c0fb3df85403527032845d1cbaee5b Mon Sep 17 00:00:00 2001 From: Dan Ragnar Date: Fri, 9 Feb 2018 14:02:28 +0100 Subject: [PATCH] Fix def check and check for uchiwa user --- templates/sensu-api.json.j2 | 2 +- templates/uchiwa_config.json.j2 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/sensu-api.json.j2 b/templates/sensu-api.json.j2 index f94cd6ce..dfcb373d 100644 --- a/templates/sensu-api.json.j2 +++ b/templates/sensu-api.json.j2 @@ -1,6 +1,6 @@ { "api": { - {% if sensu_api_user_name | length > 0 %} + {% if sensu_api_user_name %} "user": "{{ sensu_api_user_name }}", "password": "{{ sensu_api_password }}", {% endif %} diff --git a/templates/uchiwa_config.json.j2 b/templates/uchiwa_config.json.j2 index 7c13f29f..f2c39203 100644 --- a/templates/uchiwa_config.json.j2 +++ b/templates/uchiwa_config.json.j2 @@ -5,7 +5,7 @@ "host": "{{ sensu_api_host }}", "ssl": {{ sensu_api_ssl | lower }}, "port": {{ uchiwa_sensu_api_port }}, - {% if sensu_api_user_name | length > 0 %} + {% if sensu_api_user_name %} "user": "{{ sensu_api_user_name }}", "pass": "{{ sensu_api_password }}", {% endif %} @@ -14,7 +14,9 @@ } ], "uchiwa": { + {% if uchiwa_users %} "users": {{ uchiwa_users | to_nice_json }}, + {% endif %} "port": {{ uchiwa_port }}, {% if uchiwa_auth_privatekey %} "auth": {