Skip to content

Instantly share code, notes, and snippets.

@pasdam
Last active December 1, 2018 07:57
Show Gist options
  • Save pasdam/991630164c4d6d604bbb6dfb4bd72c50 to your computer and use it in GitHub Desktop.
Save pasdam/991630164c4d6d604bbb6dfb4bd72c50 to your computer and use it in GitHub Desktop.
Knife bootstrap and undo

The following will bootstrap a new chef node:

knife bootstrap <ip> -i <key> --ssh-user <ssh_user> --sudo -E <environment> --run-list 'recipe[<recipe_name>]' -N <node_name>

where:

  • ip is the ip of the machine to bootstrap;
  • key is the ssh key used to connect to the machine;
  • environment is the environment type, i.e. staging;
  • recipe_name is the recipe name to use;
  • node_name is the name of the node.

To undo the previous just execute:

knife node delete --yes <node_name>
knife client delete --yes <node_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment