Default variables

Swap file configuration

swapfile_size

Default size of swap files, in MB.

swapfile_size: '512'
swapfile_priority

Default swap file priority, from -1 to 32767.

swapfile_priority: '-1'
swapfile_use_dd

By default debops.swapfile uses the fallocate command to create the swap files. If you use unsupported filesystems (ext4 is supported) you can enable this variable to use dd command to create the files.

swapfile_use_dd: False
swapfile_files

List of swap files. Specify either a path to a file on a filesystem, or a YAML dict. See swapfile_files for more details.

swapfile_files: [ '/swapfile' ]

Kernel parameters

swapfile_swappiness

Set vm.swappiness kernel parameter.

swapfile_swappiness: '60'
swapfile_cache_pressure

Set vm.vfs_cache_pressure kernel parameter.

swapfile_cache_pressure: '100'
swapfile_sysctl_file

Name of the file with kernel parameters.

swapfile_sysctl_file: '/etc/sysctl.d/30-debops.swapfile.conf'
swapfile_sysctl_map

YAML dictionary with kernel parameters to set. Change it to an empty dict to disable the kernel configuration.

swapfile_sysctl_map:
  'vm.swappiness': '{{ swapfile_swappiness }}'
  'vm.vfs_cache_pressure': '{{ swapfile_cache_pressure }}'