Created
October 23, 2013 14:46
-
-
Save mlafeldt/7120176 to your computer and use it in GitHub Desktop.
Vagrantfile which loads Chef attributes from a JSON file
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
# If you want to provide custom Chef attributes that should not end up in Git | |
# (e.g. secret tokens), copy `chef.json.example` to `chef.json` and edit the | |
# latter accordingly (in that case, the example file will be ignored). | |
# ... | |
# Configure Chef Solo provisioner | |
config.vm.provision :chef_solo do |chef| | |
# Tell Vagrant where the cookbooks are located | |
chef.cookbooks_path = "vendor/cookbooks" | |
# Load node attributes and run list from a JSON file | |
json_file = %w(chef.json chef.json.example).select { |f| File.exists? f }.first | |
chef.json = JSON.parse(IO.read(json_file)) | |
# Set Chef log level | |
chef.log_level = ENV.fetch("CHEF_LOG", "info").downcase.to_sym | |
end | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment