使用 ansible 2.1 复制模块时出错

Error with copy module using ansible 2.1

当我的父 ansible 目录中有角色目录时,我能够使用 ansible 2.1 复制模块。然后我继续将 roles 目录移动到我的 playbooks 目录中(因为当我在 playbook 目录中调用 plays 并将角色保留在主 ansible 目录中时,我收到了一个错误,抱怨缺少角色)。现在,当我 运行 执行相同的任务时,复制命令似乎失败并出现下面复制的错误(远程计算机上没有任何更改)。

任务

- copy: src={{ debian_build.stdout }}  dest=/home/ubuntu/ owner=ubuntu group=ubuntu mode=644 backup=yes
  become: true
  become_user: root 
  become_method: sudo

debian_build 是有效路径。

错误

fatal: [testserver]: FAILED! => {"failed": true, "msg": "Failed to get information on remote file (/home/ubuntu/test-server_0.1.0-27686387a8b765f3dfb0bfea287737f97f223f14_all.deb): MODULE FAILURE"}

已更新

site.yml

## move artifacts to remote servers
- include: playbooks/test.yml

playbooks/test.yml

---
- name:  test deployment for xyz 
  hosts: testservers
  strategy: debug  ## turn off if not debugging

  roles:
  - test

test/tasks

main.yml

copy.yml

我也尝试将 copy.yml 修改为以下内容,但均无效。

---
- name: transferring artifact to server
  copy:
    src: "{{ lookup('fileglob','/tmp/test/testproj/target/*.deb', wantlist=true) | first }}"
    dest: /home/ubuntu/
    owner: ubuntu
    group: ubuntu
    mode: 644
    backup: yes
  become: true
  become_user: root 
  become_method: sudo

#  local_action: shell ls -d /tmp/repos/latchapi-beta/target/*.deb
#  register: debian_build
#- debug: msg={{ debian_build.stdout }}

#- copy: src={{ debian_build.stdout }}  dest=/home/ubuntu/ owner=ubuntu group=ubuntu mode=644 backup=yes
#  become: true
#  become_user: root
#  become_method: sudo

当我 运行 使用 -vvv 的剧本时,我在错误消息之前得到以下输出:

ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> ESTABLISH SSH CONNECTION FOR USER: None
<ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> SSH: EXEC ssh -C -q -o ForwardAgent=yes -o Port=1212 -o 'IdentityFile="/home/testuser/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 ec2-abc.def.ghi.jkl.compute-1.amazonaws.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1476129233.91-106561207229420 `" && echo ansible-tmp-1476129233.91-106561207229420="` echo $HOME/.ansible/tmp/ansible-tmp-1476129233.91-106561207229420 `" ) && sleep 0'"'"''
<ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> PUT /tmp/tmpRHKTU1 TO /home/testuser/.ansible/tmp/ansible-tmp-1476129233.91-106561207229420/stat
<ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> SSH: EXEC sftp -b - -C -o ForwardAgent=yes -o Port=1212 -o 'IdentityFile="/home/testuser/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 '[ec2-abc.def.ghi.jkl.compute-1.amazonaws.com]'
<ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> ESTABLISH SSH CONNECTION FOR USER: None
<ec2-abc.def.ghi.jkl.compute-1.amazonaws.com> SSH: EXEC ssh -C -q -o ForwardAgent=yes -o Port=1212 -o 'IdentityFile="/home/testuser/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -tt ec2-abc.def.ghi.jkl.compute-1.amazonaws.com '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-khhahbdoujszvmnsqqqoglhkeeihbcog; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/testuser/.ansible/tmp/ansible-tmp-1476129233.91-106561207229420/stat; rm -rf "/home/testuser/.ansible/tmp/ansible-tmp-1476129233.91-106561207229420/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''

我安装了 acl 工具,然后我的 ansible 剧本开始工作:

- name: install setfacl support
  become: yes
  apt: pkg=acl