错误冲突的动作声明

时间:2015-09-24 12:30:00

标签: ansible ansible-playbook

我的剧本如下:

hosts: localhost
tasks:
    name: Get the build synchronize: 
    mode=pull src=jenkins_server_ip:/home/capsilon/Jenkins/trunk/builds/{{item}}/ dest=/home/builds/{{item}} 
    with_items:
        ['as2-client', 'amc-gateway', 'router']

hosts: localhost
tasks:
    name: Zip and send 
    command: /bin/sh "/home/zipfile.sh"

hosts: windows
tasks:
    name: Deployment
    win_get_url: 
        url: 'http://server_ip/builds/build.zip' 
        dest: 'D:\build.zip' 
    win_unzip: 
        src: D:\build.zip 
        dest: D:\

收到以下错误:

ERROR! conflicting action statements

The error appears to have been in '/etc/ansible/playbooks/new_logic_zip.yaml': line 16, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:
- name: Deployment
^ here

这里有什么错误? 使用最新的git开发人员代码。任何帮助都会非常感激。

1 个答案:

答案 0 :(得分:1)

它需要在 win_unzip 任务上的 src dest 周围引用,这也需要与 win_get_url分开定义

  - name: Deployment
    win_get_url:
        url: 'http//server_ip/builds/build.zip'
        dest: 'D:\build.zip'

  - win_unzip:
        src: 'D:\build.zip'
        dest: 'D:\'