Add Beszel and Windows update playbooks; use vault password file
- ubuntu/update-beszel.yaml: upgrade Beszel hub on killer2 and agents on ubuntu_servers - windows/update.yaml: install Windows Updates on [windows] group, reboot if needed - ansible.cfg: point vault_password_file at ~/.ansible/vault_pass Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2b2a56dbca
commit
fe3119cfaf
3 files changed
+118
No files matched your search
@@ -0,0 +1,64 @@
|
||||
---
|
||||
# Upgrade Beszel: hub (docker compose on killer2) first, then agents on all ubuntu_servers.
|
||||
# Agents are the systemd binary at /opt/beszel-agent; uses the agent's built-in self-updater.
|
||||
|
||||
- name: Upgrade Beszel hub
|
||||
hosts: killer2.ki5bhv.com
|
||||
become: true
|
||||
tasks:
|
||||
- name: Pull and recreate beszel compose stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /home/justin/docker/beszel/
|
||||
pull: always
|
||||
recreate: auto
|
||||
register: hub
|
||||
retries: 3
|
||||
delay: 3
|
||||
until: hub is not failed
|
||||
|
||||
- name: Upgrade Beszel agents
|
||||
hosts: ubuntu_servers
|
||||
become: true
|
||||
vars:
|
||||
agent_bin: /opt/beszel-agent/beszel-agent
|
||||
tasks:
|
||||
- name: Check agent binary exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ agent_bin }}"
|
||||
register: agent_stat
|
||||
|
||||
- name: Skip hosts without the binary agent
|
||||
ansible.builtin.meta: end_host
|
||||
when: not agent_stat.stat.exists
|
||||
|
||||
- name: Get current version
|
||||
ansible.builtin.command: "{{ agent_bin }} -v"
|
||||
register: before
|
||||
changed_when: false
|
||||
|
||||
- name: Run self-update
|
||||
ansible.builtin.command: "{{ agent_bin }} update"
|
||||
register: update_out
|
||||
changed_when: false
|
||||
|
||||
- name: Get new version
|
||||
ansible.builtin.command: "{{ agent_bin }} -v"
|
||||
register: after
|
||||
changed_when: before.stdout != after.stdout
|
||||
|
||||
- name: Fix ownership
|
||||
ansible.builtin.file:
|
||||
path: /opt/beszel-agent
|
||||
owner: beszel
|
||||
group: beszel
|
||||
recurse: true
|
||||
|
||||
- name: Restart beszel-agent
|
||||
ansible.builtin.systemd:
|
||||
name: beszel-agent
|
||||
state: restarted
|
||||
when: before.stdout != after.stdout
|
||||
|
||||
- name: Report
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ before.stdout }} -> {{ after.stdout }}"
|
||||
Reference in new issue
Block a user