zuba
zuba

Reputation: 1508

Ansible fails on presumably valid syntax

I work on a playbook. The valid syntax makes ansible complaining

Here is my playbook:

- hosts: tcagents
  tasks:
    - name: Create temporary dir C:\Tmp\windows-sdk-8.0
      win_file: path=C:\TMP\windows-sdk-8.0 state=directory
    - name: Copy windows-sdk-8.0/Windows-SDK-8.0.zip file to temporary dir on a node
      win_copy:
        src: Windows-SDK-8.0.zip
        dest: C:\Tmp\windows-sdk-8.0\Windows-SDK-8.0.zip
    - name: Unzip C:\TMP\windows-sdk-8.0\Windows-SDK-8.0.zip to C:\TMP\windows-sdk-8.0
      win_unzip:
        src: C:\TMP\windows-sdk-8.0\Windows-SDK-8.0.zip
        dest: C:\TMP\windows-sdk-8.0
    - win_command: C:\TMP\windows-sdk-8.0\setup.exe /Quiet /NoRestart
      args:
        chdir: C:\TMP\windows-sdk-8.0

It works without last three lines, but fails with them:

$ ansible-playbook -l windows windows-sdk-8.0/windows-sdk-8.0.yml
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/home/qaexpert/ansible-lab/windows-sdk-8.0/windows-sdk-8.0.yml': line 20, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        dest: C:\TMP\windows-sdk-8.0
    - win_command: C:\TMP\windows-sdk-8.0\setup.exe /Quiet /NoRestart
      ^ here

Here is ansible version:

$ ansible --version
ansible 2.1.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

Please help!

Upvotes: 1

Views: 153

Answers (1)

helloV
helloV

Reputation: 52393

Ansible win_command is new in version 2.2 and you are running 2.1.2

Upvotes: 3

Related Questions