Giter Site home page Giter Site logo

stuvusit / ansible_sysctl Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 11 KB

Ansible role to configure sysctl values

License: Creative Commons Attribution Share Alike 4.0 International

Jinja 100.00%
ansible ansible-role debian kernel sysctl linux systemd system

ansible_sysctl's Introduction

sysctl

This role can configure sysctl values (/proc/sys) and sysfs values (/sys).

Sysctl Values

The role configures sysctl values (under /etc/sysctl.d/) and restarts systemd-sysctl afterwards to apply them. The file the sysctl values is written to is called XX-ansible.conf where XX is a configurable number (default: 10). This allows to set the priority of the file if other packages/modules also place sysctl configurations to /etc/sysctl.d/. Note that when changing the value, the old file is not automatically removed.

Sysfs Values

The role installes the sysfsutils package and uses its /etc/sysfs.d/ directory to configure persistent sysfs values. Then it applies these values by restarting the sysfsutils service. The file the sysctl values is written to is called XX-ansible.conf where XX is a configurable number (default: 10). This allows to set the priority of the file if other packages/modules also place sysctl configurations to /etc/sysfs.d/. Note that when changing the value, the old file is not automatically removed.

Requirements

Debian with systemd

Role Variables

Name Default / Mandatory Description
sysctl_number 10 The number of the filename prefix
sysctl {} sysctl values to set
sysfs_number 10 The number of the filename prefix
sysfs {} sysctl values to set

Example Playbook

- hosts: all
  roles:
    - role: sysctl
      sysctl:
        net.ip6: 0
        net.bridge.bridge-nf-call-arptables: 0
      sysfs:
        bus/pci/devices/0000:01:00.0/enable: 0

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Author Information

ansible_sysctl's People

Contributors

dasj avatar neumantm avatar slothofanarchy avatar

Watchers

 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.