From cac6bf599ef19380f5f3dad560011f382fd6fddb Mon Sep 17 00:00:00 2001 From: HitLuca Date: Mon, 11 Jul 2022 18:46:37 +0200 Subject: [PATCH] :sparkles: added healthchecks.io service integration --- docs/applications/healthchecks.io.md | 11 +++++++++++ roles/healthchecks.io/defaults/main.yml | 5 +++++ roles/healthchecks.io/tasks/main.yml | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 docs/applications/healthchecks.io.md create mode 100644 roles/healthchecks.io/defaults/main.yml create mode 100644 roles/healthchecks.io/tasks/main.yml diff --git a/docs/applications/healthchecks.io.md b/docs/applications/healthchecks.io.md new file mode 100644 index 00000000..dd23b17f --- /dev/null +++ b/docs/applications/healthchecks.io.md @@ -0,0 +1,11 @@ +# Healthchecks.io + +Homepage: [https://healthchecks.io/](https://healthchecks.io/) + +A simple cronjob that uses `curl` to ping a given endpoint on the `healthchecks.io` servers. You can choose how often it should ping the endpoint, and what happens when it doesn't. Email/Slack/Telegram and many more services can be integrated. + +## Usage + +Create your own project on [https://healthchecks.io/](https://healthchecks.io/), and set both the time between pings and the grace time. Set your prefered integration such as email. + +Set `healthchecks_enabled: true` in your `inventories//nas.yml` file, and if your time between pings is different than the default `healthchecks_ping_minutes`, change it. Finally, set your ping url in the `healthchecks_url` variable. diff --git a/roles/healthchecks.io/defaults/main.yml b/roles/healthchecks.io/defaults/main.yml new file mode 100644 index 00000000..1253b829 --- /dev/null +++ b/roles/healthchecks.io/defaults/main.yml @@ -0,0 +1,5 @@ +--- +healthchecks_enabled: false +healthchecks_ping_minutes: 15 + +healthchecks_url: "" diff --git a/roles/healthchecks.io/tasks/main.yml b/roles/healthchecks.io/tasks/main.yml new file mode 100644 index 00000000..47289c5a --- /dev/null +++ b/roles/healthchecks.io/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Add healthchecks.io cronjob + cron: + name: healthchecks.io + minute: "*/{{ healthchecks_ping_minutes }}" + user: root + cron_file: /etc/crontab + job: "curl -m 10 --retry 5 {{ healthchecks_url }}"