Skip to content

Instantly share code, notes, and snippets.

@peterfox
Created February 29, 2016 19:44
Show Gist options
  • Save peterfox/5900f0316216756b2e20 to your computer and use it in GitHub Desktop.
Save peterfox/5900f0316216756b2e20 to your computer and use it in GitHub Desktop.
Example vagrant file I use with Chef and Laravel cookbook
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.define "database" do |database|
# database.vm.box = "ubuntu-trusty-server-amd64"
# database.vm.network :private_network, ip: "10.0.0.3"
#
#
# database.vm.provision :chef_solo do |chef|
# chef.add_recipe "apt" # Keep this as it updates apt which stops a bug in the mysql recipe
#
# chef.add_recipe "laravel::database"
# chef.json =
# {
# # Root Passwords required for chef-solo to be able to run the recipe
# "mysql" => {
# "server_root_password" => "vagrant",
# "server_repl_password" => "vagrant",
# "server_debian_password" => "vagrant",
# "bind_address" => "10.0.0.3",
# "version" => "5.6"
# },
# :mysql_password => "vagrant",
# "laravel" => {
# "app_name" => "myapp",
# "username" => "mydbuser",
# "password" => "mydbpass"
# }
# }
# end
# end
config.vm.define "web" do |web|
web.vm.box = "ubuntu-trusty-server-amd64"
web.vm.network :private_network, ip: "10.0.0.2"
web.vm.synced_folder ".", "/srv/www",
owner: "www-data", group: "www-data"
web.vm.provision :chef_solo do |chef|
chef.add_recipe "apt" # Keep this as it updates apt which stops a bug in the php recipe
chef.add_recipe "laravel::webservice"
# chef.add_recipe "laravel::migrate"
end
end
# config.vm.define "cache" do |cache|
# cache.vm.box = "ubuntu-trusty-server-amd64"
# cache.vm.network :private_network, ip: "10.0.0.4"
#
# cache.vm.provision :chef_solo do |chef|
# chef.add_recipe "laravel::cache"
# end
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment