2016-11-11 110 views
1

我試圖用ansible執行兩個服務器之間的簡單複製任務拷貝文件,我的劇本腳本是:不能與ansible 2.2模塊

- hosts: 10.100.12.26 
    remote_user: myUser 
    vars: 
    MERCHANT_API_DEST_DIR: "/tmp/" 
    MERCHANT_API_SRC_DIR: "/source/folder/" 
    tasks: 
    - name: Copy the spring boot jar to the host destiny 
     become: true 
     become_method: sudo 
     copy: 
     src: "{{item}}" 
     dest: "{{MERCHANT_API_DEST_DIR}}" 
     with_fileglob: "{{MERCHANT_API_SRC_DIR}}/file-name-*.jar" 

當我執行的劇本有:

ansible-playbook my-playbook.yml --ask-pass 

我得到的消息:

fatal: [10.100.12.26]: FAILED! => {"failed": true, "msg": "Failed to get information on remote file (/tmp/file-name-1.13.jar): MODULE FAILURE"} 

我無法弄明白的問題是什麼,有人可以幫我嗎?

+1

這是一個已知的bug :https://github.com/ansible/ansible/issues/15721 – helloV

回答

1

我終於找到了如何使它工作,我添加一個命令來執行行:

ansible-playbook my-playbook.yml --ask-pass --ask-become-pass 
0

類似的問題可能會導致具有[變得]布爾錯誤地縮進