fix(ansible): drop hostvars[...].name from start/stop debug msg#396
Open
POPPIN-FUMI wants to merge 1 commit into
Open
fix(ansible): drop hostvars[...].name from start/stop debug msg#396POPPIN-FUMI wants to merge 1 commit into
POPPIN-FUMI wants to merge 1 commit into
Conversation
The `Display Command output` debug task in 12 start/stop playbooks
under `template/2026.5.5.1612/ansible/` referenced
`hostvars[inventory_hostname].name`, a host variable that is never
defined when the playbook is invoked with a single ad-hoc inventory
target (e.g. `ansible-playbook -i 192.0.2.10, ...`). Ansible raises
`'HostVarsVars' object has no attribute 'name'` at task
finalisation, the playbook exits non-zero, and any orchestration
that treats playbook failure as an abort signal (= the
`queueOrderedSteps` pattern used by the master-api
service-restart routes) silently skips the matching `start_*.yml`
that would have brought the daemon back up.
Concrete symptom that prompted this fix: a `service restart` queue
ran `stop_solv.yml` on a target host, the Stop Solv shell task
succeeded, but the subsequent Display Command output task crashed
on the missing `.name`, the playbook exited non-zero, and the
queued `start_solv.yml` step was therefore aborted. The validator
stayed down until an operator noticed and restarted it manually.
The same fix was already applied to
`template/2026.5.5.1612/ansible/mainnet-rpc/start_solv.yml`
(= the only playbook with a simple `'Start Solv: …'` debug message
already merged). This commit brings the other 12 start/stop
playbooks in the latest template into the same form.
Files updated (latest template only — historical templates kept as
shipped):
ansible/cmn/{start,stop}_solv.yml
ansible/cmn/{start,stop}_firedancer.yml
ansible/mainnet-rpc/stop_solv.yml
ansible/mainnet-rpc/stop_firedancer.yml
ansible/mainnet-validator/{start,stop}_solv.yml
ansible/mainnet-validator/stop_firedancer.yml
ansible/testnet-validator/{start,stop}_solv.yml
ansible/testnet-validator/stop_firedancer.yml
Each change is a single-line replacement:
before: msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): <Action>: {{ command_output.stdout }}'
after: msg: '<Action>: {{ command_output.stdout }}'
No behaviour change to the actual systemctl invocation in the
previous task, so already-working `start_*.yml` paths (mainnet-rpc
in particular) are unaffected.
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
12 start/stop playbooks under
`template/2026.5.5.1612/ansible/` had a `Display Command output`
debug task that referenced `hostvars[inventory_hostname].name` —
a host variable that is never defined when the playbook is invoked
with a single ad-hoc inventory target (e.g.
`ansible-playbook -i 192.0.2.10, ...`). Ansible raises
`'HostVarsVars' object has no attribute 'name'` at task
finalisation, the playbook exits non-zero, and any orchestration
that treats playbook failure as an abort signal silently skips the
matching `start_*.yml`.
Concrete symptom
A service-restart orchestration ran `stop_solv.yml` on a target.
The Stop Solv shell task succeeded, but the Display Command output
task crashed on the missing `.name`, the playbook exited
non-zero, and the queued follow-up `start_solv.yml` was therefore
aborted. The validator stayed down until an operator noticed and
manually restarted it.
Fix
Match the already-fixed form in
`template/2026.5.5.1612/ansible/mainnet-rpc/start_solv.yml`:
```
```
12 files changed, 12 insertions(+), 12 deletions(-). Latest
template only — historical template snapshots are kept as-is.
Test plan
latest template AND in older snapshots, but historical
snapshots are not touched (= they're frozen artifacts).
this template version deployed locally can pull the patched
copy and re-run a restart orchestration to confirm the chain
no longer aborts at the debug task.