Created
December 9, 2011 12:54
-
-
Save milep/1451424 to your computer and use it in GitHub Desktop.
Example Vagrant file with puppet for the starter Rails App
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
import "rvm" | |
class oneiric64 { | |
package { "build-essential": | |
ensure => present, | |
} | |
package { "zlib1g-dev": | |
ensure => present, | |
} | |
package { "git-core": | |
ensure => present, | |
} | |
package { "sqlite3": | |
ensure => present, | |
} | |
package { "libsqlite3-dev": | |
ensure => present, | |
} | |
} | |
exec { "apt-get update": | |
command => "/usr/bin/apt-get update" | |
} | |
Exec['apt-get update'] -> Package <| |> | |
node default { | |
class {'nginx': } | |
nginx::resource::upstream { 'unicorn_server': | |
ensure => present, | |
members => [ | |
#'unix:/vagrant/tmp/sockets/unicorn.sock fail_timeout=0' | |
'localhost:3030' | |
] | |
} | |
nginx::resource::vhost { 'starter.local': | |
ensure => present, | |
proxy => 'http://unicorn_server', | |
listen_ip => '3000', | |
server_root => '/vagrant/public' | |
} | |
} | |
include oneiric64 | |
include rvm::system | |
if $rvm_installed == "true" { | |
rvm_system_ruby { | |
'ruby-1.9.3-p0': | |
ensure => 'present', | |
default_use => true; | |
} | |
rvm_gemset { | |
"ruby-1.9.3-p0@booking": | |
ensure => present, | |
require => Rvm_system_ruby['ruby-1.9.3-p0']; | |
"ruby-1.9.3-p0@starter": | |
ensure => present, | |
require => Rvm_system_ruby['ruby-1.9.3-p0']; | |
} | |
rvm_gem { | |
'ruby-1.9.3-p0@starter/bundler': | |
ensure => '1.0.21', | |
require => Rvm_gemset['ruby-1.9.3-p0@starter']; | |
} | |
} |
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
Vagrant::Config.run do |config| | |
config.vm.box = "oneiric64" | |
config.vm.forward_port "http", 3000, 5000 | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppetmanifests" | |
puppet.manifest_file = "oneiric64.pp" | |
puppet.module_path = "puppetmodules" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment