Preparing commands to run within fabfile.py"
fabfile.write("from fabric.apiimport run, sudo, task\n\n@task\ndef myinstall():\n\tsudo('yum install httpd')")
在我的fabfile中,我将env.use_ssh_config设置为True。每当我运行fabfile时,它都会从ssh配置中获得正确的hostname和user,但不会获得正确的密钥。它将随机遍历我的密钥(都存储在~/.ssh/中),要求我输入所有密钥的密码,直到得到正确的密钥。Edit -我的fabfile的基本结构,以及我如何运行它
from