From 5872b1332f6598804f1374c2f28c92f9466bc0ce Mon Sep 17 00:00:00 2001 From: Tina Date: Wed, 20 May 2026 13:39:28 +0200 Subject: [PATCH] fix(ansible): drop hostvars[...].name from start/stop debug msg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 }}): : {{ command_output.stdout }}' after: msg: ': {{ 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. --- template/2026.5.5.1612/ansible/cmn/start_firedancer.yml | 2 +- template/2026.5.5.1612/ansible/cmn/start_solv.yml | 2 +- template/2026.5.5.1612/ansible/cmn/stop_firedancer.yml | 2 +- template/2026.5.5.1612/ansible/cmn/stop_solv.yml | 2 +- template/2026.5.5.1612/ansible/mainnet-rpc/stop_firedancer.yml | 2 +- template/2026.5.5.1612/ansible/mainnet-rpc/stop_solv.yml | 2 +- template/2026.5.5.1612/ansible/mainnet-validator/start_solv.yml | 2 +- .../2026.5.5.1612/ansible/mainnet-validator/stop_firedancer.yml | 2 +- template/2026.5.5.1612/ansible/mainnet-validator/stop_solv.yml | 2 +- template/2026.5.5.1612/ansible/testnet-validator/start_solv.yml | 2 +- .../2026.5.5.1612/ansible/testnet-validator/stop_firedancer.yml | 2 +- template/2026.5.5.1612/ansible/testnet-validator/stop_solv.yml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/template/2026.5.5.1612/ansible/cmn/start_firedancer.yml b/template/2026.5.5.1612/ansible/cmn/start_firedancer.yml index 8df180a0..db980fe7 100644 --- a/template/2026.5.5.1612/ansible/cmn/start_firedancer.yml +++ b/template/2026.5.5.1612/ansible/cmn/start_firedancer.yml @@ -14,4 +14,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Start Firedancer: {{ command_output.stdout }}' + msg: 'Start Firedancer: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/cmn/start_solv.yml b/template/2026.5.5.1612/ansible/cmn/start_solv.yml index 8f758de2..d40f9696 100644 --- a/template/2026.5.5.1612/ansible/cmn/start_solv.yml +++ b/template/2026.5.5.1612/ansible/cmn/start_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Start Solv: {{ command_output.stdout }}' + msg: 'Start Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/cmn/stop_firedancer.yml b/template/2026.5.5.1612/ansible/cmn/stop_firedancer.yml index e7cb86aa..6d947754 100644 --- a/template/2026.5.5.1612/ansible/cmn/stop_firedancer.yml +++ b/template/2026.5.5.1612/ansible/cmn/stop_firedancer.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Firedancer: {{ command_output.stdout }}' + msg: 'Stop Firedancer: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/cmn/stop_solv.yml b/template/2026.5.5.1612/ansible/cmn/stop_solv.yml index a45b1be6..6b11e8d5 100644 --- a/template/2026.5.5.1612/ansible/cmn/stop_solv.yml +++ b/template/2026.5.5.1612/ansible/cmn/stop_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Solv: {{ command_output.stdout }}' + msg: 'Stop Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/mainnet-rpc/stop_firedancer.yml b/template/2026.5.5.1612/ansible/mainnet-rpc/stop_firedancer.yml index e7cb86aa..6d947754 100644 --- a/template/2026.5.5.1612/ansible/mainnet-rpc/stop_firedancer.yml +++ b/template/2026.5.5.1612/ansible/mainnet-rpc/stop_firedancer.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Firedancer: {{ command_output.stdout }}' + msg: 'Stop Firedancer: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/mainnet-rpc/stop_solv.yml b/template/2026.5.5.1612/ansible/mainnet-rpc/stop_solv.yml index a45b1be6..6b11e8d5 100644 --- a/template/2026.5.5.1612/ansible/mainnet-rpc/stop_solv.yml +++ b/template/2026.5.5.1612/ansible/mainnet-rpc/stop_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Solv: {{ command_output.stdout }}' + msg: 'Stop Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/mainnet-validator/start_solv.yml b/template/2026.5.5.1612/ansible/mainnet-validator/start_solv.yml index 8f758de2..d40f9696 100644 --- a/template/2026.5.5.1612/ansible/mainnet-validator/start_solv.yml +++ b/template/2026.5.5.1612/ansible/mainnet-validator/start_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Start Solv: {{ command_output.stdout }}' + msg: 'Start Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/mainnet-validator/stop_firedancer.yml b/template/2026.5.5.1612/ansible/mainnet-validator/stop_firedancer.yml index 31d346fa..2a239729 100644 --- a/template/2026.5.5.1612/ansible/mainnet-validator/stop_firedancer.yml +++ b/template/2026.5.5.1612/ansible/mainnet-validator/stop_firedancer.yml @@ -11,7 +11,7 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Firedancer: {{ command_output.stdout }}' + msg: 'Stop Firedancer: {{ command_output.stdout }}' - name: Remove Firedancer workspace files shell: sudo rm -f /mnt/.gigantic/*.wksp diff --git a/template/2026.5.5.1612/ansible/mainnet-validator/stop_solv.yml b/template/2026.5.5.1612/ansible/mainnet-validator/stop_solv.yml index a45b1be6..6b11e8d5 100644 --- a/template/2026.5.5.1612/ansible/mainnet-validator/stop_solv.yml +++ b/template/2026.5.5.1612/ansible/mainnet-validator/stop_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Solv: {{ command_output.stdout }}' + msg: 'Stop Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/testnet-validator/start_solv.yml b/template/2026.5.5.1612/ansible/testnet-validator/start_solv.yml index 8f758de2..d40f9696 100644 --- a/template/2026.5.5.1612/ansible/testnet-validator/start_solv.yml +++ b/template/2026.5.5.1612/ansible/testnet-validator/start_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Start Solv: {{ command_output.stdout }}' + msg: 'Start Solv: {{ command_output.stdout }}' diff --git a/template/2026.5.5.1612/ansible/testnet-validator/stop_firedancer.yml b/template/2026.5.5.1612/ansible/testnet-validator/stop_firedancer.yml index 0a716075..d02ebf20 100644 --- a/template/2026.5.5.1612/ansible/testnet-validator/stop_firedancer.yml +++ b/template/2026.5.5.1612/ansible/testnet-validator/stop_firedancer.yml @@ -11,7 +11,7 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Firedancer: {{ command_output.stdout }}' + msg: 'Stop Firedancer: {{ command_output.stdout }}' - name: Remove Firedancer workspace files shell: sudo rm -f /mnt/.gigantic/*.wksp diff --git a/template/2026.5.5.1612/ansible/testnet-validator/stop_solv.yml b/template/2026.5.5.1612/ansible/testnet-validator/stop_solv.yml index a45b1be6..6b11e8d5 100644 --- a/template/2026.5.5.1612/ansible/testnet-validator/stop_solv.yml +++ b/template/2026.5.5.1612/ansible/testnet-validator/stop_solv.yml @@ -11,4 +11,4 @@ - name: Display Command output debug: - msg: '{{ inventory_hostname }} ({{ hostvars[inventory_hostname].name }}): Stop Solv: {{ command_output.stdout }}' + msg: 'Stop Solv: {{ command_output.stdout }}'