mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 13:32:10 +00:00
test_backup.yml: Fix evaluation of 'list = False' and 'list = True'
ansible-core 2.19 is not automatically converting empty and non empty lists to bool values. Conditionals must have a boolean result. The solution is to evaluate the length of the lists instead.
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
recurse: no
|
||||
file_type: directory
|
||||
register: backups
|
||||
failed_when: backups.files
|
||||
failed_when: backups.files | length > 0
|
||||
|
||||
- name: Verify backup on controller.
|
||||
ansible.builtin.find:
|
||||
@@ -116,7 +116,7 @@
|
||||
pattern: "{{ ansible_facts.fqdn }}*"
|
||||
file_type: directory
|
||||
register: backups
|
||||
failed_when: not backups.files
|
||||
failed_when: backups.files | length == 0
|
||||
delegate_to: localhost
|
||||
become: no
|
||||
|
||||
|
||||
Reference in New Issue
Block a user