Code Monkey home page Code Monkey logo

sysctl-formula's Introduction

sysctl-formula

Travis CI Build Status Semantic Release

Formula to set up and configure sysctl.

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

Commit message formatting is significant!!

Please see How to contribute for more details.

Installs and configures the sysctl package.

Installs the sysctl package.

This state manages the file sysctl.conf under /etc/sysctl (template found in "sysctl/files"). The configuration is populated by values in "sysctl/map.jinja" based on the package's default values (and RedHat, Debian, Suse and Arch family distribution specific values), which can then be overridden by values of the same name in pillar.

Linux testing is done with kitchen-salt.

  • Ruby
  • Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

Creates the docker instance and runs the sysctl main state, ready for testing.

Runs the inspec tests on the actual instance.

Removes the docker instance.

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

Gives you SSH access to the instance for manual testing.

sysctl-formula's People

Contributors

abednarik avatar aboe76 avatar baby-gnu avatar dafyddj avatar dmaphy avatar javierbertoli avatar mgomersbach avatar myii avatar n-rodriguez avatar nmadhok avatar noelmcloughlin avatar puneetk avatar semantic-release-bot avatar wwentland avatar zajk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sysctl-formula's Issues

Remove readme example

The example pillar in the readme differs from the pillar.example which caused a bit of confusion as to why it wasn't working. Recommend just removing that example so it just gets maintained in one spot :)

fs-file-max and vm.swappiness sensible defaults?

The current defaults.yml (below) sets default params fs-file-max:100000 and vm.swappiness:20 . Are these truly good sensible defaults that we should always be applying? I am the opposite of an expert on these params, but looking at upvoted stackoverflow answers, I think these defaults should be removed from the formula if possible.

swappiness Q&A on stackexchange
"The default value [60] has most likely been chosen as an approximate middleground between these two extremes. As with any performance parameter, adjusting vm.swappiness should be based on benchmark data comparable to real workloads, not just a gut feeling"

fs-file-max Q&A on stackoverflow
"For fs.file-max, I think in almost all cases you can just leave it alone" and
"The 2.6 kernel automatically tunes fs.file-max based on available memory"

# -*- coding: utf-8 -*-
# vim: ft=yaml
sysctl:
  pkg: procps-ng
  config:
    location: '/etc/sysctl.d'
  lookup:
    params:
      -
        name: fs.file-max
        value: 100000
        config: fs.conf
      -
        name: vm.swappiness
        value: 20

Fixed/Tested with Centos 6/7

Appears this wasn't working with RedHat family 6/7. /etc/sysctl.conf is a file, but was being used as a directory. Also, /etc/sysctl.d exists on both. Finally, the package names are different for 6 & 7. I've created #20 to resolve.

Occasional code tags

Hi, it would be great if you could create tags on all formulas (quarterly, monthly,...) so they could be easily used without risking future updates breaking something. This way users could easily use formulas as:

gitfs_remotes:
  - https://github.com/saltstack-formulas/sysctl-formula:
    - base: <Some tag>

without creating fork for each formula they use. Then as formulas are updated users could test new versions and pull them in their system in a more controlled way.

Make params a dictionary, not array

Do you think that params should be set as dictionary instead of array? With current implementation it is impossible to override defaults params without redefining all of them. E.g. if i set defaults like this:

sysctl:
  lookup:
    pkg: procps
    config:
      location: '/etc/sysctl.conf'
    params:
      - name: net.ipv4.ip_forward
        value: 1
      - name: net.core.somaxconn
        value: 65536
      - name: fs.file-max
        value: 65536
      - name: vm.swappiness
        value: 60

and want to override some param, e.g vm.swappiness for certain set of servers I'd need to redefine all params above instead of just redefining vm.swappiness. But if params were set like dictionary:

sysctl:
  lookup:
    pkg: procps
    config:
      location: '/etc/sysctl.conf'
    params:
      net.ipv4.ip_forward:
        value: 1
      net.core.somaxconn:
        value: 65536
      fs.file-max:
        value: 65536
        config: fs.conf
      vm.swappiness:
        value: 60

overriding vm.swappiness would require following configuration:

sysctl:
  lookup:
    params:
      vm.swappiness:
        value: 20

Thoughts?

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.