Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

limits (7) Versions 1.0.0

Configures limits for the pam_limits module

Policyfile
Berkshelf
Knife
cookbook 'limits', '= 1.0.0', :supermarket
cookbook 'limits', '= 1.0.0'
knife supermarket install limits
knife supermarket download limits
README
Dependencies
Changelog
Quality 33%

Limits Cookbook

This cookbook is used to configure system limits.conf as well as limits.d configuration files. It is available at the Supermarket or GitHub.

Platforms

  • Debian
  • Ubuntu
  • Fedora
  • CentOS
  • Red Hat

This should work on most linux platforms, but it has not been explicitly testing unless in the list above.

Attributes

Under most circumstances, these can be left at the defaults.

Key Type Description Default
['limits']['system_conf'] String Location of system-wide limits.conf /etc/security/limits.conf
['limits']['conf_dir'] String Location of limits.d directory /etc/security/limits.d

Usage

set_limit

Attribute Parameters

Key Type Description Default
use_system Boolean Set a system-wide limit? false
filename String Filename that will contain limit {resource name}, unused if use_system == true
domain String or Integer domain of limit {resource name}
type String or Integer type of limit nil
item String or Integer item of limit nil
value String or Integer value of limit nil

Examples

# Limits for Alice

set_limit 'alice' do
  type 'hard'
  item 'nofile'
  value 2048
end

set_limit 'alice' do
  type 'soft'
  item 'nofile'
  value 1024
end

# System-wide limits

set_limit '*' do
  type 'hard'
  item 'nofile'
  value 4096
  use_system true
end

set_limit '*' do
  type 'soft'
  item 'nofile'
  value 1024
  use_system true
end

Would render:

# /etc/security/limits.d/alice.conf

alice hard nofile 2048
alice soft nofile 1024
# /etc/security/limits.conf

* hard nofile 4096
* soft nofile 1024

LWRP

limits_config

Actions

Name Description
:create creates limits config file (default)
:delete deletes limits config file

Attribute Parameters

Key Type Description Default
use_system Boolean Set system-wide limits? false
filename String Filename that will contain limits {resource name}, unused if use_system == true
limits Array Array of limits (see examples) []

Examples

# Limits for Alice

limits_config 'alice' do
  limits [
    { domain: 'alice', type: 'hard', item: 'nofile', value: 2048 },
    { domain: 'alice', type: 'soft', item: 'nofile', value: 1024 }
  ]
end

# System-wide limits

limits_config 'system-wide limits' do
  limits [
    { domain: '*', type: 'hard', item: 'nofile', value: 4096 },
    { domain: '*', type: 'soft', item: 'nofile', value: 1024 }
  ]
  use_system true
end

Would render:

# /etc/security/limits.d/alice.conf

alice hard nofile 2048
alice soft nofile 1024
# /etc/security/limits.conf

* hard nofile 4096
* soft nofile 1024

Testing

Testing was performed using Chef Development Kit 0.3.5.

ChefSpec

chef exec rspec

Serverspec (through Test Kitchen)

kitchen test

License and Author

The MIT License (MIT)

Copyright (c) 2014 Jordan Wesolowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

limits cookbook CHANGELOG

This file is used to list changes made in each version of the limits cookbook.

v1.0.0 (2014-12-07)

Breaking Changes

Cookbook has changed to be an LWRP-only usage. No longer will limits be able to be specified using attributes. Please see the readme for usage examples.

Testing

  • Perform all testing and development with ChefDK
  • Add ChefSpec tests
  • Add Serverspec tests

License

  • Change license from Apache to MIT

v0.2.0 (2014-04-09)

  • Initial release of limits

Collaborator Number Metric
            

1.0.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

1.0.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
            

1.0.0 failed this metric

FC064: Ensure issues_url is set in metadata: limits/metadata.rb:1
FC065: Ensure source_url is set in metadata: limits/metadata.rb:1
FC066: Ensure chef_version is set in metadata: limits/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

1.0.0 passed this metric

Testing File Metric
            

1.0.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
            

1.0.0 passed this metric