Skip to content

Commit

Permalink
Merge pull request #283 from Chassis/machine-overrides
Browse files Browse the repository at this point in the history
Allow overriding VM properties
  • Loading branch information
Bronson Quick committed May 21, 2017
2 parents 45876ee + e1c9966 commit 6d8f7a0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
# Use linked clones to preserve disk space.
vb.linked_clone = true if Vagrant::VERSION =~ /^1.8/

# Customisations from config.local.yaml
if CONF['virtualbox']
vb.memory = CONF['virtualbox']['memory'] if CONF['virtualbox']['memory']
vb.cpus = CONF['virtualbox']['cpus'] if CONF['virtualbox']['cpus']
end
end

# We <3 Ubuntu LTS
Expand Down
12 changes: 12 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,15 @@ synced_folders:
# PHP version
# Values: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1 (or e.g. 5.3.3)
php: 7.0

# VirtualBox-specific customisations.
virtualbox:
# Memory, in megabytes.
#
# (e.g. 1024)
memory: null

# CPU count.
#
# (e.g. 2)
cpus: null
18 changes: 18 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,21 @@ You can enable official Chassis extensions and third party extensions by listing
extensions:
- Chassis/Tester
- javorszky/chassis-openssl
Machine Customisations
----------------------

The underlying virtual machine managed by Vagrant can be customised, but depends on which provider you are using.

VirtualBox
~~~~~~~~~~

**Key**: ``virtualbox``

When using VirtualBox, you can customise how much memory (in megabytes) and how many virtual CPUs will be assigned to the machine. The default values for both (``null``) are to use the VirtualBox defaults (384 MB of RAM, and 2 vCPUs).

.. code-block:: yaml
virtualbox:
memory: null
cpus: null

0 comments on commit 6d8f7a0

Please sign in to comment.