# Role: swap

## Description

Creates a swap file and enables it as swap for the system.

Default swap file path is /swap.

http://www.staroceans.org/man7.org/linux/man-pages/man8/mkswap.8.html

https://man7.org/linux/man-pages/man8/swapon.8.html

## Usage

Using in a playbook:

```yaml
- name: Play
  gather_facts: true
  gather_subset:
    - distribution
  hosts:
    - all
  roles:
    - samuliy.ansible.swap
  vars:
    ...
```

### Vars

`swap_file_path`:

Path where to install swapfile.

`swap_size_mb`:

Size of the swapfile.
