Add support to send password on deploy

This commit is contained in:
Bruno Tavares 2014-02-21 21:27:32 -03:00
parent 57b73e88fd
commit b783772864
2 changed files with 8 additions and 2 deletions

View File

@ -61,7 +61,7 @@ kickstart compile
Takes an host target and deploy the compiled code on it. Takes an host target and deploy the compiled code on it.
```bash ```bash
kickstart deploy [--sudo] [target] [roles ...] kickstart deploy [--sudo] [--password PASSWORD] target [roles ...]
``` ```
##### Examples ##### Examples
@ -77,6 +77,12 @@ Deploy two roles on a host with an alternative port
kickstart deploy "-p 2222 vagrant@localhost" nodejs redis kickstart deploy "-p 2222 vagrant@localhost" nodejs redis
``` ```
Deploy with sudo and send the password for sudo
```bash
kickstart deploy --sudo --password vagrant "-p 2222 vagrant@localhost" nodejs redis
```
#### local #### local
Deploy localy a recipe that is not over ssh. It basicaly compile and run the install script Deploy localy a recipe that is not over ssh. It basicaly compile and run the install script

View File

@ -1,12 +1,12 @@
#!/bin/bash -e #!/bin/bash -e
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift [[ "$1" == "--sudo" ]] && prefix="sudo " && shift
[[ "$1" == "--password" ]] && shift && prefix="echo \"$1\" | sudo -S " && shift
target=$1 target=$1
[ "$target" ] || echo "Please, provide an ssh target" [ "$target" ] || echo "Please, provide an ssh target"
shift shift
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
[ "$DEBUG" ] && debug="-x" [ "$DEBUG" ] && debug="-x"
remote_command=$( remote_command=$(