Created
July 3, 2014 22:36
-
-
Save X0nic/278f8d2e0daf4d1841bf to your computer and use it in GitHub Desktop.
Vagrantfile loading run_list via json
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
{ | |
"run_list": [ | |
"recipe[nginx]", | |
"role[base]" | |
] | |
} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'multi_json' | |
Vagrant::Config.run do |config| | |
# Will load nodes/vagrant.json | |
VAGRANT_JSON = MultiJson.load(Pathname(__FILE__).dirname.join('nodes', 'vagrant.json').read) | |
config.vm.provision :chef_solo do |chef| | |
chef.cookbooks_path = [ 'cookbooks' , 'site-cookbooks' ] | |
chef.roles_path = "roles" | |
chef.log_level = 'debug' | |
chef.provisioning_path = '/var/chef/cache' | |
# You may also specify custom JSON attributes: | |
chef.json = VAGRANT_JSON | |
VAGRANT_JSON['run_list'].each do |recipe| | |
chef.add_recipe(recipe) | |
end if VAGRANT_JSON['run_list'] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment