Skip to content

Commit d5422eb

Browse files
committed
fix(roles/_common): Fix non-boolean conditionals
This modifies the _common role to use a working conditional for newer ansible versions. Without the fix, you receive the following error: ``` Conditional result was '[...]' of type 'str', which evaluates to True. Conditionals must have a boolean result. ``` Signed-off-by: Sol Jerome <[email protected]>
1 parent f5d53fb commit d5422eb

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 is defined
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 is defined
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 is defined
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 is defined

0 commit comments

Comments
 (0)