#!/usr/bin/env python
#coding=utf8
#ff.py
#usage: fab -f ff.py task 
from fabric.api import *

# @task
# def ng_start():
#   '''ng start'''
#   sudo('/etc/init.d/nginx start')

env.user='root'
env.hosts=['ip1','ip2'] 
env.passwords = { 
'root@ip1:22':'A8278XYYT6SU48M9864G',
'root@ip2:22':'84QQ5OBAQG0B08D09D61'
  }


def task():     
 with cd('/'):
   print run('ls')
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐