Skip to content

Instantly share code, notes, and snippets.

@JustinAzoff
Created September 28, 2017 21:17
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 JustinAzoff/f9ad64ffe632e7473055e2efe52a21a1 to your computer and use it in GitHub Desktop.
Save JustinAzoff/f9ad64ffe632e7473055e2efe52a21a1 to your computer and use it in GitHub Desktop.
puppet stuff to enable linux cpu isolation
# 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