Skip to content

Commit

Permalink
Don't fail if cron isn't installed when setting up systemd timer (#147)
Browse files Browse the repository at this point in the history
* `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 <[email protected]>
  • Loading branch information
Woomymy authored Mar 7, 2024
1 parent cbe280e commit 702299f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tasks/noauto_create_timer_systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 702299f

Please sign in to comment.