SHOW:
|
|
- or go back to the newest paste.
| 1 | # -*- mode: ruby -*- | |
| 2 | # vi: set ft=ruby : | |
| 3 | ||
| 4 | Vagrant.configure("2") do |config|
| |
| 5 | # All Vagrant configuration is done here. The most common configuration | |
| 6 | # options are documented and commented below. For a complete reference, | |
| 7 | # please see the online documentation at vagrantup.com. | |
| 8 | ||
| 9 | # Every Vagrant virtual environment requires a box to build off of. | |
| 10 | config.vm.box = "precise64" | |
| 11 | config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| 12 | src_dir = './src' | |
| 13 | doc_root = './src/public' | |
| 14 | app_name = 'my_app' | |
| 15 | config.vm.network :forwarded_port, guest: 80, host: 8080 | |
| 16 | config.vm.synced_folder src_dir, "/web", :create => true, :owner => 'vagrant', :group => 'www-data', :mount_options => ['dmode=775,fmode=775'] | |
| 17 | ||
| 18 | # plugins | |
| 19 | config.berkshelf.enabled = true | |
| 20 | config.omnibus.chef_version = :latest | |
| 21 | File.open('Berksfile', 'w').write <<-EOS
| |
| 22 | cookbook 'apt' | |
| 23 | cookbook 'php5_ppa', git: "https://github.com/benharold/php5_ppa.git", branch: "ondrej" | |
| 24 | cookbook 'omusubi', git: "https://github.com/benharold/omusubi.git" | |
| 25 | cookbook 'user', git: "https://github.com/fnichol/chef-user" | |
| 26 | EOS | |
| 27 | ||
| 28 | # Chef solo provisioning | |
| 29 | config.vm.provision :chef_solo do |chef| | |
| 30 | chef.add_recipe "apt" | |
| 31 | chef.add_recipe "php5_ppa::from_ondrej" | |
| 32 | chef.add_recipe "omusubi" | |
| 33 | ||
| 34 | # http://fnichol.github.io/chef-user/ | |
| 35 | - | chef.add_recipe "user::users" |
| 35 | + | chef.add_recipe "user" |
| 36 | ||
| 37 | # This sees "user" as the cookbook, instead of the recipe...not sure why | |
| 38 | chef.run_list = [ | |
| 39 | "recipe[user::ben]" | |
| 40 | ] | |
| 41 | ||
| 42 | #nginx is included in the omusubi recipe | |
| 43 | #chef.add_recipe "nginx" | |
| 44 | versions = {};
| |
| 45 | # if you would use php5.3 family with fast boot, comment out lines bellow. | |
| 46 | versions['php5'] = '5.5.*' | |
| 47 | versions['php5-mysql'] = '5.5.*' | |
| 48 | versions['php5-pgsql'] = '5.5.*' | |
| 49 | versions['php5-curl'] = '5.5.*' | |
| 50 | versions['php5-mcrypt'] = '5.5.*' | |
| 51 | versions['php5-cli'] = '5.5.*' | |
| 52 | versions['php5-fpm'] = '5.5.*' | |
| 53 | versions['php-pear'] = '5.5.*' | |
| 54 | versions['php5-imagick'] = '3.*' | |
| 55 | chef.json = {doc_root: doc_root, 'versions' => versions}
| |
| 56 | end | |
| 57 | end |