当我使用变量时,抓取不会转移

萨米尔

当我使用变量并获取消息为“ msg”时,获取模块不会传输文件:“远程文件不存在,不传输,被忽略”。但是文件在源目录中退出。请提出任何错误的建议。

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"
            }
        ]
        }
        }
康斯坦丁·苏沃洛夫(Konstantin Suvorov)

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

当我尝试使用BeautifulSoup从网站抓取时缺少文本

当我使用 where 时 Firestore 不会检索我的数据

每当我在 $_POST 上使用 php 变量作为索引时,即使索引存在,isset() 也不会返回 true

当我使用 *ngFor (Angular 4) 时它不会呈现

当我使用变量String时,更改alertDialog标题的颜色

当我抓取网站时,我产生的项目去哪里了?

当我传递类的变量时,paintComponent方法不会绘制任何内容

Js不会用.val填充输入-当我发布表单时,变量为空

为什么当我不能使用Integer时Java不会告诉我?

当我已经使用静态时,为什么 Django 不会加载我的 CSS 文件?

当我尝试使用 IF 语句为变量赋值时使用未赋值变量错误

当我尝试在.each函数之外使用变量时,变量变为Nan

vue抓取数据时如何使用变量

当我使用javascript更改标签的文本时,为什么querySelectorAll不会弹出功能错误?

当我使用crontab调用Python脚本时,进程不会终止

当我使用“if 语句”之类的函数时,PyTorch optimizer.step() 不会更新权重

当我使用await Console.Out.WriteLineAsync时,程序永远不会完成

当我在DataGridTemplateColumn.CellTemplate中使用TextBox时,不会触发DataGrid.BeginningEdit事件

当我使用Waterline的create方法时,它不会返回新记录的ID

为什么当我使用ngModel。$ setValidity时错误不会转换为模型?

当我使用JS进行发布时,viewmodel不会更新-Asp.net

当我在HTML中使用可变内容时,它不会显示(来自Python,Flask)

当我使用 LLDB 调试 tensorflow 时,不会触发 LLDB 断点“TF_NewSession”

当我使用 glob 搜索时,为什么 grep -r 也不会查看子目录?

当我使用 find_all 函数时,为什么 beautifulsoup 不会返回所有值?

当我使用as.factor()时,为什么我的glm仍在分析多个变量?

当我使用我之前声明的全局变量时,eslint 显示错误

当我使用 onClick 箭头函数时,为什么我的变量未定义?

当我使用“ ng-list”时,我无法在javascript中访问变量模型