geerlingguy.swap

Ansible Role: Swap

CI

This Ansible Role sets up swap space on Linux systems.

Requirements

None.

Role Variables

Here are the variables you can use, along with their default values (check defaults/main.yml for more details):

  • swap_file_path: /swapfile
    This is where the swap file will be located on the server.

  • swap_file_size_mb: '512'
    This is the size of the swap file in mebibytes.

  • swap_swappiness: '60'
    This sets the vm.swappiness value in the system configuration.

  • swap_file_state: present
    Set this to absent if you want to remove the swap file and disable swap. Usually, you would set it to present.

  • swap_file_create_command: "dd if=/dev/zero of={{ swap_file_path }} bs=1M count={{ swap_file_size_mb }}"
    This is the command for creating the swap file. You can use fallocate for faster creation, but it may result in inconsistencies compared to dd.

Dependencies

None.

Example Playbook

- hosts: all
  
  vars:
    swap_file_size_mb: '1024'
  
  roles:
    - geerlingguy.swap

License

MIT / BSD

Author Information

This role was created in 2018 by Jeff Geerling, the author of Ansible for DevOps.

Informazioni sul progetto

Swap file and swap management for Linux.

Installa
ansible-galaxy install geerlingguy.swap
Licenza
mit
Download
894.8k
Proprietario
Father, author, developer, maker. Sometimes called "an inflammatory enigma". #stl #drupal #ansible #k8s #raspberrypi #crohns