Skip to content

Commit

Permalink
Change the default Vagrantfile to load from a named file
Browse files Browse the repository at this point in the history
  • Loading branch information
dpmatthews committed Jul 13, 2018
1 parent b57958c commit 0c0bcb6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ After you have installed VirtualBox and Vagrant, download the metomi VM setup fi
Then extract the files which will be put into a directory called `metomi-vms-master`.

The default VM uses Ubuntu 16.04.
If necessary you can customise the VM by editing the file `Vagrantfile` as follows:
If necessary you can customise the VM by editing the file `Vagrantfile.ubuntu-1604` as follows:
* By default the VM will be built with support for accessing the Met Office Science Repository Service.
If you don't want this (or don't have access) then remove `mosrs` from the `args` in the `config.vm.provision` line.
* As described below, you may prefer not to install the desktop environment.
Expand Down Expand Up @@ -66,7 +66,7 @@ If you need to change this, take a look at how this is configured in the file `i
## Disabling the Desktop Environment

If you are using the VM on a Mac or Linux system where you already have a X server running then you may find it easier to not install the desktop environment.
In order to do this, edit the file `Vagrantfile` as described above.
In order to do this, edit the file `Vagrantfile.ubuntu-1604` as described above.
Then run the command `vagrant up` to launch the VM in the normal way.
Note that, unlike when installing the desktop environment, it will not shutdown after the initial installation.

Expand All @@ -80,7 +80,7 @@ In addition to the default VM, additional VMs are supported in separate files na
These other VMs are provided primarily for the purpose of testing FCM, Rose & Cylc on other Linux distributions and providing a reference install on these platforms.
Note that they are not as well tested as the default VM and may not include a desktop environment.

To use a different VM, replace the default `Vagrantfile` with the appropriate file (`cp Vagrantfile.<distribution> Vagrantfile`) before running `vagrant up`.
To use a different VM, modify the file which is loaded in the default `Vagrantfile` before running `vagrant up`.
Alternatively you can set the environment variable `VAGRANT_VAGRANTFILE`, for example:
```
export VAGRANT_VAGRANTFILE=Vagrantfile.ubuntu-1404
Expand Down
21 changes: 1 addition & 20 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.define "metomi-vm-ubuntu-1604"
config.vm.box = "bento/ubuntu-16.04"
# Remove "desktop" from the args below if only accessing via SSH
# Remove "mosrs" from the args below if not accessing the Met Office Science Repository Service
config.vm.provision :shell, path: "install.sh", args: "ubuntu 1604 desktop mosrs"
config.ssh.forward_x11 = true

config.vm.provider "virtualbox" do |v|
v.name = "metomi-vm-ubuntu-1604"
# Comment out the line below if only accessing via SSH
v.gui = true
# Modify the line below if you need more than 1GB RAM
v.memory = 1024
v.cpus = 2
end

end
load 'Vagrantfile.ubuntu-1604'
23 changes: 23 additions & 0 deletions Vagrantfile.ubuntu-1604
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.define "metomi-vm-ubuntu-1604"
config.vm.box = "bento/ubuntu-16.04"
# Remove "desktop" from the args below if only accessing via SSH
# Remove "mosrs" from the args below if not accessing the Met Office Science Repository Service
config.vm.provision :shell, path: "install.sh", args: "ubuntu 1604 desktop mosrs"
config.ssh.forward_x11 = true

config.vm.provider "virtualbox" do |v|
v.name = "metomi-vm-ubuntu-1604"
# Comment out the line below if only accessing via SSH
v.gui = true
# Modify the line below if you need more than 1GB RAM
v.memory = 1024
v.cpus = 2
end

end

0 comments on commit 0c0bcb6

Please sign in to comment.