• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar

KJBweb

Technical Notes & How To's

  • Home
  • How-to
  • Quick Fixes
  • Examples
  • Hardware
  • Privacy
You are here: Home / Examples / Chef Knife Node Bootstrap Example Command

Chef Knife Node Bootstrap Example Command

November 28, 2016Leave a Comment

Whilst the documentation around the knife bootstrap command is brilliant, I learn better by example/doing, so here’s an example of the syntax I use when bootstrapping new nodes within my infrastructure.

There are variants to this which don’t use the password in the command line, and there are certainly pre-requisites that need to be satisfied before you can just go ahead and register a node against your Chef server, however with that said here’s the command I’ve used most recently:

knife bootstrap {NODE_IP_ADDRESS} -x {USER} -P {PASSWORD}-E {ENVIRONMENT} -N {NODE_NAME} -r 'role[webserver]'

A complete command would look something similar to this:

knife bootstrap 20.65.222.124 -x root -P Jhgt5iJ8y -E production -N web-interface02 -r 'role[webserver]'

Hope this helps someone in a pinch, the mental block can be strong at times.

Filed Under: Examples Tagged With: chef, example

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Copyright © 2025 · WordPress · Log in