2023-03-08 20:47:39 +00:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
2023-04-12 22:22:52 +00:00
|
|
|
- ansible.builtin.include_vars:
|
2023-03-08 20:47:39 +00:00
|
|
|
file: ../../defaults/main.yml
|
|
|
|
|
|
|
|
- name: Check cron job file
|
|
|
|
ansible.builtin.fetch:
|
|
|
|
src: /var/spool/cron/crontabs/root
|
|
|
|
dest: /tmp/fetched
|
|
|
|
|
|
|
|
- name: Check if cron job does exist
|
|
|
|
ansible.builtin.assert:
|
|
|
|
that: "lookup('file', '/tmp/fetched/instance/var/spool/cron/crontabs/root') is search('healthchecks.io')"
|
|
|
|
fail_msg: "Cron job 'healthchecks.io' does not exist!"
|
|
|
|
success_msg: "Cron job 'healthchecks.io' does exist!"
|