salt.modules.linux_sysctl

Module for viewing and modifying sysctl parameters

salt.modules.linux_sysctl.assign(name, value, ignore=False)

Assign a single sysctl parameter for this minion

Parameters
  • name -- Name of sysctl setting

  • value -- Desired value of sysctl setting

  • ignore -- Optional boolean to pass --ignore to sysctl (Default: False)

CLI Example:

salt '*' sysctl.assign net.ipv4.ip_forward 1
salt.modules.linux_sysctl.default_config()

Linux hosts using systemd 207 or later ignore /etc/sysctl.conf and only load from /etc/sysctl.d/*.conf. This function will do the proper checks and return a default config file which will be valid for the Minion. Hosts running systemd >= 207 will use /etc/sysctl.d/99-salt.conf.

CLI Example:

salt -G 'kernel:Linux' sysctl.default_config
salt.modules.linux_sysctl.get(name, ignore=False)

Return a single sysctl parameter for this minion

Parameters
  • name -- Name of sysctl setting

  • ignore -- Optional boolean to pass --ignore to sysctl (Default: False)

CLI Example:

salt '*' sysctl.get net.ipv4.ip_forward
salt.modules.linux_sysctl.persist(name, value, config=None, ignore=False)

Assign and persist a simple sysctl parameter for this minion. If config is not specified, a sensible default will be chosen using sysctl.default_config.

Parameters
  • name -- Name of sysctl setting

  • value -- Desired value of sysctl setting

  • config -- Optional path to sysctl.conf

  • ignore -- Optional boolean to pass --ignore to sysctl (Default: False)

CLI Example:

salt '*' sysctl.persist net.ipv4.ip_forward 1
salt.modules.linux_sysctl.show(config_file=False)

Return a list of sysctl parameters for this minion

Parameters

config_file -- Pull data from the system configuration file instead of the live kernel.

CLI Example:

salt '*' sysctl.show