https://github.com/sjinks/ansible-role-swapfile
Ansible role to configure a swap file
https://github.com/sjinks/ansible-role-swapfile
ansible ansible-role swap swapfile
Last synced: 3 months ago
JSON representation
Ansible role to configure a swap file
- Host: GitHub
- URL: https://github.com/sjinks/ansible-role-swapfile
- Owner: sjinks
- License: mit
- Created: 2017-10-21T23:20:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-22T08:18:22.000Z (over 6 years ago)
- Last Synced: 2025-01-13T14:22:16.339Z (5 months ago)
- Topics: ansible, ansible-role, swap, swapfile
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Role: Swapfile
[](https://travis-ci.org/sjinks/ansible-role-swapfile)
This role configures a swapfile.
## Requirements
Sufficient disk space to hold the swap file.
## Role Variables
* `swapfile_path`: full path to the swap file to create (e.g.: `/swapfile`); when empty, no swap file will be created
* `swapfile_size_mib`: the size of the swap file (MiB); when negative or zero, no swap file will be created
* `swapfile_use_dd`: `False` (default) if use `fallocate` to create the file, `True` to use `dd`
* `swapfile_swappiness`: if not `False`, set the value of `vm.swappiness` to this value
* `swapfile_vfs_cache_pressure`: if not `False`, set the value of `vm.vfs_cache_pressure` to this value## Dependencies
None.
## Usage
```
- hosts: all
roles:
- sjinks.swapfile
```or
```
- hosts: all
roles:
- { role: sjinks.swapfile, swapfile_location: /swap, swafile_size_mib: 1024 }
```## License
MIT, see LICENSE file.