Skip to content

Commit

Permalink
remove duplicate doca play and debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiethorpe committed Jan 3, 2025
1 parent bf512b1 commit 7710537
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
8 changes: 0 additions & 8 deletions ansible/fatimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,6 @@
name: cloudalchemy.grafana
tasks_from: install.yml

- hosts: doca
become: yes
gather_facts: yes
tasks:
- name: Install NVIDIA DOCA
import_role:
name: doca

- name: Run post.yml hook
vars:
appliances_environment_root: "{{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
Expand Down
30 changes: 10 additions & 20 deletions ansible/roles/doca/tasks/install-kernel-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,22 @@
register: _ofed_loaded_kernel
changed_when: false

- name: Parse installed kernels
set_fact:
_ofed_dnf_kernels_sorted: >-
{{ _ofed_dnf_kernels.stdout_lines[1:]
| map('split')
| map(attribute=1)
| community.general.version_sort }}
# dnf line format e.g. "kernel.x86_64 4.18.0-513.18.1.el8_9 @baseos "

- name: Check current kernel is newest installed
assert:
that:
- _ofed_loaded_kernel.stdout in _ofed_dnf_kernels_sorted
- _ofed_loaded_kernel.stdout == _ofed_dnf_kernels_sorted[-1]
fail_msg: >
Loaded kernel ({{ _ofed_loaded_kernel.stdout }}) is not the newest installed kernel.
Newest installed kernel: {{ _ofed_dnf_kernels_sorted[-1] }}.
Consider rebooting to use the latest kernel.
- name: Debug kernel versions
debug:
msg:
- "Loaded Kernel: {{ _ofed_loaded_kernel.stdout }}"
- "Installed Kernels: {{ _ofed_dnf_kernels.stdout_lines[1:] | map('split') | map(attribute=1) }}"
- "Newest Installed Kernel: {{ _ofed_dnf_kernels_sorted[-1] }}"

- name: Check current kernel is newest installed
assert:
that: _ofed_kernel_current == _ofed_dnf_kernels_newest
fail_msg: "Kernel {{ _ofed_loaded_kernel.stdout }} is loaded but newer {{ _ofed_dnf_kernels_newest }} is installed: consider rebooting?"
vars:
_ofed_kernel_current: >-
{{ _ofed_loaded_kernel.stdout | regex_replace('\.(?:.(?!\.))+$', '') | regex_replace('\.(?:.(?!\.))+$', '') }}
_ofed_dnf_kernels_newest: >-
{{ _ofed_dnf_kernels.stdout_lines[1:] | map('split') | map(attribute=1) | map('regex_replace', '\.(?:.(?!\.))+$', '') | community.general.version_sort | last }}
# dnf line format e.g. "kernel.x86_64 4.18.0-513.18.1.el8_9 @baseos "

- name: Install matching kernel-devel package
dnf:
Expand Down

0 comments on commit 7710537

Please sign in to comment.