ansible语法(2)
目录
fetch
注意:此功能是从其他远程主机下载到本地
|参数|说明|
|-|-|
|dest|远程机器中本地路径(仅能指定文件名),如果dest以/结尾,它将使用源文件的基础名称|
|src|远程机器的远程路径(禁止指定目录)|
|flat|仅传输文件|
传输文件(递归创建目录)
ansible test -m fetch -a "dest=~/ src=/etc/hosts" ansible test -m shell -a "tree ~/"
仅传输文件
#递归删除 ansible test -m file -a "dest=~/192.168.255.101/ state=absent" ansible test -m file -a "dest=~/192.168.255.102/ state=absent" ansible test -m file -a "dest=~/192.168.255.103/ state=absent" ansible test -m file -a "dest=~/192.168.255.104/ state=absent" ansible test -m file -a "dest=~/192.168.255.105/ state=absent" #下载远程机器上的文件 ansible test -m fetch -a "dest=~/ src=/etc/hosts flat=yes" ansible test -m shell -a "ls ~/"
flat设置时,会覆盖同名文件
mount
相关推荐
laisean 2020-09-27
onepiecedn 2020-10-29
guchengxinfen 2020-10-12
houdaiye 2020-09-23
逆时针 2020-08-19
pzczyy 2020-08-19
annan 2020-08-02
hpujsj 2020-07-26
annan 2020-07-18
逆时针 2020-06-21
annan 2020-06-20
逆时针 2020-06-14
逆时针 2020-06-14
awoyaoc 2020-06-12
逆时针 2020-06-09
piaotiejun 2020-06-07
awoyaoc 2020-06-07