4 # This file is for use by Vagrant (http://www.vagrantup.com/).
5 # It will establish a debian-based (Ubuntu) virtual machine for development.
7 # The virtual machine environment attempts to match the production environment
8 # as closely as possible.
10 # This file was generated by `vagrant up` and consequently modified.
12 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
13 VAGRANTFILE_API_VERSION = "2"
15 # Install fabric so that the KarmaWorld fabfile may be run.
17 # build a shell script that installs prereqs, configures the database, sets up
18 # the user/group associations, pulls in the code from the host machine, and
20 shellscript = <<SCRIPT
23 apt-get install -y python-pip postgresql python-virtualenv virtualenvwrapper \
24 git nginx postgresql-server-dev-9.1 libxslt1-dev \
25 libxml2-dev libmemcached-dev python-dev
27 echo "CREATE USER vagrant WITH CREATEROLE LOGIN; CREATE DATABASE karmaworld OWNER vagrant;" | su postgres -c "psql"
29 mkdir -m 775 -p /var/www
30 chown -R :www-data /var/www
31 usermod -a -G www-data vagrant
33 su vagrant -c "git clone /vagrant karmaworld"
36 #su vagrant -c "cd karmaworld; fab here first_deploy"
40 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
41 # All Vagrant configuration is done here. The most common configuration
42 # options are documented and commented below. For a complete reference,
43 # please see the online documentation at vagrantup.com.
45 # Every Vagrant virtual environment requires a box to build off of.
46 config.vm.box = "Official Ubuntu 12.04 daily Cloud Image i386"
47 #config.vm.box = "Official Ubuntu 12.04 daily Cloud Image amd64"
48 #config.vm.box = "Official Ubuntu 12.10 daily Cloud Image i386"
49 #config.vm.box = "Official Ubuntu 12.10 daily Cloud Image amd64"
50 #config.vm.box = "Official Ubuntu 13.04 daily Cloud Image i386"
51 #config.vm.box = "Official Ubuntu 13.04 daily Cloud Image amd64"
52 #config.vm.box = "Official Ubuntu 13.10 daily Cloud Image i386"
53 #config.vm.box = "Official Ubuntu 13.10 daily Cloud Image amd64"
55 # The url from where the 'config.vm.box' box will be fetched if it
56 # doesn't already exist on the user's system.
57 config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-i386-vagrant-disk1.box"
58 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
59 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-i386-vagrant-disk1.box"
60 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-amd64-vagrant-disk1.box"
61 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box"
62 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box"
63 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-i386-vagrant-disk1.box"
64 #config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box"
66 # Create a forwarded port mapping which allows access to a specific port
67 # within the machine from a port on the host machine. In the example below,
68 # accessing "localhost:8080" will access port 80 on the guest machine.
69 # config.vm.network :forwarded_port, guest: 80, host: 8080
71 # OM (sanskrit) KW (KarmaWorld) on a phone: 66 59
72 config.vm.network :forwarded_port, guest: 80, host: 6659, auto_correct: true
74 # Create a private network, which allows host-only access to the machine
75 # using a specific IP.
76 #config.vm.network :private_network, ip: "192.168.66.59"
78 # Create a public network, which generally matched to bridged network.
79 # Bridged networks make the machine appear as another physical device on
81 # Used to directly access the internet for downloading updates and so forth.
82 config.vm.network :public_network
84 # If true, then any SSH connections made will enable agent forwarding.
85 # Default value: false
86 # config.ssh.forward_agent = true
88 # Share an additional folder to the guest VM. The first argument is
89 # the path on the host to the actual folder. The second argument is
90 # the path on the guest to mount the folder. And the optional third
91 # argument is a set of non-required options.
92 # config.vm.synced_folder "../data", "/vagrant_data"
95 config.vm.provision "shell", inline: shellscript
97 # Provider-specific configuration so you can fine-tune various
98 # backing providers for Vagrant. These expose provider-specific options.
99 # Example for VirtualBox:
101 # config.vm.provider :virtualbox do |vb|
102 # # Don't boot with headless mode
105 # # Use VBoxManage to customize the VM. For example to change memory:
106 # vb.customize ["modifyvm", :id, "--memory", "1024"]
109 # View the documentation for the provider you're using for more
110 # information on available options.
112 # Enable provisioning with Puppet stand alone. Puppet manifests
113 # are contained in a directory path relative to this Vagrantfile.
114 # You will need to create the manifests directory and a manifest in
115 # the file base.pp in the manifests_path directory.
117 # An example Puppet manifest to provision the message of the day:
119 # # group { "puppet":
120 # # ensure => "present",
123 # # File { owner => 0, group => 0, mode => 0644 }
125 # # file { '/etc/motd':
126 # # content => "Welcome to your Vagrant-built virtual machine!
127 # # Managed by Puppet.\n"
130 # config.vm.provision :puppet do |puppet|
131 # puppet.manifests_path = "manifests"
132 # puppet.manifest_file = "site.pp"
135 # Enable provisioning with chef solo, specifying a cookbooks path, roles
136 # path, and data_bags path (all relative to this Vagrantfile), and adding
137 # some recipes and/or roles.
139 # config.vm.provision :chef_solo do |chef|
140 # chef.cookbooks_path = "../my-recipes/cookbooks"
141 # chef.roles_path = "../my-recipes/roles"
142 # chef.data_bags_path = "../my-recipes/data_bags"
143 # chef.add_recipe "mysql"
144 # chef.add_role "web"
146 # # You may also specify custom JSON attributes:
147 # chef.json = { :mysql_password => "foo" }
150 # Enable provisioning with chef server, specifying the chef server URL,
151 # and the path to the validation key (relative to this Vagrantfile).
153 # The Opscode Platform uses HTTPS. Substitute your organization for
154 # ORGNAME in the URL and validation key.
156 # If you have your own Chef Server, use the appropriate URL, which may be
157 # HTTP instead of HTTPS depending on your configuration. Also change the
158 # validation key to validation.pem.
160 # config.vm.provision :chef_client do |chef|
161 # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
162 # chef.validation_key_path = "ORGNAME-validator.pem"
165 # If you're using the Opscode platform, your validator client is
166 # ORGNAME-validator, replacing ORGNAME with your organization name.
168 # If you have your own Chef Server, the default validation client name is
169 # chef-validator, unless you changed the configuration.
171 # chef.validation_client_name = "ORGNAME-validator"