当我使用变量时 Fetch 不传输

Fetch doesn't transfer when i use variable

当我使用变量并获取消息 "msg": "the remote file does not exist, not transferring, ignored" 时,获取模块不传输文件。但是文件存在于源目录中。如有不妥请指教

ansible 2.1.0.0

   ---
    - hosts: host_A
    become_user: yes
    gather_facts: no
    tasks:
    - name: list files
      shell: ls -1 /root/stuff/install.1_comiskey-v01
      register: dumpfiles 
    -debug: var=dumpfiles

    - name: fetch files 
      fetch: src={{item}} dest=/tmp/fetched/  flat=yes  
      with_items: ('{{dumpfiles.stdout_lines}}')  
      register: test
    - debug: var=test 

输出:

     TASK [fetch files]                                                                              
     *************************************************************
     ok: [10.1.31.82] => (item=('[u'/root/stuff/install.1_comiskey-v01',u'/root/stuff/install.1_comiskey-v02']'))

     TASK [debug] *******************************************************************
     ok: [10.1.31.82] => {
     "test": {
     "changed": false, 
     "msg": "All items completed", 
     "results": [
            {
                "_ansible_item_result": true, 
                "_ansible_no_log": false, 
                "changed": false, 
                "file": "('[u'/root/stuff/install.1_comiskey-v01', u'/root/stuff/install.1_comiskey-v02']')", 
                "invocation": {
                    "module_args": {
                        "dest": "/tmp/fetched/", 
                        "flat": "yes", 
                        "src": "('[u'/root/stuff/install.1_comiskey-v01', u'/root/stuff/install.1_comiskey-v02']')"
                        }, 
                    "module_name": "fetch"
                    }, 
                "item": "('[u'/root/stuff/install.1_comiskey-v01', u'/root/stuff/install.1_comiskey-v02']')", 
                "msg": "the remote file does not exist, not transferring, ignored"
            }
        ]
        }
        }

从 with_items 中删除括号。您可以注意到调试输出中的项目变量不正确。