mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 21:42:17 +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
|
recurse: no
|
||||||
file_type: directory
|
file_type: directory
|
||||||
register: backups
|
register: backups
|
||||||
failed_when: backups.files
|
failed_when: backups.files | length > 0
|
||||||
|
|
||||||
- name: Verify backup on controller.
|
- name: Verify backup on controller.
|
||||||
ansible.builtin.find:
|
ansible.builtin.find:
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
pattern: "{{ ansible_facts.fqdn }}*"
|
pattern: "{{ ansible_facts.fqdn }}*"
|
||||||
file_type: directory
|
file_type: directory
|
||||||
register: backups
|
register: backups
|
||||||
failed_when: not backups.files
|
failed_when: backups.files | length == 0
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
become: no
|
become: no
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user