trying win_msi

59 views
Skip to first unread message

skinnedknuckles

unread,
Nov 10, 2014, 4:26:35 PM11/10/14
to ansible...@googlegroups.com
Ansible 1.8
CentOs 7
Powershell 3

When I run this playbook

---
    - hosts: windows
         tasks:
         - name: test msi installer
          win_msi:
              path='C:/Home/ansmgr/documents/wixedit-0.7.5.msi'
              creates='C:\Program Files (x86)\WixEdit\binaries\WixEdit'
              state=present

I get the following error message

[ansmgr@localhost ansible]$ ansible-playbook test.yml
ERROR: Syntax Error while loading YAML script, test.yml
Note: The error may actually appear before this position: line 4, column 14

    -hosts: windows
        tasks:
             ^


I'm guessing I've missed something very simple but I can't find it.  Is there a recommended YAML editor that can help me with syntax errors?

Matt Martz

unread,
Nov 10, 2014, 4:31:42 PM11/10/14
to ansible...@googlegroups.com
Your indentation is off.  the word "tasks" is indented too far.  Here is a properly indented playbook:

---
- hosts: windows
  tasks:
    - name: test msi installer
      win_msi:
        path='C:/Home/ansmgr/documents/wixedit-0.7.5.msi'
        creates='C:\Program Files (x86)\WixEdit\binaries\WixEdit'
        state=present

There are many editors that should be able to perform syntax highlighting on YAML, such as notepadd++ on Windows, Sublime on Mac.  You can also use something like: http://yaml-online-parser.appspot.com

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7bd867b8-695f-4bf4-aeb3-5ab96ea6ef79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

skinnedknuckles

unread,
Apr 25, 2015, 9:48:55 PM4/25/15
to ansible...@googlegroups.com
Thanks for the tip.  It works fine now.  I should have used a simple YAML format checker.
Reply all
Reply to author
Forward
0 new messages