diff options
Diffstat (limited to 'lib/chef/resource/sysctl.rb')
-rw-r--r-- | lib/chef/resource/sysctl.rb | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb index 8604590d46..69032761a6 100644 --- a/lib/chef/resource/sysctl.rb +++ b/lib/chef/resource/sysctl.rb @@ -27,63 +27,63 @@ class Chef description "Use the **sysctl** resource to set or remove kernel parameters using the `sysctl` command line tool and configuration files in the system's `sysctl.d` directory. Configuration files managed by this resource are named `99-chef-KEYNAME.conf`." examples <<~DOC - **Set vm.swappiness**: + **Set vm.swappiness**: - ```ruby - sysctl 'vm.swappiness' do - value 19 - end - ``` + ```ruby + sysctl 'vm.swappiness' do + value 19 + end + ``` - **Remove kernel.msgmax**: + **Remove kernel.msgmax**: - **Note**: This only removes the sysctl.d config for kernel.msgmax. The value will be set back to the kernel default value. + **Note**: This only removes the sysctl.d config for kernel.msgmax. The value will be set back to the kernel default value. - ```ruby - sysctl 'kernel.msgmax' do - action :remove - end - ``` + ```ruby + sysctl 'kernel.msgmax' do + action :remove + end + ``` - **Adding Comments to sysctl configuration files**: + **Adding Comments to sysctl configuration files**: - ```ruby - sysctl 'vm.swappiness' do - value 19 - comment "define how aggressively the kernel will swap memory pages." - end - ``` + ```ruby + sysctl 'vm.swappiness' do + value 19 + comment "define how aggressively the kernel will swap memory pages." + end + ``` - This produces /etc/sysctl.d/99-chef-vm.swappiness.conf as follows: + This produces /etc/sysctl.d/99-chef-vm.swappiness.conf as follows: - ``` - # define how aggressively the kernel will swap memory pages. - vm.swappiness = 1 - ``` + ``` + # define how aggressively the kernel will swap memory pages. + vm.swappiness = 1 + ``` - **Converting sysctl settings from shell scripts**: + **Converting sysctl settings from shell scripts**: - Example of existing settings: + Example of existing settings: - ```bash - fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 kernel.sem = 250 32000 100 128 - ``` + ```bash + fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 kernel.sem = 250 32000 100 128 + ``` - Converted to sysctl resources: + Converted to sysctl resources: - ```ruby - sysctl 'fs.aio-max-nr' do - value '1048576' - end + ```ruby + sysctl 'fs.aio-max-nr' do + value '1048576' + end - sysctl 'net.ipv4.ip_local_port_range' do - value '9000 65500' - end + sysctl 'net.ipv4.ip_local_port_range' do + value '9000 65500' + end - sysctl 'kernel.sem' do - value '250 32000 100 128' - end - ``` + sysctl 'kernel.sem' do + value '250 32000 100 128' + end + ``` DOC introduced "14.0" |