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>