From 3e82c124ed36c055e26eb471db13562394d39ff2 Mon Sep 17 00:00:00 2001 From: przemyslavic <43173646+przemyslavic@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:27:50 +0200 Subject: [PATCH] Update AlmaLinux 8 GPG key --- .../src/mode/red_hat_family_mode.py | 6 ++++++ .../repository/tasks/RedHat/install-packages.yml | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py index 239169794c..a64264f937 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py +++ b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/red_hat_family_mode.py @@ -7,6 +7,7 @@ from src.command.command import Command from src.config.config import Config from src.config.os_type import OSArch +from src.config.os_type import OSType from src.mode.base_mode import BaseMode, load_yaml_file @@ -81,6 +82,11 @@ def _install_base_packages(self): # Ensure ca-certificates package is in the latest version self._tools.dnf.install('ca-certificates', ignore_already_installed_error=True) + # Update AlmaLinux 8 GPG key + # https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/ + if self._cfg.os_type == OSType.Almalinux: + self._tools.dnf.install('almalinux-release', ignore_already_installed_error=True) + for package in self.__base_packages: if not self._tools.rpm.is_package_installed(package): self._tools.dnf.install(package) diff --git a/ansible/playbooks/roles/repository/tasks/RedHat/install-packages.yml b/ansible/playbooks/roles/repository/tasks/RedHat/install-packages.yml index c56e0b70fc..5b3a917080 100644 --- a/ansible/playbooks/roles/repository/tasks/RedHat/install-packages.yml +++ b/ansible/playbooks/roles/repository/tasks/RedHat/install-packages.yml @@ -27,3 +27,17 @@ retries: 3 delay: 1 until: result is succeeded + +# https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/ +- name: Update AlmaLinux 8 GPG key + yum: + name: + - almalinux-release + state: present + register: result + retries: 3 + delay: 1 + until: result is succeeded + when: + - ansible_distribution == 'AlmaLinux' + - ansible_distribution_major_version == '8'