fabric / fabric

Simple, Pythonic remote execution and deployment.
http://fabfile.org
BSD 2-Clause "Simplified" License
14.88k stars 1.94k forks source link

how rsync_project to run on the remote #1503

Closed hanks closed 8 years ago

hanks commented 8 years ago

Here is my scenario:

fabric-question

I want to execute local fab command to rsync code in the bastion server to the web server parallel, but I find rsync_project can only run as a local command, fail to find code base path in my local machine. How to slove this issue, and is there a way to set local host string as the bastion server to let rsync_project run on the bastion server properly?

Thank you for you time.

ploxiln commented 8 years ago

The easiest way is to manually ssh to the bastion server, have the fabfile.py there, and run fab there on the bastion.

Fabric cannot currently run anything on the "gateway" host. That would be a big feature addition.

It is possible that you could make a task which acts on the bastion server, with ssh-agent-forwarding enabled, running a custom rsync command on the bastion server, and specifying the remote serverX as the destination in the custom rsync command. It's up to you to figure out the details of this though.

hanks commented 8 years ago

Thanks, I finally put fabric.py to bastion server as you said.