Skip to content

Commit

Permalink
roles/single: skip cron-related tasks if cron is not installed
Browse files Browse the repository at this point in the history
This is required to address: #52

Signed-off-by: Zakhar Bessarab <[email protected]>
  • Loading branch information
zekker6 committed Feb 22, 2024
1 parent db4e16e commit fbb63b5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions roles/single/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@
name: victoriametrics
enabled: true

- name: Gather package facts
ansible.builtin.package_facts:
manager: auto

- name: Configure credentials
when: victoriametrics_backup_enabled | bool
when:
- victoriametrics_backup_enabled | bool
- "'cron' in ansible_facts.packages"
block:
- name: Create aws credentials dir
become: true
Expand Down Expand Up @@ -97,4 +103,6 @@
weekday: "{{ victoriametrics_backup_cron_weekday }}"
month: "{{ victoriametrics_backup_cron_month }}"
state: absent
when: not victoriametrics_backup_enabled | bool
when:
- not victoriametrics_backup_enabled | bool
- "'cron' in ansible_facts.packages"

0 comments on commit fbb63b5

Please sign in to comment.