Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - grubcmdline reboot detection triggered by empty values in list #20

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

gc-nathanh
Copy link
Contributor

This relates to #17. @jjo93sa 's fix correctly manages empty values for the grub.cfg, but a reboot signal is still sent by:

changed_when: old_cmdline != kernel_cmdline | sort | list

There are two things that break the comparison:

Firstly:
kernel_cmdline | sort | list contains the empty values

and then, the empty values break the kernel_cmdline_regex filter here:

old_cmdline: "{{ result.stdout.split() | select('search', kernel_cmdline_regex) | sort | list }}"

and old_cmdline is then populated with the full /proc/cmdline:

TASK [stackhpc.grubcmdline : debug old_cmdline] ********************************************************************************
Tuesday 20 February 2024  10:36:17 +0000 (0:00:00.095)       0:00:04.813 ******
ok: [gbnwp-pipusm002] =>
  msg: 'old_cmdline: [''amd_iommu=on'', ''BOOT_IMAGE=(lvmid/BYn8R2-JzSS-JlkG-1cdt-x3rv-NJSM-5gtfuL/Vy29GZ-3MKn-0ipZ-yAG9-t0ya-DOGq-TAj4iB)/boot/vmlinuz-5.14.0-284.30.1.el9_2.x86_64'', ''console=tty0'', ''console=ttyS0,115200'', ''default_hugepagesz=1G'', ''gfxpayload=text'', ''hugepages=0'', ''hugepagesz=1G'', ''i40e.blacklist=1'', ''intel_idle.max_cstate=0'', ''iommu=pt'', ''net.ifnames=1'', ''no_timer_check'', ''nofb'', ''nomodeset'', ''processor.max_cstate=1'', ''rd.driver.blacklist=i40e'', ''ro'', ''root=LABEL=rootfs'', ''transparent_hugepage=always''] '

rather than the expected

TASK [stackhpc.grubcmdline : debug old_cmdline] ************************************************************************************************************
Tuesday 20 February 2024  10:44:01 +0000 (0:00:00.094)       0:00:06.160 ******
ok: [gbnwp-pipusm002] =>
  msg: 'old_cmdline: [''amd_iommu=on'', ''default_hugepagesz=1G'', ''hugepages=0'', ''hugepagesz=1G'', ''intel_idle.max_cstate=0'', ''iommu=pt'', ''processor.max_cstate=1'', ''transparent_hugepage=always''] '

@gc-nathanh gc-nathanh requested a review from a team as a code owner February 20, 2024 11:21
@markgoddard markgoddard merged commit 4c89301 into stackhpc:main Feb 21, 2024
4 checks passed
@markgoddard
Copy link

Thanks Nathan.

@markgoddard
Copy link

Released in 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants