cookbook 'sysctl', '= 0.3.3', :supermarket
The sysctl cookbook has been deprecated
The sysctl cookbook has been deprecated and is no longer being maintained by its authors. Use of the sysctl cookbook is no longer recommended.
Configures sysctl parameters
cookbook 'sysctl', '= 0.3.3'
knife cookbook site install sysctl
knife cookbook site download sysctl
Set sysctl system control parameters via Opscode Chef
- node['sysctl']['params'] - A namespace for setting sysctl parameters
- node['sysctl']['conf_dir'] - Specifies the sysctl.d directory to be used. Defaults on Debian to /etc/sysctl.d, otherwise nil
- node['sysctl']['allow_sysctl_conf'] - Defaults to false. This will write params to /etc/sysctl.conf directly when set to true.
- apply (default)
# set vm.swapiness to 20 via attributes node.default['sysctl']['params']['vm']['swappiness'] = 20 # set vm.swapiness to 20 via sysctl_param LWRP 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
This cookbook can be tested using vagrant, but it depends on the following vagrant plugins
vagrant plugin install vagrant-omnibus vagrant plugin install vagrant-berkshelf
Tested with * Vagrant (version 1.2.2) * vagrant-berkshelf (1.2.0) * vagrant-omnibus (1.0.2)
Much of the tooling around this cookbook is exposed via thor and test kitchen, so it is highly recommended to learn more about those tools. However, to give a quick glance at how to do some tests, you can execute the following commmands
bundle install bundle exec thor tailor:lint bundle exec thor foodcritic:lint bundle exec kitchen test default-ubuntu-1204 bundle exec kitchen test default-centos-64
The above will do ruby style (tailor) and cookbook style (foodcritic) checks followed by ensuring proper cookbook operation on two separate linux platforms (Ubuntu 12.04 LTS Precise 64-bit and CentOS 6.4). Please run the tests on any pull requests that you are about to submit and write tests for defects or new features to ensure backwards compatibility and a stable cookbook that we can all rely upon.
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.
This cookbook has no specified dependencies.