Am Dienstag, 19. Juli 2016 17:36:36 UTC+2 schrieb mike r: > > 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 > <http://rd.lvm.lv>=rhel/root rd.lvm.lv <http://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. >
this searches for ^GRUB_CMDLINE.*, removes the complete line and adds just "audit=1". Don't think this is your intention. I use https://forge.puppet.com/herculesteam/augeasproviders_grub to manage grub kernel params. - Thomas -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f6eed6be-234b-4e0d-9e1b-5e0a976720c7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
