How do you set a plugin dependency on your Vagrantfile?

43 views
Skip to first unread message

Pedro Adame Vergara

unread,
Apr 23, 2016, 8:49:06 AM4/23/16
to Vagrant
I'm starting a project which requires the plugins vagrant-vbguest and vagrant-librarian-chef-nochef.
I cannot figure out how to add them as dependencies (e.g. vagrant up check if installed. If not, they should be installed at this point)

Looked at http://stackoverflow.com/questions/19492738/demand-a-vagrant-plugin-within-the-vagrantfile but putting them on group :plugins doesn't work for me.

Alvaro Miranda Aguilera

unread,
Apr 24, 2016, 6:46:22 AM4/24/16
to vagra...@googlegroups.com
Hello

You can use something like this:

  if Vagrant.has_plugin?("vagrant-cachier")

--
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8bd7898e-2868-4789-a3e5-824ecc5e158d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pedro Adame Vergara

unread,
Apr 24, 2016, 7:44:36 AM4/24/16
to Vagrant
It worked, thank you.
Just call the "raise" method inside the if block to make the plugin mandatory.
Reply all
Reply to author
Forward
0 new messages