Created
March 2, 2015 08:52
-
-
Save orymate/f0b16da2e55af2325322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swap-more-than-1g: | |
cmd.run: | |
- name: | | |
needed=$(awk '/SwapTotal/ {print 1025*1024 - int($2)}' /proc/meminfo) | |
dd if=/dev/zero of=/var/tmp/swap bs=1K count=$needed | |
mkswap /var/tmp/swap | |
echo "/var/tmp/swap none swap sw" >>/etc/fstab | |
swapon -a | |
- unless: "awk '/SwapTotal/ {exit int($2) < 1024*1024}' /proc/meminfo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment