pressly / sup

Super simple deployment tool - think of it like 'make' for a network of servers
https://pressly.github.io/sup
MIT License
2.48k stars 178 forks source link

Mark host to be asked for password #107

Open ernlel opened 7 years ago

ernlel commented 7 years ago

Ability to mark host with ask: marker and will be prompted to enter password for that host.

# Supfile

networks:
    production:
        hosts:
            - ask:user@1.1.1.1:22

It will prompt: Enter Password for user@1.1.1.1:22:

elena-vi commented 7 years ago

:+1:

VojtechVitek commented 7 years ago

Thanks for the PR!

This is a nice addition, but I'm not a big fan of the "ask:" prefix (the convention is ssh user:password@server.com, so "ask" is rather user than a special Supfile sequence). If we could detect if the remote is asking for password based on stdout fd, that'd be much better. Also, making sup accept one password for multiple hosts would be nice.


I'm thinking of this instead:

  1. networks:
    production:
        hosts:
            - user:$PASSWORD@1.1.1.1:22

    sup -e PASSWORD=$(echo "Enter your password:"; read i; echo $i) production deploy

networks:
    production:
        env:
            PASSWORD: $(cat ~/.passwords/first)
        hosts:
            - user:$PASSWORD@1.1.1.1:22

3.

networks:
    production:
        env:
            PASSWORD: $(echo "Enter your password:"; read i; echo $i)
        hosts:
            - user:$PASSWORD@1.1.1.1:22