GithubHelp home page GithubHelp logo

sysctl-cookbook's Introduction

DESCRIPTION

Manage sysctl via a sysctl LWRP.

Attributes

Name Value Description
default[:sysctl][:values] {} Hash Of Key Value pairs the attribute_driver recipe uses.
default[:sysctl][:config_file] rhel: "/etc/sysctl.conf" debian: "/etc/sysctl.d/99-chef.conf" The file to write values to.

Recipes

Name Description
attribute_driver.rb Reads attributes set in node[:sysctl][:values], and sets sysctl resources with the values
default.rb Simply sets up the resources needed to use the lwrp
library.rb Empty recipe if you want to avoid default, but still want to explicitly include (for whatever reason)

Sysctl LWRP

Attributes

Name Type Default Description
name String :name_attribute The key name. Defaults to the resource name i.e. sysctl "some.key"
value String, Fixnum, Integer The Value for this key
save boolean true save the setting back to the node data (default: false)

Actions

action default Description
:set yes Make sure the running state is set (default)
:write yes Write the config file (default)

Known Bugs

  • RHEL/CentOS 6 now have sysctl.d Directory, we should generate a config in this dir instead
  • only intended to be used on Linux

Example Usage

LWRP

Ensure running state, and write this key to sysctl.conf

sysctl "kernel.sysrq" do
   value 1
end

Check out [example/recipes/example.rb] 2 For more recipe examples.

ChefSpec Matchers

There are chefspec matchers in this cookbook to test your usage of the lwrp

set_sysctl

matcher for the set action

write_sysctl

matcher for the write action

Attributes

In a role attribute or override:

{
  "sysctl": {
    "values": {
     "net.ipv4.tcp_window_scaling": 0
    }
  }
}

Check out [example/attributes/example.rb] 1 For more attribute examples.

Author and License

Author Jesse Nelson [email protected]

Copyright 2011-2013, Jesse Nelson

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

sysctl-cookbook's People

Contributors

davidc-donorschoose avatar mzdrahal avatar skingry avatar spheromak avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.