Skip to content

Instantly share code, notes, and snippets.

View sppdev's full-sized avatar

LP Ninja sppdev

  • Lonely Planet
View GitHub Profile
@sppdev
sppdev / chef_troubleshooting.md
Created November 8, 2012 21:28 — forked from mriddle/chef_troubleshooting.md
Troubleshooting chef, clients and recipes

Troubleshooting a chef client/recipe

Debugging Chef with Shef

When the chef client fails to run the recipe successfully during bootstrapping sudo chef-client to setup the connection with the chef-server. It will run with an empty run list. After its connected login to http://yourchefserver.com:4040/nodes/_NODE_NAME_, add the roles/recipes to the chef-client and run sudo chef-client from the client again.

When fixing a recipe and re-running make your modifications run knife cookbook upload -a #or cookbook name from your dev machine and run sudo chef-client from the chef client.

When there are issues registering the client with the chef-server check that the chef-client name isn't already registered on the server under clients or nodes or that the client has not already been registered (see below)

@sppdev
sppdev / knife_basics.md
Created November 8, 2012 21:28 — forked from mriddle/knife_basics.md
Using knife

Using Knife

Basic configuration

How to knife the chef

  • Uploading cookbooks
    knife cookbook upload -a
    Will upload all cookbooks
  • Updating cookbooks from source
    knife cookbook site vendor cookbook_name # e.g. jenkins
  • Adding roles knife role from file path/filename.ext #e.g. roles/jenkins_node.json
@sppdev
sppdev / knife.rb
Created November 8, 2012 21:27 — forked from mriddle/knife.rb
Basic knife configuration for chef server
### Chef Knife config example
# https://github.com/fnichol/chef-bootstrap-repo/blob/master/.chef/knife.rb
###
# Environment variables required:
# CHEF_SERVER_URL - IP or url of your chef server
# CHEF_USER - Initial user
# AWS_ACCESS_KEY - AWS Access ID found here https://portal.aws.amazon.com/gp/aws/securityCredentials
# AWS_SECRET_KEY - AWS Secrete key found in link above