ansible 如何在遠程服務器 A 和B 之間複製大文件

見 https://stackoverflow.com/questions/42186301/ansible-create-multiple-folders-if-dont-exist

見 https://stackoverflow.com/questions/25505146/how-to-copy-files-between-two-nodes-using-ansible

- hosts: ServerB
  tasks:
    - name: Transfer file from ServerA to ServerB
      synchronize:
        src: /path/on/server_a
        dest: /path/on/server_b
      delegate_to: ServerA



-----

- hosts: ServerA
  tasks:
    - name: Transfer file from ServerA to ServerB
      synchronize:
        src: /path/on/server_a
        dest: /path/on/server_b
        mode: pull
      delegate_to: ServerB

親測有效

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章