Skip to content

fix: Fix non-boolean conditions#82

Merged
richm merged 1 commit intoperformancecopilot:mainfrom
martinpitt:a219
Jun 23, 2025
Merged

fix: Fix non-boolean conditions#82
richm merged 1 commit intoperformancecopilot:mainfrom
martinpitt:a219

Conversation

@martinpitt
Copy link
Copy Markdown
Contributor

Ansible 2.19 demands conditions (when: or assert:) to have a boolean type. Fix list-value conditions with an explicit length check.

Also fix the pcp_accounts default value in roles/pcp/tasks/main.yml -- that variable is a list (of objects), not an object.


This fixes the Ansible 2.19 specific errors like

[ERROR]: Task failed: Action failed: {'failed': True, 'exception': '(traceback unavailable)', 'msg': 'Task failed: Conditional result was "['cyrus-sasl-lib', 'cyrus-sasl-scram']" of type 'list', which evaluates to True. Conditionals must have a boolean result.', 'changed': False, '_ansible_no_log': False}

I tested them against https://github.com/linux-system-roles/metrics, I'll post a draft PR soon. Note that this still leaves one Fedora 42 failure in tests_verify_from_spark.yml which is unrelated, it's an SELinux rejection.

@richm FYI

Ansible 2.19 demands conditions (`when:` or `assert:`) to have a boolean
type. Fix list-value conditions with an explicit length check.

Also fix the `pcp_accounts` default value in roles/pcp/tasks/main.yml --
that variable is a list (of objects), not an object.
@martinpitt
Copy link
Copy Markdown
Contributor Author

Running system-role test with this change here: linux-system-roles/metrics#242

@martinpitt
Copy link
Copy Markdown
Contributor Author

The F42 testing farm run passed, and the GitHub workflow run failed tests_verify_from_spark.yml as expected.

@richm
Copy link
Copy Markdown
Contributor

richm commented Jun 23, 2025

we really need to fix the ansible-lint action to exclude other collections . . .

@richm richm merged commit 3ae028f into performancecopilot:main Jun 23, 2025
5 of 6 checks passed
@martinpitt martinpitt deleted the a219 branch June 23, 2025 15:21
martinpitt added a commit to martinpitt/lsr-metrics that referenced this pull request Jun 23, 2025
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.

2 participants