This role adds a swap file to your host. It currently supports Debian and RedHat distributions.
None
$ ansible-galaxy install mikegleasonjr.swap
Here are the defaults from defaults/main.yml
:
swap_size: "{{ ansible_memtotal_mb }}M"
swap_location: /swap
swap_sysctl_tweaks:
vm.vfs_cache_pressure: "50"
vm.swappiness: "10"
The default swap size is equivalent to the amount of RAM on the host. It accepts any valid parameter accepted by fallocate
.
- hosts: all
roles:
- mikegleasonjr.swap
none
BSD
A vagrant environment has been provided to test the role on different distributions. Add your tests in tests.yml
and...
$ vagrant up
$ vagrant provision
Mike Gleason jr Couturier ([email protected])
Other roles from the same author: