Beszel: fail on silent update failures and crashed agents
- Windows: fail if a scoop update ran but the agent version didn't change - Ubuntu: after restarting an upgraded agent, check it is still active Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
abdca77860
commit
84433d5cbc
2 files changed
+20
No files matched your search
@@ -59,6 +59,21 @@
|
||||
state: restarted
|
||||
when: before.stdout != after.stdout
|
||||
|
||||
# systemd reports success as soon as the process starts; make sure the new
|
||||
# version didn't crash right after.
|
||||
- name: Verify beszel-agent stayed running
|
||||
when: before.stdout != after.stdout
|
||||
block:
|
||||
- name: Give the agent time to start
|
||||
ansible.builtin.wait_for:
|
||||
timeout: 10
|
||||
|
||||
- name: Check beszel-agent is active
|
||||
ansible.builtin.command: systemctl is-active beszel-agent
|
||||
register: agent_active
|
||||
changed_when: false
|
||||
failed_when: agent_active.stdout != 'active'
|
||||
|
||||
- name: Report
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ before.stdout }} -> {{ after.stdout }}"
|
||||
@@ -48,6 +48,11 @@
|
||||
ansible.windows.win_command: '"{{ agent_exe }}" -v'
|
||||
register: after
|
||||
changed_when: before.stdout != after.stdout
|
||||
# scoop's exit code is lost through Out-String, so a failed update would otherwise
|
||||
# look like success. If an update was attempted, the version must have changed.
|
||||
failed_when: >-
|
||||
after.rc != 0 or
|
||||
(upd is not skipped and before.stdout | trim == after.stdout | trim)
|
||||
|
||||
- name: Report
|
||||
ansible.builtin.debug:
|
||||
|
||||
Reference in new issue
Block a user