|
29 | 29 | when: update_debian_kernel.changed |
30 | 30 | when: ansible_distribution == "Debian" |
31 | 31 |
|
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' |
40 | 42 |
|
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 |
47 | 48 |
|
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