Browse Source

add onlyif statement

tags/2016.12
Lachlan Evenson 9 years ago
parent
commit
7277ba9601
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      linux/storage/swap.sls

+ 1
- 0
linux/storage/swap.sls View File

@@ -10,6 +10,7 @@
linux_create_swap_partition_{{ swap.device }}:
cmd.run:
- name: 'mkswap {{ swap.device }}'
- onlyif: "test `file -L -s {{ swap.device }} | grep 'swap file' >/dev/null;echo $?` -ne 0"
- creates: {{ swap.device }}

linux_set_swap_partition_{{ swap.device }}:

Loading…
Cancel
Save