Skip to content

Instantly share code, notes, and snippets.

@monkseal
Created June 10, 2015 17:13
Show Gist options
  • Save monkseal/e4365f1215c16d45d7d2 to your computer and use it in GitHub Desktop.
Save monkseal/e4365f1215c16d45d7d2 to your computer and use it in GitHub Desktop.
Vagrantfile for Centos 6.6 with Postgres Port mapped
# Host => Guest (VM)
FORWARD_PORTS = {
3030 => 3030, # webrick
15_432 => 5432 # PostgreSQL
}
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = 'opscode_centos-6.6'
config.vm.provider :virtualbox do |_f, override|
override.vm.box_url = 'https://s3.amazonaws.com/centos-vagrant/opscode_centos-6.6_chef-provisionerless.box'
end
config.ssh.password = 'vagrant'
config.vm.provision :shell, path: 'provision.sh', privileged: false
config.vm.synced_folder(
'.',
'/vagrant',
type: 'rsync',
rsync__exclude: [
'.git/',
'.vagrant/',
'config/database.yml',
'log/*',
'tmp/'
]
)
FORWARD_PORTS.each do |host, guest|
config.vm.network :forwarded_port, host: host, guest: guest
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment