Getting started

Example inventory

To enable swap files on a host, it needs to be added to the [debops_swapfile] group in Ansible’s inventory:


The default configuration will create a 512 MB /swapfile and will make sure that it’s added in /etc/fstab.

Example playbook

Here’s an example playbook you can use to configure swap on a host:

- name: Manage swap
  hosts: 'debops_swapfile'
  become: True


    - role: debops.swapfile