Skip to content

Commit

Permalink
Merge pull request #53 from VictoriaMetrics/roles/single-skip-cron
Browse files Browse the repository at this point in the history
roles/single: skip cron-related tasks if cron is not installed
  • Loading branch information
zekker6 authored Feb 22, 2024
2 parents db4e16e + fbb63b5 commit 057cc08
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 057cc08

Please sign in to comment.