diff options
| author | Gareth Rees <gareth@mysociety.org> | 2014-07-23 14:22:01 +0100 |
|---|---|---|
| committer | Gareth Rees <gareth@mysociety.org> | 2014-08-08 11:54:20 +0100 |
| commit | 98acfe2f55b323e95142825e5276601709514836 (patch) | |
| tree | 78f275b013be883994e441f3f55e8ef549fb5ab6 /Vagrantfile | |
| parent | d700f325de56c8a039cbe4178dd44842ef0ee977 (diff) | |
Add customisable OS to Vagrantfile
Choose the OS you want to run with the ALAVETELI_VAGRANT_OS environment
variable.
Examples:
# Use default (Ubuntu 12.04 LTS (precise)
vagrant up
# Use Debian (7) Wheezy
ALAVETELI_VAGRANT_OS=wheezy64 vagrant up
Diffstat (limited to 'Vagrantfile')
| -rw-r--r-- | Vagrantfile | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Vagrantfile b/Vagrantfile index 183df5893..d042f107c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -60,12 +60,27 @@ ALAVETELI_FQDN = ENV['ALAVETELI_VAGRANT_FQDN'] || "alaveteli.10.10.10.30.xip.io" ALAVETELI_MEMORY = ENV['ALAVETELI_VAGRANT_MEMORY'] || 1536 ALAVETELI_THEMES_DIR = ENV['ALAVETELI_THEMES_DIR'] || '../alaveteli-themes' +ALAVETELI_OS = ENV['ALAVETELI_VAGRANT_OS'] || 'precise64' + +SUPPORTED_OPERATING_SYSTEMS = { + 'precise64' => 'http://files.vagrantup.com/precise64.box', + 'squeeze64' => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box', + 'wheezy64' => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box' +} + +def box + ALAVETELI_OS +end + +def box_url + SUPPORTED_OPERATING_SYSTEMS[ALAVETELI_OS] +end VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "precise64" - config.vm.box_url = "http://files.vagrantup.com/precise64.box" + config.vm.box = box + config.vm.box_url = box_url config.vm.network :private_network, :ip => "10.10.10.30" config.vm.synced_folder ".", "/home/vagrant/alaveteli", :owner => "vagrant", :group => "vagrant" |
