Skip to content

Instantly share code, notes, and snippets.

@christiaan-janssen
Last active May 14, 2019 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiaan-janssen/7c8174553986f63de5652f27e3b741cf to your computer and use it in GitHub Desktop.
Save christiaan-janssen/7c8174553986f63de5652f27e3b741cf to your computer and use it in GitHub Desktop.
(defun knife-boostrap ()
"Bootstrap a new node using chef."
(interactive)
(let
((ip (read-string "Node IP: "))
(name (read-string "Node name: "))
(role (let ((choices '("default" "mid-server" "unifi-controller")))
(ido-completing-read "Role: " choices))))
(async-shell-command
(concat "knife boostrap " ip
" --ssh-user deploy --sudo --node-name " name
" --run-list 'role[" role "]"
" --json-attributes '{\"cloud\": {\"public_ip\": \"" ip "\"}}' "))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment