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