Don't fail if cron isn't installed when setting up systemd timer

* `cron` isn't always installed and is not required when using a systemd
  timer, so make sure setup doesn't fail when we check if there's
  already an installed cron timer

Signed-off-by: Woomymy <woomy@woomy.be>
This commit is contained in:
Woomymy 2024-03-06 20:21:57 +01:00
parent cbe280e7ff
commit 5f2dec6d9a
No known key found for this signature in database
GPG Key ID: EB942C3E86F372A5

View File

@ -6,11 +6,13 @@
state: absent
check_mode: true
register: cron_file_exists
ignore_errors: true
- name: Ensure no Borgmatic Cron file exists.
ansible.builtin.assert:
that:
- not cron_file_exists.changed
- not cron_file_exists.failed or "Failed to find" in cron_file_exists.msg
fail_msg: Found an existing Borgmatic Cron job. Please remove before using Systemd timer.
- name: Create borgbackup timer