Improve the configuration of the used base box
Change-Id: Ia89908fd8b0a003f2176bebdb1a04f682da723f6
This commit is contained in:
parent
65dce2a8c2
commit
97709fd1de
|
@ -20,19 +20,23 @@ unless defined? CONFIG
|
|||
CONFIG = YAML.load(File.open(configuration_file, File::RDONLY).read)
|
||||
end
|
||||
|
||||
CONFIG['box'] = {} unless CONFIG.key?('box')
|
||||
CONFIG['box']['name'] = 'b1-systems/centos-packstack' unless CONFIG['box'].key?('name')
|
||||
CONFIG['box']['storage_controller'] = 'SATA Controller' unless CONFIG['box'].key?('storage_controller')
|
||||
|
||||
def add_block_device(node, port, size)
|
||||
node.vm.provider 'virtualbox' do |vb|
|
||||
vb.customize ['createhd', '--filename', "#{node.vm.hostname}_#{port}.vdi",
|
||||
'--size', size]
|
||||
vb.customize ['storageattach', :id, '--storagectl',
|
||||
CONFIG['box_storage_controller'], '--port', port,
|
||||
CONFIG['box']['storage_controller'], '--port', port,
|
||||
'--device', 0, '--type', 'hdd', '--medium',
|
||||
"#{node.vm.hostname}_#{port}.vdi"]
|
||||
end
|
||||
end
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = CONFIG['box']
|
||||
config.vm.box = CONFIG['box']['name']
|
||||
config.vm.synced_folder '.', '/vagrant', disabled: true
|
||||
config.vm.provider 'virtualbox' do |vb|
|
||||
vb.customize ['modifyvm', :id, '--memory', CONFIG['resources']['memory']]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
box: b1-systems/centos-packstack
|
||||
box_storage_controller: 'SATA Controller'
|
||||
box:
|
||||
name: b1-systems/centos-packstack
|
||||
storage_controller: 'SATA Controller'
|
||||
development: false
|
||||
bridge_internal: tap0
|
||||
bridge_external: tap1
|
||||
|
|
|
@ -12,7 +12,8 @@ CentOS. By default the box ``centos-packstack`` will be used.
|
|||
|
||||
::
|
||||
|
||||
box: b1-systems/centos-packstack
|
||||
box:
|
||||
name: b1-systems/centos-packstack
|
||||
|
||||
``centos-packstack`` is a customized version of
|
||||
`boxcutter/centos70 <https://github.com/box-cutter/centos-vm>`__. The
|
||||
|
@ -21,14 +22,20 @@ CentOS. By default the box ``centos-packstack`` will be used.
|
|||
repository and the box iself on
|
||||
`Atlas <https://atlas.hashicorp.com/b1-systems/centos-packstack>`__.
|
||||
|
||||
To change the used base box modify the value of ``box``. A list
|
||||
To change the used base box modify the value of ``name``. A list
|
||||
of public available boxes is available on
|
||||
`Atlas <https://atlas.hashicorp.com/>`__.
|
||||
|
||||
Depending on the used base box you have to set the used storage
|
||||
controller (normally ``IDE Controller`` or ``SATA Controller``). The
|
||||
controller (``SATA Controller`` by default). The
|
||||
storage controller of the used base box must support at least three ports.
|
||||
|
||||
::
|
||||
|
||||
box:
|
||||
name: b1-systems/centos-packstack
|
||||
storage_controller: 'SATA Controller'
|
||||
|
||||
|
||||
Networking
|
||||
----------
|
||||
|
|
Loading…
Reference in New Issue