file.replace:
- name: /etc/default/grub
- pattern: '^(GRUB_CMDLINE_LINUX(.(?!audit=1))*)(.audit=1)?(.*")$'
- repl: '\1 audit=1 \4'
- unless: grep audit=1
/etc/default/grub
/etc/grub2.cfg:
file.symlink:
- target: {{ BOOT }}
- force: True
- backupname: /etc/grub2.cfg.bak
- user: root
- group: root
make_config_if_changed:
cmd.run:
- name: /usr/sbin/grub2-mkconfig -o {{ BOOT }}
- onchanges_any:
- file: remove_ipv6_disable
- file: slub
- file: update_GRUB_CMDLINE
- file: remove_crashkernel
- file: add_boot_time_audit
The problem is the grub2-mkconfig is running every time even if no changes are made in any of the referenced stanzas. I want to OR the results of each of those stanzas. If any one changes, then run the grub2-mkconfig. It is running even if nothing changes.