From f217eccc7720250a64a0877061063acf0951b495 Mon Sep 17 00:00:00 2001 From: Saravanan KR Date: Thu, 23 Jul 2020 14:38:25 +0530 Subject: [PATCH] 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 --- .../kernel-boot-params-baremetal-ansible.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/deployment/kernel/kernel-boot-params-baremetal-ansible.yaml b/deployment/kernel/kernel-boot-params-baremetal-ansible.yaml index 2d390008d7..869fbe5acf 100644 --- a/deployment/kernel/kernel-boot-params-baremetal-ansible.yaml +++ b/deployment/kernel/kernel-boot-params-baremetal-ansible.yaml @@ -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'