ansible構文(2)

ディレクトリ

フェッチ

注:この機能は、ローカルに他のリモートホストからダウンロードされた
|パラメータ|説明|
| - | - |
| DEST |ローカルパス(ファイル名のみを指定)でのリモートマシン、destの端部を有する場合は/、それが使用するソースファイルベース名|
| SRC |リモートマシンのリモートパス(禁止指定されたディレクトリ)|
|フラットは| |ファイルのみ転送する
転送ファイルを(再帰的にディレクトリを作成します)

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 ~/"

平らな設定は、同じ名前を上書きした場合

マウント

おすすめ

転載: www.cnblogs.com/anyux/p/12004099.html