Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

added Environment variables #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -21,6 +21,23 @@ Go to the repository folder and launch the box
$ cd [repo]
$ vagrant up

Environment variables
-------------------------

### Default values

```bash
VM_MEMORY=512
VM_CORES=1
VM_ARCH=32
```

### Examples uses

```bash
VM_MEMORY=1024 VM_CORES=2 VM_ARCH=64 vagrant up
```

What's inside:
--------------

15 changes: 12 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

MEMORY = ENV['VM_MEMORY'] || '512'
CORES = ENV['VM_CORES'] || '1'
ARCH = ENV['VM_ARCH'] || '32'

Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
config.vm.box = "precise#{ARCH}"

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.box_url = "http://files.vagrantup.com/precise#{ARCH}.box"

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine.
@@ -31,7 +35,12 @@ Vagrant.configure("2") do |config|
# These expose provider-specific options.
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "512"]
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_i]
vb.customize ["modifyvm", :id, "--cpus", CORES.to_i]

if CORES.to_i > 1
vb.customize ["modifyvm", :id, "--ioapic", "on"]
end
end

# Enable provisioning with chef solo, specifying a cookbooks path, roles