robertdebock.sysctl

Ansible Role Sysctl

This role is used to set system parameters using sysctl.

GitHub GitLab Downloads Version
github gitlab downloads Version

Example Playbook

Here is an example playbook using this role. It is taken from molecule/default/converge.yml and is tested every time changes are made.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.sysctl
      sysctl_items:
        - name: net.ipv4.ip_forward
          value: 1

Before running the playbook, prepare the machine. This can be done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap

For more details, see the full explanation and example.

Role Variables

Default variable values can be found in defaults/main.yml:

---
# defaults file for sysctl

# Set true to verify token value with the sysctl command
sysctl_set: true

# If true, performs a /sbin/sysctl -p if the sysctl_file is updated
sysctl_reload: true

Requirements

State of Used Roles

The following roles are used to prepare a system, but you can use a different approach.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab

Context

This role is part of a collection of compatible roles. For further information, check the documentation of these roles.

Here’s an overview of related roles: dependencies

Compatibility

This role has been tested on the following container images:

Container Tags
Alpine all
EL 9
Debian all
Fedora all
Ubuntu all

Ansible version 2.12 or higher is required. Tests have been conducted on:

  • The previous version.
  • The current version.
  • The development version.

If you encounter any issues, please report them on GitHub.

License

The role is licensed under Apache-2.0.

Author Information

Created by robertdebock.

Feel free to consider sponsoring me.

Informazioni sul progetto

Configure sysctl on your system.

Installa
ansible-galaxy install robertdebock.sysctl
Licenza
apache-2.0
Download
555.8k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.