Skip to content

Commit 52bb41b

Browse files
committed
chore: reorganize kernel update process
1 parent ea96cc0 commit 52bb41b

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

molecule/resources/playbooks/prepare.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,24 @@
2929
when: update_debian_kernel.changed
3030
when: ansible_distribution == "Debian"
3131

32-
# See https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
33-
- name: Import AlmaLinux 8 GPG key
34-
ansible.builtin.rpm_key:
35-
state: present
36-
key: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
37-
when:
38-
- ansible_distribution == 'AlmaLinux'
39-
- ansible_distribution_major_version == '8'
32+
- name: Prepare Alma, Fedora, and Rocky hosts
33+
block:
34+
# See https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
35+
- name: Import AlmaLinux 8 GPG key
36+
ansible.builtin.rpm_key:
37+
state: present
38+
key: https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
39+
when:
40+
- ansible_distribution == 'AlmaLinux'
41+
- ansible_distribution_major_version == '8'
4042

41-
- name: Update Alma, Fedora, and Rocky kernels
42-
ansible.builtin.dnf:
43-
name: kernel
44-
state: latest
45-
register: update_kernel
46-
when: ansible_distribution in ['AlmaLinux', 'Fedora', 'Rocky']
43+
- name: Update kernels
44+
ansible.builtin.dnf:
45+
name: kernel
46+
state: latest
47+
register: update_kernel
4748

48-
- name: Reboot systems after kernel update (if required)
49-
ansible.builtin.reboot:
50-
when: update_kernel.changed
49+
- name: Reboot systems after kernel update (if required)
50+
ansible.builtin.reboot:
51+
when: update_kernel.changed
52+
when: ansible_distribution in ['AlmaLinux', 'Fedora', 'Rocky']

0 commit comments

Comments
 (0)