From 5af4c52e82a1c134985065d5d7b1b37a9d10fa0f Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 24 Aug 2023 15:03:40 +0200 Subject: [PATCH] fix: install archlinux keyring before upgrade --- tasks/main.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 83e6129..6c47d5e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,23 +35,30 @@ insertbefore: BOF when: system_arch_local_mirror is defined and arch.stdout -- name: upgrade system for arch +- name: Update archlinux-keyring + community.general.pacman: + state: latest + name: archlinux-keyring + become: true + when: arch.stdout + +- name: Upgrade system for arch pacman: state: latest # not required. choices: absent;latest;present. Desired state of the package. upgrade: true # not required. Whether or not to upgrade whole system. force: true # not required. When removing package - force remove package, without any checks. When update_cache - force redownload repo databases. update_cache: true - become: yes + become: true register: upgrade when: arch.stdout -- name: upgrade system for debian +- name: Upgrade system for debian apt: update_cache: yes # not required. Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as a separate step. only_upgrade: yes # not required. Only upgrade a package if it is already installed. upgrade: full # not required. choices: dist;full;no;safe;yes. If yes or safe, performs an aptitude safe-upgrade.,If full, performs an aptitude full-upgrade.,If dist, performs an apt-get dist-upgrade.,Note: This does not upgrade a specific package, use state=latest for that.,Note: Since 2.4, apt-get is used as a fall-back if aptitude is not present. state: latest # not required. choices: absent;build-dep;latest;present. Indicates the desired package state. C(latest) ensures that the latest version is installed. C(build-dep) ensures the package build dependencies are installed. - become: yes + become: true when: debian.stdout register: upgrade