Ensure $tuned_params is restored after grub2-mkconfig

The playbook cli-overcloud-node-kernelargs.yaml calls the tuned role
and then the tripleo_kernel role.

The tuned role executes the following command:
    tuned-adm profile throughput-performance

This has the side-effect of adding $tuned_params to the options line
of /boot/loader/entries files, which is required to add its kernel
arguments from /boot/grub2/grubenv.

However when grub2-mkconfig is called, $tuned_params is *removed* from
the /boot/loader/entries files, breaking the enablement of the tuned
profile.

This change runs tuned-adm after grub2-mkconfig, which adds back
$tuned_params if there is an active profile.

Change-Id: I6edef63e60623ea3b51386593d76b18092dd7f30
Resolves: rhbz#2122949
This commit is contained in:
Steve Baker 2022-11-17 10:39:31 +13:00
parent c8d2fbb089
commit 55c724fefa
1 changed files with 15 additions and 0 deletions

View File

@ -168,6 +168,21 @@
dest: "{{ item.stat.path }}/grubenv"
when: item.stat.exists|bool
loop: "{{ grub_stat.results }}"
- name: Check for active tuned profile
stat:
path: "/etc/tuned/active_profile"
register: tuned_active_profile
- name: Ensure $tuned_params is restored to /boot/loader/entries files
shell: >-
tuned-adm profile $(cat /etc/tuned/active_profile)
environment:
PATH: "/bin:/usr/bin:/sbin:/usr/sbin"
when:
- tuned_active_profile.stat.exists
- tuned_active_profile.stat.size | int > 0
- name: Set reboot required fact
set_fact:
reboot_required: true