Last active
December 26, 2015 08:19
-
-
Save charlesjohnson/7121911 to your computer and use it in GitHub Desktop.
Vagrant.has_plugin? example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plugin-specific configurations | |
if Vagrant.has_plugin?('vagrant-cachier') | |
puts 'INFO: Vagrant-cachier plugin detected. Optimizing caches.' | |
config.cache.enable :chef | |
config.cache.enable :apt | |
else | |
puts 'WARN: Vagrant-cachier plugin not detected. Continuing unoptimized.' | |
end | |
if Vagrant.has_plugin?('Omnibus') | |
puts 'INFO: Vagrant-omnibus plugin detected.' | |
config.omnibus.chef_version = :latest | |
else | |
puts "FATAL: Vagrant-omnibus plugin not detected. Please install the plugin with\n 'vagrant plugin install vagrant-omnibus' before continuing." | |
exit | |
end | |
# This detects the Berkshelf plugin. No, seriously. | |
if Vagrant.has_plugin?('berkshelf') | |
# The path to the Berksfile to use with Vagrant Berkshelf | |
puts 'INFO: Vagrant-berkshelf plugin detected.' | |
config.berkshelf.berksfile_path = './Berksfile' | |
else | |
puts "FATAL: Vagrant-berkshelf plugin not detected. Please install the plugin with\n 'vagrant plugin install vagrant-berkshelf' before continuing." | |
exit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment