1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
     #python /root/setup.py  /etc/ceph/ceph.conf
     #python /root/setup.py  /etc/hosts
     #python /root/setup.py /root/.ssh/authorized_keys
         # 提供 主机名和密码,可以通过paramiko 传送SSH KEY
import  os,sys,time
path  =  sys.argv[ 1 ]
ips  =  open ( '/root/pass.txt' ).readlines()
#for i in range(len(ips)):
for  in  ips:
     #ipadd,passa= i.split(' ')
         ip , ps  =   i.split()
         print  ip , ps
     cmd  = " scp %s %s:%s " % (path,ip,path)
     os.system(cmd)