Getting started

Example inventory

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

[debops_service_swapfile]
hostname

Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.swapfile role:

---

- name: Configure swap files
  hosts: [ 'debops_service_swapfile' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'

  roles:

    - role: debops.swapfile
      tags: [ 'role::swapfile' ]