Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'simp-swap', '0.7.0'
Learn more about managing modules with a PuppetfileDocumentation
Table of Contents
Description
This module manages the swappiness of a system, either directly or with a dynamic script.
See REFERENCE.md for API details.
This is a SIMP module
This module is a component of the System Integrity Management Platform, a compliance-management framework built on Puppet.
If you find any issues, they may be submitted to our bug tracker.
Setup
What swap affects
- The sysctl value
vm.swappiness
. - If enabled, the ability for the system to monitor the amount of free RAM and
dynamically set the swappiness based on monitored conditions.
- See manifests/init.pp for details.
Beginning with swap
To use this class, just include it on your system:
include 'swap'
Limitations
SIMP Puppet modules are generally intended for use on Red Hat Enterprise Linux
and compatible distributions, such as CentOS. Please see the metadata.json
file
for the most up-to-date list of supported operating systems, Puppet versions,
and module dependencies.
Development
Please read our Contribution Guide.
Acceptance tests
This module includes Beaker acceptance tests using the SIMP Beaker Helpers. By default the tests use Vagrant with VirtualBox as a back-end; Vagrant and VirtualBox must both be installed to run these tests without modification. To execute the tests run the following:
bundle install
bundle exec rake beaker:suites
Please refer to the SIMP Beaker Helpers documentation for more information.
Reference
Table of Contents
Classes
swap
: Set the swappiness of the system either by a cron job or as an absolute value.
Classes
swap
The cron job is run every 5 minutes by default. Using the cron job doesn't really make a lot of sense unless it is run reasonably often. Therefore, only minute steps are supported per crontab(5).
An absolute value setting will always override the cron job.
Parameters
The following parameters are available in the swap
class:
swappiness
dynamic_script
cron_step
maximum
median
minimum
min_swappiness
low_swappiness
high_swappiness
max_swappiness
swappiness
Data type: Integer[0,100]
Set the system to run at this swappiness and do not adjust. Take care, whatever value you place in here used as-is!
Default value: 60
dynamic_script
Data type: Boolean
Place the dynamic_swappiness script on the system and enable it.
- This can be useful, particularly in situations where you are oversubscribing VMs. However, most systems will rely on static measures.
Default value: false
cron_step
Data type: Integer[0,59]
The crontab(5) minute step value for the swappiness set.
- Has no effect if
$dynamic_script
isfalse
Default value: 5
maximum
Data type: Integer[0,100]
The percentage of memory free on the system above which we will set vm.swappiness to $min_swappiness
- Has no effect if
$dynamic_script
isfalse
Default value: 30
median
Data type: Integer[0,100]
If the percentage of free memory on the system is between this number and
$maximum
, set vm.swappiness
to $low_swappiness
.
- Has no effect if
$dynamic_script
isfalse
Default value: 10
minimum
Data type: Integer[0,100]
If the percentage of free memory on the system is between this number and
$median
, set vm.swappiness
to $high_swappiness
. If below this number,
set to $max_swappiness
.
- Has no effect if
$dynamic_script
isfalse
Default value: 5
min_swappiness
Data type: Integer[0,100]
The minimum swappiness to ever set on the system.
- Has no effect if
$dynamic_script
isfalse
Default value: 5
low_swappiness
Data type: Integer[0,100]
The next level of swappiness to jump to on the system.
- Has no effect if
$dynamic_script
isfalse
Default value: 20
high_swappiness
Data type: Integer[0,100]
The medium-high level of swappiness to set on the sysetm.
- Has no effect if
$dynamic_script
isfalse
Default value: 40
max_swappiness
Data type: Integer[0,100]
The absolute maximum to ever set the swappiness on the system.
- Has no effect if
$dynamic_script
isfalse
Default value: 80
- Mon Oct 23 2023 Steven Pritchard steve@sicura.us - 0.7.0
- [puppetsync] Add EL9 support
- Wed Oct 11 2023 Steven Pritchard steve@sicura.us - 0.6.0
- [puppetsync] Updates for Puppet 8
- These updates may include the following:
- Update Gemfile
- Add support for Puppet 8
- Drop support for Puppet 6
- Update module dependencies
- These updates may include the following:
- Wed Aug 23 2023 Steven Pritchard steve@sicura.us - 0.5.0
- Add AlmaLinux 8 support
- Mon Jun 12 2023 Chris Tessmer chris.tessmer@onyxpoint.com - 0.4.0
- Add RockyLinux 8 support
- Sat Oct 15 2022 Trevor Vaughan trevor@sicura.us - 0.3.1
- Remove unnecessary augeasproviders_core module dependency
- Thu Jun 17 2021 Chris Tessmer chris.tessmer@onyxpoint.com - 0.3.0
- Removed support for Puppet 5
- Ensured support for Puppet 7 in requirements and stdlib
- Sat Dec 19 2020 Chris Tessmer chris.tessmer@onyxpoint.com - 0.2.1
- Removed EL6 support
- Fri Jan 03 2020 Trevor Vaughan tvaughan@onyxpoint.com - 0.2.0-0
- Disable dynamic_swappiness by default
- Set static system swappiness to 60 by default
- Add EL8 support
- Add REFERENCE.md
- Fri Aug 02 2019 Robert Vincent pillarsdotnet@gmail.com - 0.2.0-0
- Drop Puppet 4 support
- Add Puppet 6 support
- Add puppetlabs-stdlib 6 support
- Wed Apr 17 2019 Jim Anderson thesemicolons@protonmail.com - 0.1.4-0
- Changed location of ruby in dynamic_swappiness.erb to point to the SIMP provided version instead of an OS provided version.
- Updated expected templates in Travis CI checks.
- Thu Mar 07 2019 Liz Nemsick lnemsick.simp@gmail.com - 0.1.3-0
- Update the upper bound of stdlib to < 6.0.0
- Update a URL in the README.md
- Mon Nov 26 2018 Trevor Vaughan tvaughan@onyxpoint.com - 0.1.3-0
- Update Travis CI deploy keys
- Fri Aug 24 2018 Nick Miller nick.miller@onyxpoint.com - 0.1.2-0
- Updates the metadata to support Puppet 5 and Oracle Linux
- Migrates acceptance tests to suites
- Adds OEL nodeset
- Update module assets
- Update badges and contribution guide URL in README.md
- Thu Jul 06 2017 Liz Nemsick lnemsick.simp@gmail.com - 0.1.1-0
- Update puppet dependency and remove OBE pe dependency in metadata.json
- Mon Dec 5 2016 Nick Miller nick.miller@onyxpoint.com - 0.1.0-0
- Initial port of code from simplib::swappiness
Dependencies
- puppet/augeasproviders_sysctl (>= 2.4.0 < 4.0.0)
- simp/simplib (>= 4.9.0 < 5.0.0)
- puppetlabs/stdlib (>= 8.0.0 < 10.0.0)
swap - A SIMP Puppet module for managing swappiness Per Section 105 of the Copyright Act of 1976, these works are not entitled to domestic copyright protection under US Federal law. The US Government retains the right to pursue copyright protections outside of the United States. The United States Government has unlimited rights in this software and all derivatives thereof, pursuant to the contracts under which it was developed and the License under which it falls. --- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.