cookbook 'sysctl2', '~> 0.2.1'
sysctl2 (4) Versions 0.2.1 Follow1
Installs/Configures sysctl kernel parameter settings
cookbook 'sysctl2', '~> 0.2.1', :supermarket
knife supermarket install sysctl2
knife supermarket download sysctl2
sysctl2 Cookbook
A cookbook to configure kernel parameters on a system. It supports configuring files in /etc/sysctl.d, and in /etc/sysctl.conf directly (mainly to support RHEL/CentOS 5 & 6).
Requirements
Ruby 1.9 or later
Should support any linux platform, but has been tested successfully on:
- rhel >= 5.0
- centos >= 5.0
- ubuntu >= 12.04
- fedora >= 17.0
Attributes
sysctl2::default
['sysctl']['conf_dir']
Type: String
Description: The directory where the config file is located
Default: /etc/sysctl.d['sysctl']['conf_file']
Type: String
Description: The config file name
Default: 999-chef-sysctl.conf
Usage
sysctl2::default
Set attributes in the sysctl/params namespace to configure kernel parameters. Example values:
node.set['sysctl']['params']['kernel.sysrq'] = 0
node.set['sysctl']['params']['net.ipv4.ip_local_port_range'] = '30000 65000'
Then, just include sysctl2
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[sysctl2]" ] }
For platforms that don't support setting parameters via files in the /etc/sysctl.d directory (RHEL/CentOS 6 and lower), setting the sysctl/conf_dir attribute to '/etc' and the sysctl/conf_file attribute to 'sysctl.conf' will allow you to set kernel parameters in the correct/expected location for that platform. Unfortunatly, that also means that you'll need to be aware of kernel parameter changes in other recipies, and be sure to include them in your attribute list, in order to not miss them.
The default sysctl/conf_file attribute value gives us a reasonable chance of being the last config file applied. The files are processed according to their ASCII sort order, so there is still room to add more files to be processed after the recipe default file by naming the config file with leading character prefixes (ex. zzz-last.conf).
License and Authors
Authors: Michael Morris
License: 3-clause BSD
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
sysctl2 CHANGELOG
This file is used to list changes made in each version of the sysctl2 cookbook.
0.1.0
- [michael.m.morris@gmail.com] - Initial release of sysctl2 cookbook
0.1.1
- [michael.m.morris@gmail.com] - Moved bundle process from tar to 'knife cookbook site share'
0.2.0
- [michael.m.morris@gmail.com] - Updates to enable Chef 12 support (should still be Chef 11 compliant!)
Collaborator Number Metric
0.2.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.1 failed this metric
FC064: Ensure issues_url is set in metadata: sysctl2/metadata.rb:1
FC065: Ensure source_url is set in metadata: sysctl2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sysctl2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: sysctl2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: sysctl2/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.1 passed this metric
Testing File Metric
0.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.1 passed this metric
0.2.1 failed this metric
0.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.1 failed this metric
FC064: Ensure issues_url is set in metadata: sysctl2/metadata.rb:1
FC065: Ensure source_url is set in metadata: sysctl2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sysctl2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: sysctl2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: sysctl2/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.1 passed this metric
Testing File Metric
0.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.1 passed this metric
0.2.1 failed this metric
FC065: Ensure source_url is set in metadata: sysctl2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: sysctl2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: sysctl2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: sysctl2/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.1 passed this metric
Testing File Metric
0.2.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.1 passed this metric
0.2.1 failed this metric
0.2.1 passed this metric