Sous-Chefs-Boneyard / sysctl

Licence: Apache-2.0 license
Development repository for the sysctl cookbook

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to sysctl

transmission
Development repository for the transmission cookbook
Stars: ✭ 14 (-67.44%)
Mutual labels:  chef-cookbook, chef, chef-resource
line
Development repository for the line cookbook
Stars: ✭ 96 (+123.26%)
Mutual labels:  chef-cookbook, chef, chef-resource
sssd ldap
Development repository for the sssd_ldap cookbook
Stars: ✭ 17 (-60.47%)
Mutual labels:  chef-cookbook, chef, chef-resource
golang
Development repository for the golang cookbook
Stars: ✭ 48 (+11.63%)
Mutual labels:  chef-cookbook, chef, chef-resource
selinux policy
Development repository for the selinux_policy cookbook
Stars: ✭ 17 (-60.47%)
Mutual labels:  chef-cookbook, chef, chef-resource
memcached
Development repository for the memcached cookbook
Stars: ✭ 50 (+16.28%)
Mutual labels:  chef-cookbook, chef, chef-resource
rundeck
Development repository for the rundeck cookbook
Stars: ✭ 45 (+4.65%)
Mutual labels:  chef-cookbook, chef, chef-resource
github
Development repository for the github cookbook
Stars: ✭ 22 (-48.84%)
Mutual labels:  chef-cookbook, chef, chef-resource
stunnel
Development repository for the stunnel cookbook
Stars: ✭ 14 (-67.44%)
Mutual labels:  chef-cookbook, chef, chef-resource
squid
Development repository for the squid cookbook
Stars: ✭ 27 (-37.21%)
Mutual labels:  chef-cookbook, chef, chef-resource
firewall
Development repository for the firewall cookbook
Stars: ✭ 97 (+125.58%)
Mutual labels:  chef-cookbook, chef, chef-resource
rsync
Development repository for the rsync cookbook
Stars: ✭ 25 (-41.86%)
Mutual labels:  chef-cookbook, chef, chef-resource
confluence
Development repository for the confluence cookbook
Stars: ✭ 42 (-2.33%)
Mutual labels:  chef-cookbook, chef, chef-resource
kafka
Development repository for the kafka cookbook
Stars: ✭ 87 (+102.33%)
Mutual labels:  chef-cookbook, chef, chef-resource
freebsd
Development repository for the freebsd cookbook
Stars: ✭ 27 (-37.21%)
Mutual labels:  chef-cookbook, chef, chef-resource
selinux
Development repository for the selinux cookbook
Stars: ✭ 57 (+32.56%)
Mutual labels:  chef-cookbook, chef, chef-resource
samba
Development repository for the samba cookbook
Stars: ✭ 30 (-30.23%)
Mutual labels:  chef-cookbook, chef, chef-resource
yum-epel
Development repository for the yum-epel cookbook
Stars: ✭ 23 (-46.51%)
Mutual labels:  chef-cookbook, chef, chef-resource
drbd
Development repository for the drbd cookbook
Stars: ✭ 19 (-55.81%)
Mutual labels:  chef-cookbook, chef, chef-resource
mac os x
This cookbook has been deprecated
Stars: ✭ 75 (+74.42%)
Mutual labels:  chef-cookbook, chef, chef-resource

The sysctl resource from this cookbook is now shipping as part of Chef 14. With the inclusion of this resource into Chef itself we are now deprecating this cookbook. It will continue to function for Chef 13 users, but will not be updated.

sysctl cookbook

Cookbook Version CircleCI License

Warning: Depreciated Cookbook

This cookbook is now a core resource in Chef 14.

summary:

Use the sysctl_param resource to set kernel parameters using the sysctl command line tool and configuration files in the system's sysctl.d directory. Configuration files managed by this resource are named 99-chef-KEYNAME.conf. If an existing value was already set for the value it will be backed up to the node and restored if the :remove action is used later.

Please read the changelog when upgrading from the v0.x series to the v1.x series

Requirements

Platforms

  • Amazon Linux (Integration tested)
  • Debian/Ubuntu (Integration tested)
  • RHEL/CentOS (Integration tested)
  • openSUSE (Integration tested)
  • PLD Linux
  • Exherbo
  • Arch Linux
  • SLES 12+

Chef

  • 12.7+

sysctl_param

Actions

  • :apply (default)
  • :remove

Properties

property type description
key String the path to the kernel parameter
value String, Integer, Float, Array the value to set for the kernel parameter
ignore_error True / False Should the resource fail if setting the parameter via the sysctl command line was unsuccessful

Examples

Set vm.swappiness to 20 via sysctl_param resource

Include sysctl in your metadata.rb

# metadata.rb

name 'my_app'
version '0.1.0'
depends 'sysctl'

Use the resource

# recipes/default.rb
sysctl_param 'vm.swappiness' do
  value 20
end

Remove sysctl parameter and set net.ipv4.tcp_fin_timeout back to default

sysctl_param 'net.ipv4.tcp_fin_timeout' do
  value 30
  action :remove
end

Add sysctl parameter but ignore errors if they arise

sysctl_param 'kernel.randomize_va_space' do
  value 0
  ignore_error true
end

Ohai Plugin

The cookbook also includes an Ohai plugin that can be installed by adding sysctl::ohai_plugin to your run_list. This will populate node['sys'] with automatic attributes that mirror the layout of /proc/sys.

To see Ohai plugin output manually, you can run ohai -d /etc/chef/ohai/plugins sys on the command line.

Additional Reading

There are a lot of different documents that talk about system control parameters, the hope here is to point to some of the most useful ones to provide more guidance as to what the possible kernel parameters are and what they mean.

Development

We have written unit tests using chefspec and integration tests in InSpec executed via test-kitchen. Much of the tooling around this cookbook is exposed via guard and test kitchen, so it is highly recommended to learn more about those tools. The easiest way to get started is to install the Chef Development Kit

Running tests

Install ChefDK from chefdk.io

# Run the unit & lint tests
chef exec delivery local all

# Run the integration suites
kitchen test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].