pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.91k stars 382 forks source link

how can i reuse ssh connection like ssh argument ControlMaster in pyinfra #827

Closed samegek closed 2 years ago

samegek commented 2 years ago

pyinfra host10.py exec -- whoami this will connect ssh remote machine then pyinfra host10.py exec -- hostname this will connect ssh remote machine but i will reuse above ssh connection, dont reconnect remote

samegek commented 2 years ago

it can do this thing. im wrong

Fizzadar commented 2 years ago

@samegek did you manage to do this? I was about to reply saying I didn't think this was possible!

samegek commented 2 years ago

@samegek did you manage to do this? I was about to reply saying I didn't think this was possible!

uncomment the following line in ssh config image