From 97709fd1def7ca616ebf5a8b3f7f33472e3eff51 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Tue, 27 Jan 2015 12:53:22 +0100 Subject: [PATCH] Improve the configuration of the used base box Change-Id: Ia89908fd8b0a003f2176bebdb1a04f682da723f6 --- Vagrantfile | 8 ++++++-- config.yaml.sample | 5 +++-- doc/source/configuration.rst | 13 ++++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 79903ba..60009a0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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']] diff --git a/config.yaml.sample b/config.yaml.sample index cecf363..0d20f60 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -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 diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 9c4875c..d0a3266 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -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 `__. The @@ -21,14 +22,20 @@ CentOS. By default the box ``centos-packstack`` will be used. repository and the box iself on `Atlas `__. -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 `__. 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 ----------