Align kernel args for system upgrade using leapp

leapp is looking for errors in /etc/default/grub and
fixes it during upgrade. It does not recognize entries
starting other than "GRUB", as tripleo sets the entry
starting with TRIPLEO_ instead of GRUB, append the
entry with GRUB_ so that leapp upgrades correctly.
Closes-Bug: #1890080
Change-Id: I9238cd35a1114b1649a38ab4f24225865bcecf19
(cherry picked from commit f217eccc77)
This commit is contained in:
Saravanan KR 2020-07-23 14:38:25 +05:30
parent aeaf98134c
commit 2f382ac90a
1 changed files with 20 additions and 0 deletions

View File

@ -98,3 +98,23 @@ outputs:
vars:
tripleo_kernel_args: {get_attr: [RoleParametersValue, value, kernel_args]}
tripleo_kernel_reboot_timeout: {get_param: NodeRebootWaitTimeout}
upgrade_tasks:
- name: upgrade prepare for leapp to align kernel arg shortcommings in leapp
tags:
- never
- system_upgrade
- system_upgrade_prepare
when:
- step|int == 3
- upgrade_leapp_enabled
block:
- name: fix grub entries to have name start with GRUB_
replace:
path: '/etc/default/grub'
regexp: '^(TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS)(.*)'
replace: 'GRUB_\1\2'
- name: fix grub entries in append statement
replace:
path: '/etc/default/grub'
regexp: '(.*){(TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS)}(.*)'
replace: '\1{GRUB_\2}\3'