linux_create_swap_partition_{{ swap.device }}: | linux_create_swap_partition_{{ swap.device }}: | ||||
cmd.run: | cmd.run: | ||||
- name: 'mkswap {{ swap.device }}' | - name: 'mkswap {{ swap.device }}' | ||||
- onlyif: "test `file -L -s {{ swap.device }} | grep 'swap file' >/dev/null;echo $?` -ne 0" | |||||
- creates: {{ swap.device }} | |||||
- unless: file -L -s {{ swap.device }} | grep -q 'swap file' | |||||
linux_set_swap_partition_{{ swap.device }}: | linux_set_swap_partition_{{ swap.device }}: | ||||
cmd.run: | cmd.run: |