|
|
@@ -5,7 +5,27 @@ |
|
|
|
|
|
|
|
{%- if swap.enabled %} |
|
|
|
|
|
|
|
{%- if swap.engine == 'file' %} |
|
|
|
{%- if swap.engine == 'partition' %} |
|
|
|
|
|
|
|
linux_create_swap_partition_{{ swap.device }}: |
|
|
|
cmd.run: |
|
|
|
- name: 'mkswap {{ swap.device }}' |
|
|
|
- creates: {{ swap.device }} |
|
|
|
|
|
|
|
linux_set_swap_partition_{{ swap.device }}: |
|
|
|
cmd.run: |
|
|
|
- name: 'swapon {{ swap.device }}' |
|
|
|
- unless: grep $(readlink -f /dev/vg0/swap) /proc/swaps |
|
|
|
- require: |
|
|
|
- cmd: linux_create_swap_partition_{{ swap.device }} |
|
|
|
|
|
|
|
{{ swap.device }}: |
|
|
|
mount.swap: |
|
|
|
- persist: True |
|
|
|
- require: |
|
|
|
- cmd: linux_set_swap_partition_{{ swap.device }} |
|
|
|
|
|
|
|
{%- elif swap.engine == 'file' %} |
|
|
|
|
|
|
|
linux_create_swap_file_{{ swap.device }}: |
|
|
|
cmd.run: |