Skip to content

Instantly share code, notes, and snippets.

@johnkary
Created September 28, 2012 16:05
Show Gist options
  • Save johnkary/3800697 to your computer and use it in GitHub Desktop.
Save johnkary/3800697 to your computer and use it in GitHub Desktop.
Acme Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
# IP and Port Configuration
# The VM will start and run at the below host IP address
host = "33.33.33.10"
http_port = 80
mysql_port = 3306
config.vm.network :hostonly, host
# In case the host-only networks fails, the box is available via ssh at 2222
# Note: VM MySQL port 3306 will interfere with any locally run MySQL server.
config.vm.forward_port http_port, 8888
config.vm.forward_port mysql_port, mysql_port
# Adjust ram settings to best suit your system specs
config.vm.customize ["modifyvm", :id, "--memory", "300"]
# Mounts all files from this repository
#
# Your "acme" cookbook should define "docroot" as "/vagrant/www"
config.vm.share_folder("www-data", "/vagrant", ".", :nfs => true)
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
# Add your project's cookbook name here that lives in "site-cookbooks"
chef.add_recipe "acme"
# Specify custom JSON attributes:
chef.json.merge!({
:apache => {
:server_port => http_port,
:listen_ports => [ http_port, "443" ]
},
:mysql => {
:port => mysql_port,
:bind_address => "33.33.33.10",
:server_root_password => "root"
},
:php => {
:timezone => "America/Chicago",
}
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment