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 }}: