Skip to content

Instantly share code, notes, and snippets.

@shunwen
Last active August 26, 2018 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shunwen/7178845 to your computer and use it in GitHub Desktop.
Save shunwen/7178845 to your computer and use it in GitHub Desktop.
Vagrant up with chef client
Vagrant.configure("2") do |config|
config.vm.hostname = "NODE NAME" # will be the node name on chef-server.
config.vm.box = "BOX NAME"
config.vm.box_url = "BOX IMAGE DOWNLOAD URL WHEN BOX DOES NOT EXIST"
config.vm.boot_timeout = 180 # Raise error when bootup takes too long
config.omnibus.chef_version = :latest # Use the latest chef version on this box
#config.vm.network :private_network, ip: "33.33.33.10" # THIS CAUSES SSH PROBLEM, remove it
# The path to the Berksfile to use with Vagrant Berkshelf
config.berkshelf.berksfile_path = "./Berksfile"
config.berkshelf.enabled = true
config.vm.provision :chef_client do |chef|
chef.log_level = :debug # This generates lots of detail messages
chef.chef_server_url = "https://api.opscode.com/organizations/ORGANIZATION_NAME"
chef.validation_client_name = "ORGANIZATION_NAME-validator"
chef.validation_key_path = "~/.chef/ORGANIZATION_NAME-validator.pem"
chef.json = {}
chef.run_list = []
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment