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?

4

1 回答 1

1

我在Matt Cooper的博客文章中找到了答案。这个解决方案对我有用。

博客文章描述了在 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
于 2017-02-23T16:28:14.153 回答