You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
577B

  1. ---
  2. - name: format
  3. command: mkswap {% if item.uuid is defined %}-U {{ item.uuid }}{% endif %} {{ item.device }}
  4. with_items: "{{ swap_devices }}"
  5. when:
  6. - swap_devices_state == "formated"
  7. - item.format | default(true)
  8. - name: fstab for swap devices
  9. mount:
  10. name: none
  11. src: "{% if item.uuid is defined %}UUID={{ item.uuid }}{% else %}{{ item.device }}{% endif %}"
  12. fstype: swap
  13. opts: sw
  14. passno: '0'
  15. dump: '0'
  16. state: present
  17. fstab: "{{ fstab_file }}"
  18. with_items: "{{ swap_devices }}"
  19. when:
  20. swap_devices_state == "configured"