Loop var fixes
This commit is contained in:
parent
120f3f8a26
commit
07d9637e9b
@ -1,14 +1,16 @@
|
||||
---
|
||||
- name: Ensure backup rules contains the necessary fields
|
||||
ansible.builtin.fail:
|
||||
msg: "You must define {{ item }} in the backup ruleset"
|
||||
when: not backup_rules[item] is defined
|
||||
msg: "You must define {{ backup_rule_checker }} in the backup ruleset"
|
||||
when: not backup_rules[backup_rule_checker] is defined
|
||||
loop:
|
||||
- container_name
|
||||
- directories_to_backup
|
||||
- backup_dir
|
||||
- backup_name_prefix
|
||||
- max_backups_kept
|
||||
loop_control:
|
||||
loop_var: backup_rule_checker
|
||||
|
||||
- name: Make sure backup dir exists
|
||||
ansible.builtin.file:
|
||||
@ -53,8 +55,10 @@
|
||||
|
||||
- name: Remove the files
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
path: "{{ old_file_to_delete }}"
|
||||
state: absent
|
||||
loop: "{{ oldest_file_paths }}"
|
||||
loop_control:
|
||||
loop_var: old_file_to_delete
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user