Skip to content
This repository has been archived by the owner on Mar 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #75 from alt3/network-option
Browse files Browse the repository at this point in the history
Adds yaml option for private or public network interface
  • Loading branch information
bravo-kernel authored Jan 7, 2017
2 parents 1df07b0 + bb7b349 commit 4d531cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .cakebox/Vagrantfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def Cakebox.configure(config, user_settings)
settings["vm"] = Hash.new
settings["vm"]["hostname"] = "cakebox"
settings["vm"]["ip"] = "10.33.10.10"
settings["vm"]["network"] = "private"
settings["vm"]["memory"] = 1024
settings["vm"]["cpus"] = 1
settings["cakebox"] = Hash.new
Expand Down Expand Up @@ -47,8 +48,12 @@ def Cakebox.configure(config, user_settings)
config.vm.box_url = "https://alt3-aee.kxcdn.com/cakebox.box"
config.vm.hostname = settings["vm"]["hostname"]

# Configure a private network IP (since DHCP is known to cause SSH timeouts)
config.vm.network :private_network, ip: settings["vm"]["ip"]
# Configure a private or public network IP
if settings['vm']['network'] == 'public'
config.vm.network :public_network, ip: settings["vm"]["ip"]
else
config.vm.network :private_network, ip: settings["vm"]["ip"]
end

# Optimize box settings
config.vm.provider "virtualbox" do |vb|
Expand Down
1 change: 1 addition & 0 deletions Cakebox.yaml.default
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
vm:
hostname: cakebox
ip: 10.33.10.10
network: private
memory: 1024
cpus: 1

Expand Down
3 changes: 3 additions & 0 deletions docs/sources/usage/cakebox-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Cakebox.yaml with a lot of different provisioning variations.
vm:
hostname: cakebox
ip: 10.33.10.10
network: private
memory: 2048
cpus: 1

Expand Down Expand Up @@ -126,13 +127,15 @@ Option | Description
:---------|:------------
hostname | hostname used by your box
ip | ip-address used to connect to your box
network | "private" for localhost access only (default) or "public"
memory | amount of memory available to your box (in MB)
cpus | number of virtual CPUs available to your box
```yaml
vm:
hostname: cakebox
ip: 10.33.10.10
network: private
memory: 2048
cpus: 1
```
Expand Down

0 comments on commit 4d531cd

Please sign in to comment.