Guest User

Vagrantfile

a guest
Jan 20th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.92 KB | None | 0 0
  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"
  36.  
  37.     #nginx is included in the omusubi recipe
  38.     #chef.add_recipe "nginx"
  39.     versions = {};
  40.     # if you would use php5.3 family with fast boot,  comment out lines bellow.
  41.     versions['php5'] = '5.5.*'
  42.     versions['php5-mysql'] = '5.5.*'
  43.     versions['php5-pgsql'] = '5.5.*'
  44.     versions['php5-curl'] = '5.5.*'
  45.     versions['php5-mcrypt'] = '5.5.*'
  46.     versions['php5-cli'] = '5.5.*'
  47.     versions['php5-fpm'] = '5.5.*'
  48.     versions['php-pear'] = '5.5.*'
  49.     versions['php5-imagick'] = '3.*'
  50.     chef.json = {doc_root: doc_root, 'versions' => versions}
  51.   end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment