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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | yes | The dot-separated path to the sysctl parameter (e.g. net.ipv4.ip_forward) | |
| value | string | Desired value of the sysctl parameter | ||
| state | string | present | Whether the entry should be present or absent in the sysctl file Choices: present, absent | |
| reload | bool | true | Whether to reload sysctl settings from the sysctl file after changing | |
| sysctl_file | string | /etc/sysctl.conf | Path to the sysctl configuration file | |
| sysctl_set | bool | false | Verify token value with the sysctl command and set with -w if necessary | |
| ignoreerrors | bool | false | Ignore 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