Repository navigation
Fix bare-string when/assert conditionals rejected by ansible-core 2.17.4 - #385
Merged
Merged
Conversation
sc_replication_dest_host and features.version_update.next_version are non-empty strings when configured, "" when not. A bare string used directly in when: or assert.that used to be truthy-tested implicitly, but ansible-core 2.17.4 rejects it with "Conditionals must have a boolean result" the first time the string is genuinely non-empty. Found 2026-10-29 on the first real dispatch run against the new Indy-lab fixture (#383): hypercore-ci-fleet's .64 is the first host in a long time to set a real, non-empty sc_replication_dest_host and next_version that actually got exercised by live CI, which is what surfaced this -- every other host's blocks use "" for both, sidestepping the bug entirely. Not a regression from #383. Fixed all 6 occurrences across 4 files by making each boolean test explicit (| length > 0 / | length == 0), rather than relying on Ansible's implicit bare-string truthiness. Confirmed with a standalone jinja2 render that the filter produces the right boolean for both "" and real values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sc_replication_dest_hostandfeatures.version_update.next_versionare non-empty stringswhen configured,
""when not. A bare string used directly inwhen:orassert.thatusedto be truthy-tested implicitly by Ansible, but
ansible-core2.17.4 rejects it with"Conditionals must have a boolean result"the first time the string is genuinely non-empty.Found 2026-10-29 on the first real dispatch run against the new Indy-lab fixture (#383):
https://10.6.112.64is the first host in a long time to set a real, non-emptysc_replication_dest_hostandnext_versionthat actually got exercised by live CI — everyother host's config block in this file uses
""for both, which sidesteps the bug entirely.Confirmed via two failed jobs on that run:
Not a regression from #383 — this has been a latent bug in these 4 files for a while;
my fixture's honest (non-placeholder) values are just the first thing to trip it.
Fix
All 6 occurrences across 4 files, made explicit rather than relying on implicit bare-string
truthiness:
tests/integration/targets/vm_replication_info/tasks/main.yml(×3)tests/integration/targets/remote_cluster_info/tasks/main.yml(×2, one negated)tests/integration/targets/vm_clone__replicated/tasks/main.yml(×1, in anassert.thatlist)tests/integration/targets/version_update_info/tasks/main.yml(×2, one negated)sc_config[sc_host].sc_replication_dest_host→sc_config[sc_host].sc_replication_dest_host | length > 0(and
| length == 0for the negated cases). Chose| lengthover| booldeliberately —Ansible's
boolfilter only recognizes a fixed set of yes/no/true/false-style tokens, and anarbitrary URL string isn't guaranteed to map the way we want;
| length > 0preserves theexact original intent ("non-empty string means configured") with no ambiguity.
Confirmed via a standalone jinja2 render that the filter produces the correct boolean for
both
""and real values (https://10.6.112.67,9.7.9.227018).Test plan
| length > 0/| length == 0verified against both empty and non-emptystrings (done locally)
integ-test.yml'svm_replication_info,vm_clone__replicated, andversion_update_infotargets after merge — these are what actually exercise the fix