#!/usr/bin/python
#encoding: utf-8
from fabric.api import *
#from fabric.colors import *
#import fabtools
#env.hosts = ['root@192.168.168.128']
env.hosts=[]
env.user='root'
env.password ='123stnc'
with open('/usr/local/sbin/iplist','r') as file:
for f in file:
ipaddr = f.split()[0]
env.hosts.append(ipaddr)
env.command_timeout = 1200000
#def hello():
#run('mkdir -p /var/www/myapp')
#get('/var/log/maillog','/usr/local/sbin/ysl/')
#put('20190629.log', '/usr/local/sbin/ysl/test.log')
#def restart():
#reboot(wait=500000)
#reboot()
#def date():
#run('date')
#@task
#@parallel(pool_size=10)
def security():
put('/opt/abc.sh','/tmp/abc.sh', mode=0755)
#with cd('/tmp'):
#run('sh /tmp/abc.sh')