Created
September 28, 2017 21:17
-
-
Save JustinAzoff/f9ad64ffe632e7473055e2efe52a21a1 to your computer and use it in GitHub Desktop.
puppet stuff to enable linux cpu isolation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This class defines a grub2-mkconfig exec block so that other | |
# classes can refresh it. | |
class hardware::grub { | |
exec { 'grub2-mkconfig': | |
command => '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg', | |
refreshonly => true, | |
user => 'root', | |
} | |
} | |
# This class adds options to /etc/default/grub to enable | |
# cpu isolation for bro | |
class hardware::isolcpus($cpulist="") { | |
include hardware::grub | |
if($cpulist != "") { | |
shellvar { 'GRUB_CMDLINE_LINUX_CPU_ISOLATION': | |
variable => 'GRUB_CMDLINE_LINUX', | |
ensure => present, | |
target => '/etc/default/grub', | |
value => "isolcpus=${cpulist}", | |
array_append => true, | |
quoted => 'double', | |
notify => Exec['grub2-mkconfig'], | |
} | |
shellvar { 'GRUB_CMDLINE_LINUX_CPU_NOHZ': | |
variable => 'GRUB_CMDLINE_LINUX', | |
ensure => present, | |
target => '/etc/default/grub', | |
value => "nohz_full=${cpulist}", | |
array_append => true, | |
quoted => 'double', | |
notify => Exec['grub2-mkconfig'], | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment