We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fcd4a3 commit e9d84fdCopy full SHA for e9d84fd
salt/base/swap.sls
@@ -6,12 +6,11 @@
6
{{ swap_path }}:
7
cmd.run:
8
- name: |
9
- swapon --show=NAME --noheadings | grep -q "^{{ swap_path }}$" && swapoff {{ swap_path }}
10
- rm -f {{ swap_path }}
11
fallocate -l {{ swap_size }}M {{ swap_path }}
12
chmod 0600 {{ swap_path }}
13
mkswap {{ swap_path }}
14
- - unless: bash -c "[[ $(($(stat -c %s {{ swap_path }}) / 1024**2)) = {{ swap_size }} ]]"
+ swapon {{ swap_path }}
+ - unless: test -f {{ swap_path }}
15
16
mount.swap:
17
- persist: true
0 commit comments