win_file_version

19 views
Skip to first unread message

Manish Kumar

unread,
Aug 24, 2019, 6:25:50 AM8/24/19
to Ansible Project
Hi All,

Is there any solution to know why  ansible is throwing below error even after correct syntax ?  It has become very difficult to find as there is no clue even after referring ansible document , everything seems to be fine .


Parsed /home/manish/mk/ansible/win/inventory.yml inventory source with ini plugin
ERROR! 'win_file_version' is not a valid attribute for a Play

The error appears to be in '/home/manish/mk/ansible/win/win_file_version.yml': line 7, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  tasks:
- name: testing
  ^ here

Playbook:

---

- hosts: all
  gather_facts: no

  tasks:
- name: testing
  win_file_version:
    path: C:\Users\Administrator\Downloads\npp.7.7.1.Installer.exe
    register: exe_file_version

- debug:
    msg: '{{ exe_file_version }}'

Thanks,
Manish

Mike Eggleston

unread,
Aug 24, 2019, 11:50:27 AM8/24/19
to ansible...@googlegroups.com
Name should be indented under tasks. 

Mike
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/49befd91-f222-4934-aaae-0ca8c46ef653%40googlegroups.com.

Manish Kumar

unread,
Aug 25, 2019, 12:46:54 AM8/25/19
to Ansible Project
Thanks Mike !

Please insert in the yml file what exactly you want to highlight for better understanding  as still I receive same error .

ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context

The error appears to be in '/home/manish/mk/ansible/win/win_file_version.yml': line 7, column 20, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: testing file version
   win_file_version:
                   ^ here
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages