Advertisement
Guest User

disable_swap.yaml

a guest
Nov 12th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.32 KB | None | 0 0
  1. - hosts: all  
  2.   gather_facts: true  
  3.  
  4.   tasks:
  5.   - name: Remove swapfile from /etc/fstab  
  6.     mount:
  7.       name: "{{ item }}"  
  8.       fstype: swap  
  9.       state: absent  
  10.     with_items:
  11.     - swap  
  12.     - none  
  13.  
  14.   - name: Disable swap  
  15.     command: swapoff -a  
  16.     when: ansible_swaptotal_mb > 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement