Skip to content

Commit

Permalink
Merge pull request #20 from gc-nathanh/bugfix/update-detection
Browse files Browse the repository at this point in the history
Bugfix - grubcmdline reboot detection triggered by empty values in list
  • Loading branch information
markgoddard authored Feb 21, 2024
2 parents ccba8be + 98da7e2 commit 4c89301
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/grubcmdline/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Notify reboot handler
ansible.builtin.debug:
msg: Old command line was {{ result.stdout }}
changed_when: old_cmdline != kernel_cmdline | sort | list
changed_when: old_cmdline != kernel_cmdline | select() | sort | list
notify: "{{ kernel_restart_handler }}"

- name: Slurp /etc/default/grub
Expand Down
2 changes: 1 addition & 1 deletion roles/grubcmdline/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Should match on all of the the cmd line parameters
kernel_cmdline_regex: "{{ '(' ~ kernel_cmdline | map('regex_escape') | list | join('|') ~ ')' }}" # noqa var-naming[no-role-prefix]
kernel_cmdline_regex: "{{ '(' ~ kernel_cmdline | select() | map('regex_escape') | list | join('|') ~ ')' }}" # noqa var-naming[no-role-prefix]

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

Expand Down

0 comments on commit 4c89301

Please sign in to comment.