fallocate doesn't work on NFS.

This commit is contained in:
Jim Hague 2024-04-20 08:12:22 +01:00
parent f7d02fdd20
commit f8dff4d0b2
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@
- name: |
swapon --show=NAME --noheadings | grep -q "^{{ path }}$" && swapoff {{ path }}
rm -f {{ path }}
fallocate -l {{ size }}M {{ path }}
dd if=/dev/zero of={{ path }} bs=1M count={{ size }}
chmod 0600 {{ path }}
mkswap {{ path }}
- unless: bash -c '[[ $(($(stat -c %s {{ path }}) / 1024**2)) = {{ size }} ]]'