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
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_swapfile' ]
  become: True

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

  roles:

    - role: swapfile
      tags: [ 'role::swapfile', 'skip::swapfile' ]