Sha256: 4d2a6393197e74f71205823c6478c9645a5835bbae584908995dcb1be2da1c0c

Contents?: true

Size: 751 Bytes

Versions: 47

Compression:

Stored size: 751 Bytes

Contents

- name: Make zerod swap file
  command: dd if=/dev/zero of={{ swap_file.path }} bs=1024 count={{swap_file.size_kb}}
           creates={{ swap_file.path }}
- name: Set swap permissions
  file: path={{ swap_file.path }} owner=root group=root mode=0600

- name: Check swap type
  command: file {{ swap_file.path }}
  register: swapfile_info
  changed_when: swapfile_info.stdout.find('swap file') == -1

- name: mkswap on swap file
  command: mkswap {{ swap_file.path }}
  when: swapfile_info.stdout.find('swap file') == -1

- name: Put the swap entry into fstab
  mount: name=none src={{ swap_file.path }} fstype=swap opts=sw passno=0 dump=0 state=present

- name: Swapon swapfile
  command: swapon {{ swap_file.path }}
  when: ansible_swaptotal_mb < 1

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
taperole-2.0.6 roles/general/tasks/swapfile.yml
taperole-2.0.5 roles/general/tasks/swapfile.yml
taperole-2.0.4 roles/general/tasks/swapfile.yml
taperole-2.0.3 roles/general/tasks/swapfile.yml
taperole-2.0.2 roles/general/tasks/swapfile.yml
taperole-2.0.1 roles/general/tasks/swapfile.yml
taperole-2.0.0 roles/general/tasks/swapfile.yml
taperole-1.8.2 roles/general/tasks/swapfile.yml
taperole-1.8.1 roles/general/tasks/swapfile.yml
taperole-1.8.0 roles/general/tasks/swapfile.yml
taperole-1.7.1 roles/general/tasks/swapfile.yml
taperole-1.7.0 roles/general/tasks/swapfile.yml
taperole-1.6.0 roles/general/tasks/swapfile.yml
taperole-1.5.5 roles/general/tasks/swapfile.yml
taperole-1.5.4 roles/general/tasks/swapfile.yml
taperole-1.5.3 roles/general/tasks/swapfile.yml
taperole-1.5.2 roles/general/tasks/swapfile.yml
taperole-1.5.1 roles/general/tasks/swapfile.yml
taperole-1.5.0 roles/general/tasks/swapfile.yml
taperole-1.4.3 roles/general/tasks/swapfile.yml