further changes to url_monitoring

This commit is contained in:
Sean Anderson 2026-02-10 09:46:25 -06:00
parent 5ebe7a00bc
commit ca22f9baac
2 changed files with 19 additions and 5 deletions

View File

@ -1,6 +1,7 @@
--- ---
- name: Notify that shadowdark is up - name: Notify that shadowdark is up
hosts: shadowdark hosts: bastian
connection: local
tasks: tasks:
- ansible.builtin.debug: - ansible.builtin.debug:
msg: Shadowdark is Live msg: Shadowdark is {{ availability }}

View File

@ -1,11 +1,11 @@
--- ---
- name: Listen for events on a webhook - name: Listen for events on a webhook
hosts: shadowdark hosts: all
sources: sources:
- ansible.eda.url_check: - ansible.eda.url_check:
urls: urls:
- http://localhost - http://shadowdark.seandersontech.com
delay: 60 delay: 10
rules: rules:
- name: Web site is up - name: Web site is up
condition: event.url_check.status == "up" condition: event.url_check.status == "up"
@ -13,3 +13,16 @@
run_job_template: run_job_template:
name: "Shadowdark Up" name: "Shadowdark Up"
organization: Default organization: Default
job_args:
extra_vars:
availability: up
- name: Web site is down
condition: event.url_check.status == "down"
action:
run_job_template:
name: "Shadowdark Up"
organization: Default
job_args:
extra_vars:
availability: down