From ec3e35ff9a31a504d764ee92796ebee793c00d65 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sun, 9 Aug 2020 01:28:55 -0400 Subject: [PATCH] Add else and items for loop to monit-dashboard --- roles/monit-dashboard/tasks/main.yml | 1 + roles/monit-dashboard/templates/servers.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/monit-dashboard/tasks/main.yml b/roles/monit-dashboard/tasks/main.yml index d14a725..44f5651 100644 --- a/roles/monit-dashboard/tasks/main.yml +++ b/roles/monit-dashboard/tasks/main.yml @@ -9,6 +9,7 @@ owner: root group: root mode: 0600 + with_items: groups['frames'] notify: - restart monit-dashboard tags: diff --git a/roles/monit-dashboard/templates/servers.json b/roles/monit-dashboard/templates/servers.json index 54718d5..e7e1486 100644 --- a/roles/monit-dashboard/templates/servers.json +++ b/roles/monit-dashboard/templates/servers.json @@ -3,7 +3,7 @@ "url": "http://127.0.0.1:2812", "user": "{{ monit_web_user }}", "passwd": "{{ monit_web_pasword }}" - }{{ "," if items is defined and (items|length>0) }} + }{{ "," if items is defined and (items|length>0) else "" }} {% for frame in items %} "{{ frame.name }}": { "url": "http://{{ frame.wireguard_address }}:2812",