Skip to content

Commit 4c89301

Browse files
authored
Merge pull request #20 from gc-nathanh/bugfix/update-detection
Bugfix - grubcmdline reboot detection triggered by empty values in list
2 parents ccba8be + 98da7e2 commit 4c89301

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

roles/grubcmdline/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- name: Notify reboot handler
1212
ansible.builtin.debug:
1313
msg: Old command line was {{ result.stdout }}
14-
changed_when: old_cmdline != kernel_cmdline | sort | list
14+
changed_when: old_cmdline != kernel_cmdline | select() | sort | list
1515
notify: "{{ kernel_restart_handler }}"
1616

1717
- name: Slurp /etc/default/grub

roles/grubcmdline/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# Should match on all of the the cmd line parameters
3-
kernel_cmdline_regex: "{{ '(' ~ kernel_cmdline | map('regex_escape') | list | join('|') ~ ')' }}" # noqa var-naming[no-role-prefix]
3+
kernel_cmdline_regex: "{{ '(' ~ kernel_cmdline | select() | map('regex_escape') | list | join('|') ~ ')' }}" # noqa var-naming[no-role-prefix]
44

55
kernel_cmdline_sorted: "{{ kernel_cmdline | sort }}" # noqa var-naming[no-role-prefix]
66

0 commit comments

Comments
 (0)