How to update grub with puppet?
- by Tombart
I would like to change a line in /etc/default/grub with puppet to this:
GRUB_CMDLINE_LINUX="cgroup_enable=memory"
I've tried to used augeas which seems to do this magic:
exec { "update_grub":
command => "update-grub",
refreshonly => true,
}
augeas { "grub-serial":
context => "/files/etc/default/grub",
changes => [
"set /files/etc/default/grub/GRUB_CMDLINE_LINUX[last()] cgroup_enable=memory",
],
notify => Exec['update_grub'],
}
It seems to work, but the result string is not in quotes and also I want to make sure that any other values will be separated by space.
GRUB_CMDLINE_LINUX=cgroup_enable=memory
Is there some mechanism how to append values and escape the whole thing?
GRUB_CMDLINE_LINUX="quiet splash cgroup_enable=memory"