commit | 7277ba9601fde97225af84609a9674fa339ca60e | [log] [tgz] |
---|---|---|
author | Lachlan Evenson <lachlan.evenson@lithium.com> | Mon Jan 25 11:12:45 2016 -0800 |
committer | Lachlan Evenson <lachlan.evenson@lithium.com> | Mon Jan 25 11:12:45 2016 -0800 |
tree | 8605039f2f895c211454d2d08853f574aec6c132 | |
parent | 7f83d9f0380afd91377afac002d667c5cb0d93d8 [diff] |
add onlyif statement
diff --git a/linux/storage/swap.sls b/linux/storage/swap.sls index 3fa4a0d..7ed70bf 100644 --- a/linux/storage/swap.sls +++ b/linux/storage/swap.sls
@@ -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 }}: