From 9a7f89b3c7499161fbbb84d3f89c2b02fef81755 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Thu, 7 May 2020 00:28:22 +0200 Subject: [PATCH] roles/nextcloud: advanced http monitoring --- roles/nextcloud/tasks/main.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/roles/nextcloud/tasks/main.yaml b/roles/nextcloud/tasks/main.yaml index 9b87bef..597d548 100644 --- a/roles/nextcloud/tasks/main.yaml +++ b/roles/nextcloud/tasks/main.yaml @@ -199,4 +199,23 @@ nojson: true tags: - 'service_password' +- name: 'MONITORING | add HTTP service' + block: + - name: 'MONITORING | add service to monitoring entry' + set_fact: + monitoring_entry: > + {{ monitoring_entry | default({}) | combine({ + 'address': ansible_host, + 'vhosts_uri': { nextcloud_nginx_fqdn: {'/': 'nextcloud.com'} }, + }, recursive=true) }} + - name: 'MONITORING | update monitoring facts' + set_fact: + monitoring_facts: > + {{ hostvars[monitoring_host]['monitoring_facts'] + | default({}) + | combine({host_fqdn: monitoring_entry}) }} + delegate_facts: true + delegate_to: '{{ monitoring_host }}' + tags: + - 'monitoring' ...