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
+2 -1
View File
@@ -1,2 +1,3 @@
collections: collections:
- name: community.routeros - name: community.routeros
- name: community.general
+23
View File
@@ -0,0 +1,23 @@
---
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
lock_timeout: 300
- 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: 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"
+9
View File
@@ -0,0 +1,9 @@
---
- name: Update pacman cache and upgrade all packages
community.general.pacman:
update_cache: true
upgrade: true
register: pacman_upgrade
retries: 3
delay: 10
until: pacman_upgrade is succeeded
+17 -23
View File
@@ -1,5 +1,5 @@
--- ---
- name: Update system (APT + Flatpak) - name: Update Linux system
hosts: all:!localhost:!portainer2-jim.im.lab hosts: all:!localhost:!portainer2-jim.im.lab
become: true become: true
gather_facts: false gather_facts: false
@@ -36,31 +36,25 @@
until: ping_result is success until: ping_result is success
# --------------------------------------------------------- # ---------------------------------------------------------
# APT # Distribution packages
# --------------------------------------------------------- # ---------------------------------------------------------
- name: Update apt cache - name: Update Debian-family packages
ansible.builtin.apt: ansible.builtin.include_role:
update_cache: true name: update_apt
lock_timeout: 300 when: ansible_facts.os_family == 'Debian'
- name: Perform full upgrade - name: Update Arch Linux packages
ansible.builtin.apt: ansible.builtin.include_role:
upgrade: full name: update_arch
autoremove: true when: ansible_facts.os_family == 'Archlinux'
autoclean: true
lock_timeout: 300
register: apt_upgrade
retries: 3
delay: 10
until: apt_upgrade is succeeded
- name: Fix broken packages - name: Skip unsupported Linux distribution
ansible.builtin.command: ansible.builtin.debug:
cmd: apt-get -f install -y msg: >-
register: fix_result Package updates are not configured for
failed_when: false {{ ansible_facts.distribution }} ({{ ansible_facts.os_family }}).
changed_when: "'Setting up' in fix_result.stdout" when: ansible_facts.os_family not in ['Debian', 'Archlinux']
# --------------------------------------------------------- # ---------------------------------------------------------
# Flatpak # Flatpak
@@ -144,4 +138,4 @@
- portainer - portainer
tags: tags:
- never - never
- portainer - portainer