Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge configuration volume_boot hashes #371

Merged
merged 1 commit into from
May 15, 2019

Conversation

Sharpie
Copy link
Contributor

@Sharpie Sharpie commented Aug 31, 2018

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.

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
Copy link

Coverage Status

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

@ggiamarchi ggiamarchi self-requested a review May 15, 2019 09:14
@ggiamarchi ggiamarchi merged commit 30964bd into ggiamarchi:master May 15, 2019
@Sharpie Sharpie deleted the merge-volume-boot branch May 17, 2019 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants