Skip to content

Instantly share code, notes, and snippets.

@andredumas
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andredumas/9612937 to your computer and use it in GitHub Desktop.
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.
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