Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Created March 24, 2020 11:13
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 b4ldr/f60aeffeb30fd646872c87419091d012 to your computer and use it in GitHub Desktop.
Save b4ldr/f60aeffeb30fd646872c87419091d012 to your computer and use it in GitHub Desktop.
# this will create the sysctl fragment if it dosn;t exist or changes
# If the resource changes i.e. the first time its written or you change the value
# sysctl -p will be called to write al the sysctl values
# however a module from the forge may be better i have used the following in the past
# https://forge.puppet.com/thias/sysctl
# however that is old and the following newer one may be better
# https://forge.puppet.com/herculesteam/augeasproviders_sysctl
sysctl::internals::add_sysctl_fragment { "${name}":
target => $target,
content => template("sysctl/parameter_line.erb"),
order => $order,
comment => $comment,
notify => Exec['sysctl -p'],
}
exec{'sysctl -p':
refreshonly => true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment