From 2453c02fbbefc51c9163f060d2ec6c838b4b1888 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Thu, 7 May 2020 00:28:40 +0200 Subject: [PATCH] roles/riot-web: advanced http monitoring --- roles/riot-web/tasks/main.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/roles/riot-web/tasks/main.yaml b/roles/riot-web/tasks/main.yaml index 6284e2b..1bebf39 100644 --- a/roles/riot-web/tasks/main.yaml +++ b/roles/riot-web/tasks/main.yaml @@ -31,4 +31,26 @@ template: src: 'config.json.j2' dest: '/srv/riot-web/riot-{{ riot_web_version }}/config.json' + +- 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': { riot_web_nginx_fqdn: {'/': 'Riot'} }, + }, 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' +... + ...