Last active
May 14, 2019 10:14
-
-
Save christiaan-janssen/7c8174553986f63de5652f27e3b741cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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