Skip to content

Conversation

@gianmarco-mameli
Copy link
Contributor

Hello,
I’m using the collection on Ansible Core >= 2.19, and because of some changes on the playbook behavior handling the conditionals, some tasks fail with an error like:

TASK [netways.icinga.monitoring_plugins : Apt - install requested packages] ***************************************************************************************************************************************************************************************************************************************************
[ERROR]: Task failed: Conditional result (True) was derived from value of type 'list' at '/Users/user/.ansible/collections/ansible_collections/netways/icinga/roles/monitoring_plugins/tasks/main.yml:53:22'. Conditionals must have a boolean result.

Task failed.
Origin: /Users/user/.ansible/collections/ansible_collections/netways/icinga/roles/monitoring_plugins/tasks/install_on_Debian.yml:3:3

1 ---
2
3 - name: Apt - install requested packages
    ^ column 3

<<< caused by >>>

Conditional result (True) was derived from value of type 'list' at '/Users/user/.ansible/collections/ansible_collections/netways/icinga/roles/monitoring_plugins/tasks/main.yml:53:22'. Conditionals must have a boolean result.
Origin: /Users/user/.ansible/collections/ansible_collections/netways/icinga/roles/monitoring_plugins/tasks/install_on_Debian.yml:13:7

11   when:
12     - needed_packages is defined
13     - needed_packages
         ^ column 7

Broken conditionals can be temporarily allowed with the `ALLOW_BROKEN_CONDITIONALS` configuration option.

The doc reference Ansible Broken Conditionals
I’ve made some fixes, simply adding a length > 0 filter to the vars to be sure that on the when clause the result is a pure boolean
Let me know if that’s ok

Thanks

… Debian, RedHat, and Suse installation tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant