support Arch Linux system updates

This commit is contained in:
2026-09-03 14:58:24 +02:00
parent b3d706721c
commit 64b50f7501
4 changed files with 51 additions and 24 deletions
+17 -23
View File
@@ -1,5 +1,5 @@
---
- name: Update system (APT + Flatpak)
- name: Update Linux system
hosts: all:!localhost:!portainer2-jim.im.lab
become: true
gather_facts: false
@@ -36,31 +36,25 @@
until: ping_result is success
# ---------------------------------------------------------
# APT
# Distribution packages
# ---------------------------------------------------------
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
lock_timeout: 300
- name: Update Debian-family packages
ansible.builtin.include_role:
name: update_apt
when: ansible_facts.os_family == 'Debian'
- name: Perform full upgrade
ansible.builtin.apt:
upgrade: full
autoremove: true
autoclean: true
lock_timeout: 300
register: apt_upgrade
retries: 3
delay: 10
until: apt_upgrade is succeeded
- name: Update Arch Linux packages
ansible.builtin.include_role:
name: update_arch
when: ansible_facts.os_family == 'Archlinux'
- name: Fix broken packages
ansible.builtin.command:
cmd: apt-get -f install -y
register: fix_result
failed_when: false
changed_when: "'Setting up' in fix_result.stdout"
- name: Skip unsupported Linux distribution
ansible.builtin.debug:
msg: >-
Package updates are not configured for
{{ ansible_facts.distribution }} ({{ ansible_facts.os_family }}).
when: ansible_facts.os_family not in ['Debian', 'Archlinux']
# ---------------------------------------------------------
# Flatpak
@@ -144,4 +138,4 @@
- portainer
tags:
- never
- portainer
- portainer