Skip to content

Instantly share code, notes, and snippets.

/complex.sls Secret

Created September 24, 2016 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4876a228b9f399f848ca4ca2a668b70f to your computer and use it in GitHub Desktop.
Save anonymous/4876a228b9f399f848ca4ca2a668b70f to your computer and use it in GitHub Desktop.
IF not regex.match('GRUB_CMDLINE_LINUX_DEFAULT=".*?"') then
append_to_file
else if regex.match('GRUB_CMDLINE_LINUX_DEFAULT=".*?"') then
replace_in_file
finally
grub2-mkconfig /boot/grub2/grub.cfg -o /boot/grub2/grub.cfg
end
kernel.grub_args:
file.replace:
- path: /etc/default/grub
- repl: 'GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on isolcpus=1-15,17-31 nohz_full=1-15,17-31 rcu_nocbs=1-15,17-31 default_hugepagesz=1GB hugepagesz=1GB hugepages=8"'
- pattern: 'GRUB_CMDLINE_LINUX_DEFAULT=".*?"'
- flags: ['IGNORECASE', 'MULTILINE']
#cat /proc/cmdline
#grub2-mkconfig /boot/grub2/grub.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment