trying to make sure my grub conf file contains a string,
cat /etc/default/grub
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto audit=1 rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet" GRUB_DISABLE_RECOVERY="true"
my manifest has this,
$file = '/etc/default/grub'
file_line { "(5.2.3) - ${file}: audit=1":
ensure => present,
path => $file,
line => 'audit=1',
match => '^GRUB_CMDLINE_LINUX=".*audit=1.*$',
}
I used Rubular regex editor and the regex works in rubular, it should match the line and pass, since hte line contains "audit=1", but during puppet run, it throws an exception,
/Stage[main]/Cis_rhel7::Rule::Rule_5_2_3/File_line[(5.2.3) - /etc/default/grub: audit=1]/ensure: current_value absent, should be present (noop)
Cant figure out why its not matching. Thanks.