Automatically Install Plugins

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatically Install Plugins

Jamie Jackson
What's currently the recommended way (even if there's not canonical way) to auto-install plugins in Vagrant? Git issues on the subject are a tangled, contradictory mess, and it's hard to figure out where things stand.
Thanks,
Jamie

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPcSZdPmQW4BepEyJB9h0wBs3MWZiAKLyc1qSn%3D9t907jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically Install Plugins

Alvaro Miranda Aguilera
official reply:


example that works:

required_plugins = {
  'vagrant-alpine'       => '~>0.0',
}

needs_restart = false
required_plugins.each do |name, version|
unless Vagrant.has_plugin? name, version
system "vagrant plugin install #{name} --plugin-version=\"#{version}\""
needs_restart = true
end
end

if needs_restart
exec "vagrant #{ARGV.join' '}"
end

On Fri, Apr 14, 2017 at 7:45 PM, Jamie Jackson <[hidden email]> wrote:
What's currently the recommended way (even if there's not canonical way) to auto-install plugins in Vagrant? Git issues on the subject are a tangled, contradictory mess, and it's hard to figure out where things stand.
Thanks,
Jamie

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPcSZdPmQW4BepEyJB9h0wBs3MWZiAKLyc1qSn%3D9t907jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ew5TPBEi8mSEU0BxnPYYNJ8SgfjmfxS6XpVkdTR5RVyjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically Install Plugins

Jamie Jackson
Thanks, Alvaro. I'll try that out next week.

On Fri, Apr 14, 2017 at 3:03 PM, Alvaro Miranda Aguilera <[hidden email]> wrote:
official reply:


example that works:

required_plugins = {
  'vagrant-alpine'       => '~>0.0',
}

needs_restart = false
required_plugins.each do |name, version|
unless Vagrant.has_plugin? name, version
system "vagrant plugin install #{name} --plugin-version=\"#{version}\""
needs_restart = true
end
end

if needs_restart
exec "vagrant #{ARGV.join' '}"
end

On Fri, Apr 14, 2017 at 7:45 PM, Jamie Jackson <[hidden email]> wrote:

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPcSZdPmQW4BepEyJB9h0wBs3MWZiAKLyc1qSn%3D9t907jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ew5TPBEi8mSEU0BxnPYYNJ8SgfjmfxS6XpVkdTR5RVyjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPdJZTiVFTVtEAO2iu5mhZGb%3DKwA4bZH2iXsMULUWF2TPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.