ansible.sysctl(3) - Linux man page

Name

sysctl - Permit to handle sysctl.conf entries

Description

This module manipulates sysctl entries and performs a /sbin/sysctl -p after changing them.

Options

checks

if checks=none no smart/facultative checks will be madeif checks=before some checks performed before any update (ie. does the sysctl key is writable ?)if checks=after some checks performed after an update (ie. does kernel give back the setted value ?)if checks=both all the smart checks before and after are performed Choices: none,before,after,both. (default: both)

name

this is the short path, decimal seperated, to the sysctl entry(required)

reload

if reload=yes, performs a /sbin/sysctl -p if the sysctl_file is updatedif reload=no, does not reload sysctl even if the sysctl_file is updated Choices: yes,no. (default: yes

state

whether the entry should be present or absent Choices: present,absent. (default: present)

sysctl_file
specifies the absolute path to sysctl.conf, if not /etc/sysctl.conf (default: /etc/sysctl.conf)
value

set the sysctl value to this entry."

Examples

Set vm.swappiness to 5 in /etc/sysctl.conf

sysctl: name=vm.swappiness value=5 state=present
Remove kernel.panic entry from /etc/sysctl.conf
sysctl: name=kernel.panic state=absent sysctl_file=/etc/sysctl.conf
Set kernel.panic to 3 in /tmp/test_sysctl.conf, check if the sysctl key seems writable, but do not reload sysctl, and do not check kernel value after (not needed, because not the real /etc/sysctl.conf updated)
sysctl: name=kernel.panic value=3 sysctl_file=/tmp/test_sysctl.conf check=before reload=no

Author

David "DaviXX" CHANIAL <david.chanial@gmail.com>

See Also

ansible(1), http://ansible.github.com/modules.html#sysctl