forked from jakub/ansible
support Arch Linux system updates
This commit is contained in:
+17
-23
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user