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