Last active
August 29, 2015 13:57
-
-
Save andredumas/9612937 to your computer and use it in GitHub Desktop.
Online note of a manifest I regularly use to create swap on AWS EC2 Ubuntu instances.
This file contains hidden or 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
exec { "mkswap": | |
command => "dd if=/dev/zero of=/swap bs=1024 count=$((1226*1024)); mkswap /var/swapfile", | |
creates => "/var/swapfile" | |
} | |
file { "/var/swapfile": | |
ensure => present, | |
mode => 600, | |
require => Exec["mkswap"] | |
} | |
mount { "swap": | |
ensure => defined, | |
device => "/var/swapfile", | |
options => "defaults", | |
fstype => swap, | |
require => [ Exec["mkswap"], File["/var/swapfile"]] | |
} | |
exec { "swapon -a": | |
require => Mount["swap"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment