Skip to content

Commit 656d712

Browse files
committed
devconfig: fix Ansible boolean conditional check for custom repos/packages
Newer Ansible versions reject string variables used directly in conditionals, requiring explicit boolean expressions. The error "Conditional result (False) was derived from value of type 'str'" occurs when checking empty string variables even though they're defined. Remove the redundant first condition that directly checks the string variable. The length check already handles empty strings properly by evaluating to a boolean result (length > 1), making the task skip when the variable is empty or whitespace-only. Generated-by: Claude AI Signed-off-by: Daniel Gomez <[email protected]>
1 parent 66520ae commit 656d712

File tree

1 file changed

+0
-2
lines changed
  • playbooks/roles/devconfig/tasks/config-custom-repos-and-packages/redhat

1 file changed

+0
-2
lines changed

playbooks/roles/devconfig/tasks/config-custom-repos-and-packages/redhat/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
mode: "0644"
1111
with_items: "{{ kdevops_devconfig_custom_repos | trim | split(',') }}"
1212
when:
13-
- kdevops_devconfig_custom_repos
1413
- kdevops_devconfig_custom_repos | trim | length > 1
1514

1615
- name: Install custom packages
@@ -24,5 +23,4 @@
2423
until: result.rc == 0
2524
with_items: "{{ kdevops_devconfig_custom_packages | trim | split(',') }}"
2625
when:
27-
- kdevops_devconfig_custom_packages
2826
- kdevops_devconfig_custom_packages | trim | length > 1

0 commit comments

Comments
 (0)