1
DevOps 討論版 / Re: [Ansible詢問] 如何從C執行ansible把a的檔案copy到B
« 於: 2016-10-21 10:42 »
這個方法也不錯,我現在是用shell module 用sshpass 去帶密碼然後執行scp,我在搜尋看看有沒有更好的方法。
這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。
<192.168.8.8> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.8.8]'
因為我的Synology nas沒有開啟SFTP,小弟想請問一下如何設定讓他能用scp去copy,謝謝。
- name: copy test
hosts: DNS-Test
sudo: True
tasks:
- name: copy test
synchronize: mode=pull src=/etc/named.conf dest=/tmp/
delegate_to: DNS-Test2
錯誤訊息我在公司實測 2 台 Fortigate 100d 作 IPSEC VPN 傳輸測試,10個 FTP task 同時傳輸的情況下,可以達到 30 MB,約等於 240 Mbps,如果單純使用 Lan speed test 軟體測試約 79 Mbps,我是用 FileZilla Server 跟 Client,只有2台筆電,傳輸設定選擇最大可以同時傳輸10個檔案!另外2台筆電的檔案都是在 SSD 上作讀寫!
$TTL 6000
@ IN SOA dns1.aaa.com. admin.aaa.com. (
2014062601 ; serial
12H ; refresh
1H ; retry
12D ; expire
1H ) ; minimum
@ IN NS dns1.aaa.com.
@ IN NS dns2.aaa.com.
$TTL 6000
@ IN SOA dns1.aaa.com. admin.aaa.com. (
2014062601 ; serial
12H ; refresh
1H ; retry
12D ; expire
1H ) ; minimum
@ IN NS dns1.aaa.com.
@ IN NS dns2.aaa.com.
$TTL 6000
@ IN SOA dns1.aaa.com. admin.aaa.com. (
2014062601 ; serial
12H ; refresh
1H ; retry
12D ; expire
1H ) ; minimum
@ IN NS dns1.aaa.com.
@ IN NS dns2.aaa.com.
#!/bin/bash
#Set up the first subnet's routing table (we'll name it 70)
/sbin/ip route flush table 70
/sbin/ip route add table 70 to 172.70.12.0/23(ISP1) dev eth1
/sbin/ip route add table 70 to default via 172.70.12.1 dev eth1
#Set up the second subnet's routing table (we'll call it 80)
/sbin/ip route flush table 80
/sbin/ip route add table 80 to 172.80.24.0/23(ISP2) dev eth3
/sbin/ip route add table 80 to default via 172.80.24.1 dev eth3
#Create the rules to choose what table to use. Choose based on source IP
#We need to give the rules different priorities; for convenience name priority
#after the table
/sbin/ip rule add from 172.70.12.0/23 table 70 priority 70
/sbin/ip rule add from 172.80.24.0/23 table 80 priority 80
#Flush the cache to make effective
/sbin/ip route flush cache
我可以從外部 Ping的到 ISP2的IP,但是我無法從ISP2的IP做Port Forward,ISP1 IP可以做port forward