kernel-settings-sysctl-conf

Manages settings in the /etc/sysctl.conf file.

Maintainer

Nick Anderson

Module stats

Total Downloads: 529
Updated: Jan 25, 2023

Installation version

Version
Released on Jan 25, 2023

Tags

Installation

                    
cfbs add kernel-settings-sysctl-conf@1.0.1
Description
Dependencies
Discussion

Manage /etc/sysctl.conf

Manage the current configuration of /etc/sysctl.conf while keeping running settings in sync.

Note: This policy currently only ensures that specified settings are present. No statement is made about settings not specified. Thus configuration in the file will remain untouched if the key is not specified in the desired data. For example, if vm.swappiness is set to 10 in /etc/sysctl.conf and vm.swappiness is not specified the desired configuration data the existing entry for vm.swappiness will be left untouched.

Installation via cfbs

  cfbs add kernel-settings-sysctl-conf

Example Configuration

  • (Optionally) Specify the fully qualified name of the variable that will hold complete configuration data.

    • e.g. default:kernel_settings_sysctl_conf._desired_conf_data_variable = data:variables.my_sysctl
  • Define the complete configuration data desired.

    • e.g. data:variables.my_sysctl = ={ "vm.swappiness": "10", "fs.protected_hardlinks": "1",

"fs.protected_symlinks" : "1" }=

Example Configuration via Augments

In CFEngine version 3.18.0 or greater the variables key in Augments supports targeting specific variables in any namespace or bundle.

For example, here we set data:variables.my_sysctl and configure that variable for use by kernel_settings_sysctl_conf.

  {
      "variables": {
          "default:kernel_settings_sysctl_conf._desired_conf_data_variable": "data:variables.my_sysctl",
          "data:variables.my_sysctl": { "vm.swappiness": "10", "fs.protected_hardlinks": "1",
                                        "fs.protected_symlinks" : "1" }
      }
  }

Example Configuration via Host Specific data in Mission Portal

https://raw.githubusercontent.com/nickanderson/cfengine-sysctl/master/policy/kernel-settings-sysctl-conf/data/88/a9b1e8-418f-499c-96dd-6ff836ff821e/2021-10-11_12-46-01_2021-10-11_12-45-41.png

Dependencies

This module has no dependencies