diff --git a/salt/base/swap.sls b/salt/base/swap.sls index 625e2a32..7ccf4e33 100644 --- a/salt/base/swap.sls +++ b/salt/base/swap.sls @@ -2,6 +2,7 @@ {% set size = swapfile.get("size", "1024") %} {% set path = swapfile.get("path") %} +{% if path is not None %} {{ path }}: cmd.run: - name: | @@ -13,4 +14,5 @@ - unless: bash -c "[[ $(($(stat -c %s {{ path }}) / 1024**2)) = {{ size }} ]]" mount.swap: - - persist: true \ No newline at end of file + - persist: true +{% endif %} \ No newline at end of file