Skip to content

Commit

Permalink
Add a new vm named "custom" to simplify bringing up an unconfigured b…
Browse files Browse the repository at this point in the history
…ox on the same network

Signed-off-by: Marc A. Paradise <[email protected]>
  • Loading branch information
marcparadise committed Mar 27, 2017
1 parent 3b3e47c commit 29c3df9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dev/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ LDAP_VM_ADDRESS="192.168.33.152"
# Reporting testing with external DB separate from chef server DB.
REPORTING_DB_VM_ADDRESS="192.168.33.155"


# Just in case you have a hankering to start a VM to run components on the
# same network that don't fall into the categories above.
# Enable it by setting config.yml value `vm.custom` to `true`,
# then bring it up with `vagrant up custom`
CUSTOM_VM_ADDRESS ="192.168.33.153"

DB_SUPERUSER="bofh"
DB_SUPERPASS="i1uvd3v0ps"
LDAP_PASSWORD='H0\/\/!|\/|3tY0ur|\/|0th3r'
Expand Down Expand Up @@ -89,6 +96,12 @@ Vagrant.configure("2") do |config|
attributes['vm']['chef-backend'] = nil
end

if attributes['vm']['start-custom'] == true
config.vm.define("custom") do |c|
define_custom_server(c, attributes)
end
end

config.vm.define("chef-server", primary: true) do |c|
define_chef_server(c, attributes)
end
Expand Down Expand Up @@ -253,6 +266,20 @@ def define_db_server(config, attributes)
# chef-client for the node. May reconsider...
config.vm.provision "shell", inline: configure_postgres
end
def define_custom_server(config, attributes)
config.vm.hostname = "custom.chef-server.dev"
config.vm.network "private_network", ip: CUSTOM_VM_ADDRESS
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id,
"--name", "custom",
"--memory", 1024,
"--cpus", 2,
"--usb", "off",
"--usbehci", "off"
]
end
end


def define_backend_server(config, attribute)
provisioning, installer, installer_path = prepare('BE_INSTALLER', 'chef-backend', 'Chef Backend 1.1+')
Expand Down
3 changes: 3 additions & 0 deletions dev/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ vm:
base_output_path: /vagrant/testdata/cover # maps to dev/testdata/cover
node-attributes:
placeholder: true
# Overriding config.vm.stsrt-custom to true will create an empty VM of the same
# distro as the chef server, with 2GB/2core, using CUSTOM_VM_ADDRESS
start-custom: false

projects:
oc_erchef:
Expand Down

0 comments on commit 29c3df9

Please sign in to comment.