1

I have a Vagrant build that has a dependency on vagrant plugins.

I could document that users need to install those plugins, but ideally I would like to automatically install the required plugins.

How can I automatically install the required plugins as part of my build?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Chris Snow
  • 23,813
  • 35
  • 144
  • 309

1 Answers1

2

I found the answer on a blog post by Matt Cooper. This solution worked for me.

The blog post describes adding the following lines to the top of your Vagrantfile:

required_plugins = %w( vagrant-omnibus vagrant-aws )
required_plugins.each do |plugin|
    exec "vagrant plugin install #{plugin};vagrant #{ARGV.join(" ")}" unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin'
end
Chris Snow
  • 23,813
  • 35
  • 144
  • 309