cookbook 'ulimit2', '~> 0.2.0'
ulimit2 (3) Versions 0.2.0 Follow4
Installs/Configures ulimit parameters
cookbook 'ulimit2', '~> 0.2.0', :supermarket
knife supermarket install ulimit2
knife supermarket download ulimit2
ulimit2 Cookbook
A cookbook to set resource limits via ulimit.
Requirements
Ruby 1.9 or later
Should support any linux platform, but has been tested successfully on:
- rhel >= 5.0
- centos >= 5.0
- fedora >= 17.0
- debian >= 6.0
- ubuntu >= 12.04
Attributes
ulimit2::default
['ulimit']['conf_dir']
Type: String
Description: The directory to store the config file in
Default: /etc/security/limits.d['ulimit']['conf_file']
Type: String
Description: The file containing the resource limits
Default: 999-chef-ulimit.conf
Usage
ulimit2::default
Set attributes in the ulimit/params namespace to set resource limits. Example values:
node.set['ulimit']['params']['default']['nofile'] = 2000 # Set hard and soft open file limit to 2000 for all users
node.set['ulimit']['params']['default']['nproc']['soft'] = 2000 # Set the soft per-user process limit to 2000 for all users
node.set['ulimit']['params']['root']['nofile']['soft'] = 8000 # Set the soft open file limit to 8000 for the 'root' user
node.set['ulimit']['params']['root']['nofile']['hard'] = 'unlimited' # Set the hard open file limit to unlimited for the 'root' user
node.set['ulimit']['params']['@sysadmin']['nproc']['hard'] = 2500 # Set the hard process limit to 2500 for the 'sysadmin' group
Then, just include ulimit2
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[ulimit2]" ] }
For systems that don't support individual configuration files, meaning they only support settings in the /etc/security/limits.conf, set ulimit/conf_dir attribute to '/etc/security' and ulimit/conf_file attribute to 'limits.conf'; or whatever setting is appropriate to your system.
The default ulimit/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
ulimit2 CHANGELOG
This file is used to list changes made in each version of the ulimit2 cookbook.
0.1.0
- [michael.m.morris@gmail.com] - Initial release of ulimit2 cookbook
0.1.1
- [michael.m.morris@gmail.com] - Migrated to Berks 3.x, changed packaging process from tar to 'knife cookbook site share'
0.2.0
- [michael.m.morris@gmail.com] - Changes to enable Chef 12 (should still be Chef 11 compliant!)
Collaborator Number Metric
0.2.0 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.0 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.0 failed this metric
FC064: Ensure issues_url is set in metadata: ulimit2/metadata.rb:1
FC065: Ensure source_url is set in metadata: ulimit2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ulimit2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ulimit2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: ulimit2/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.0 passed this metric
Testing File Metric
0.2.0 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.0 passed this metric
0.2.0 failed this metric
0.2.0 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.0 failed this metric
FC064: Ensure issues_url is set in metadata: ulimit2/metadata.rb:1
FC065: Ensure source_url is set in metadata: ulimit2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ulimit2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ulimit2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: ulimit2/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.0 passed this metric
Testing File Metric
0.2.0 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.0 passed this metric
0.2.0 failed this metric
FC065: Ensure source_url is set in metadata: ulimit2/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ulimit2/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ulimit2/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: ulimit2/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.0 passed this metric
Testing File Metric
0.2.0 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.0 passed this metric
0.2.0 failed this metric
0.2.0 passed this metric