ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
245 stars 102 forks source link

Merge configuration volume_boot hashes #371

Closed Sharpie closed 5 years ago

Sharpie commented 5 years ago

This commit updates the merge behavior of the config object to merge volume_boot hashes together. This allows defaults to be set for all VMs that are booting from a volume:

Vagrant.configure('2') do |config|

  # Always delete volumes when VMs are destroyed.
  config.vm.provider :openstack do |os|
    os.volume_boot = {delete_on_destroy: true}
  end

  config.vm.define 'centos1' do |node|
    node.vm.provider :openstack do |os|
      os.volume_boot = {image: 'centos-7.5',
                        size: 20}
    end
  end
end

Prior to this change, the last volume_boot hash specified would overwrite all configuration set by other provider blocks.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 87.572% when pulling 9573cb627f3e17bf48c10eb9b8958f750cb6a5a2 on Sharpie:merge-volume-boot into 0e60bd3235e077df3aca180523f6fd5a37a04152 on ggiamarchi:master.