Skip to content

Commit d17ac8a

Browse files
committed
use explicit bool instead of implicit truthy
As described here: https://ansible.readthedocs.io/projects/ansible-core/devel/porting_guides/porting_guide_core_2.19.html#broken-conditionals In Ansible greater than 2.19 implicit truthy is no longer allowed. Therefor we need to use explicit checks. Signed-off-by: Spirit-act <[email protected]>
1 parent f5d53fb commit d17ac8a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

roles/_common/tasks/configure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
become: true
3434
notify:
3535
- "{{ ansible_parent_role_names | first }} : Restart {{ _common_service_name }}"
36-
when: (_common_config_dir)
36+
when: (_common_config_dir | length > 0)
3737
tags:
3838
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}"
3939
- configure

roles/_common/tasks/install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
- name: "Verify checksum of {{ __common_binary_basename }}"
8282
run_once: true
8383
check_mode: false
84-
when: (_common_checksums_url)
84+
when: (_common_checksums_url | length > 0)
8585
block:
8686
- name: "Fetch checksum list for {{ __common_binary_basename }}"
8787
ansible.builtin.uri:

roles/_common/tasks/preflight.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
ansible.builtin.package:
5858
name: "{{ _common_dependencies }}"
5959
state: present
60-
when: (_common_dependencies)
60+
when: (_common_dependencies != None)
6161
tags:
6262
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}"
6363
- configure
@@ -84,4 +84,4 @@
8484
reject('match', '.+:\\d+$') |
8585
list |
8686
length == 0
87-
when: (_common_web_listen_address)
87+
when: (_common_web_listen_address | length > 0)

0 commit comments

Comments
 (0)