This ansible role create a swapfile and enable it ; it can also disable and remove it.
There no way to expand an existing swapfile, it must be disabled and removed, before be recreated at the new size.
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.swapfile
git clone https://github.com/dginhoux/ansible_role.swapfile dginhoux.swapfile
- name: Playbook
hosts: all
tasks:
- name: Start role dginhoux.swapfile
ansible.builtin.include_role:
name: dginhoux.swapfile
Defaults variables defined in defaults/main.yml
swap_file_path: /swapfile
swap_file_size_mb: '2048'
swap_file_state: present
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT