Created
February 20, 2020 05:45
-
-
Save metasikander/f5bb6d57195db276443d5faea6ac69a1 to your computer and use it in GitHub Desktop.
Revisions
-
metasikander created this gist
Feb 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ --- - name: Swapfile playbook hosts: all become: yes tasks: - name: create swapfile command: fallocate -l 2G /swapfile args: creates: /swapfile - name: swapfile access rights file: path: /swapfile owner: root group: root mode: 0600 - name: mkswap command: mkswap /swapfile ignore_errors: yes - name: swapon command: swapon /swapfile ignore_errors: yes - name: add to fstab lineinfile: path: /etc/fstab line: /swapfile none swap defaults 0 0 create: yes