sysctl

Collection: posix

Full Name: parallax.posix.sysctl

Aliases: ansible.posix.sysctl, sysctl

Synopsis

Set kernel parameters and persist them to a sysctl file

Parameters

NameTypeRequiredDefaultDescription
namestringyesThe dot-separated path to the sysctl parameter (e.g. net.ipv4.ip_forward)
valuestringDesired value of the sysctl parameter
statestringpresentWhether the entry should be present or absent in the sysctl file Choices: present, absent
reloadbooltrueWhether to reload sysctl settings from the sysctl file after changing
sysctl_filestring/etc/sysctl.confPath to the sysctl configuration file
sysctl_setboolfalseVerify token value with the sysctl command and set with -w if necessary
ignoreerrorsboolfalseIgnore errors about unknown keys

Example

- name: Allow the app to bind to low ports
  sysctl:
    name: net.ipv4.ip_unprivileged_port_start
    value: "80"
    sysctl_file: /etc/sysctl.d/99-app.conf
    reload: true
    state: present