I am having problems with Fabric without recognizing the hosts that I have in ~/.ssh/config .
My fabfile.py looks like this:
from fabric.api import run, env env.hosts = ['lulu'] def whoami(): run('whoami')
Running $ fab whoami gives:
[lulu] run: whoami
Fatal error: name search failed for Lula
The name lulu is in my ~/.ssh/config , for example:
Host lulu hostname 192.168.100.100 port 2100 IdentityFile ~/.ssh/lulu-key
My first thought is to add something like lulu.lulu to /etc/hosts (I am on a Mac), but then I also have to pass the Fabric identification file - and I would rather keep my authentication (i.e. ~/.ssh/config ) separately from my deployment (i.e. fabfile.py ).
Also, by the way, if you try to connect to the host in the hosts file, fabric.contrib.projects.rsync_project does not seem to recognize the "ports" in hosts.env (ie if you use hosts.env = [lulu:2100] rsync_project call rsync_project be trying to connect to lulu:21 ).
Is there a reason Fabric doesn't recognize this name lulu ?
python ssh fabric
Brian M. Hunt Jun 19 '10 at 21:21 2010-06-19 21:21
source share