Module Suffix's and custom windows modules

119 views
Skip to first unread message

Tony Kinsley

unread,
Jan 8, 2015, 11:04:42 PM1/8/15
to ansible...@googlegroups.com
I have a custom windows module that I have been using in my playbooks and I just went to update to the version 1.8.2 ( installed with pip ). I went to run a playbook that I run all the time and got this error:
/usr/local/bin/ansible-playbook -i ./core/inventory.py --module-path ./modules/ ./main.yml
ERROR: win_exe is not a legal parameter in an Ansible task or handler

My module is in a file called win_exe.ps1 ( it's basically just runs a windows command but adds in support for the creates keyword ) located ./modules. I changed the playbook to specify 

- name: install packages
  win_exe.ps1:
    exe: 'C:\Users\admin_user\Downloads\myapp.exe'
    ArgumentList: '/w /S /v"/l*v \"C:\Users\admin_user\AppData\Local\Temp\myapp.log\" /qn"'
    creates: '{{myapp_root}}/sbin/myapp.exe'


and now it works. I was just wondering whether this is expected and when to expect to require a suffix and when not to expect to need a suffix. Previously I was running ansible version 1.8.

Thanks,
Tony

Chris Church

unread,
Jan 8, 2015, 11:59:15 PM1/8/15
to ansible...@googlegroups.com
It should work without the suffix.  However, I'm seeing the same issue with 1.8, 1.8.1 and 1.8.2.

In my case, it works when using ansible to run an adhoc command, but not ansible-playbook:

ansible -i inventory --module-path modules -m win_exe

I'll see if I can figure out what's going on...


--
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/a15215e0-1b31-49ee-961d-464d2914b72f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Church

unread,
Jan 9, 2015, 12:17:16 AM1/9/15
to ansible...@googlegroups.com
I have an idea what's causing the problem, no fix yet.

For now, you can define your tasks as follows and it will work:

- name: install packages
  action:
    module: win_exe
    exe: 'C:\Users\admin_user\Downloads\myapp.exe'
    ArgumentList: '/w /S /v"/l*v \"C:\Users\admin_user\AppData\Local\Temp\myapp.log\" /qn"'
    creates: '{{myapp_root}}/sbin/myapp.exe'

Brian Coca

unread,
Jan 9, 2015, 8:14:29 PM1/9/15
to ansible...@googlegroups.com
Can you test against the latest devel? there was an issue in which if
you did not have the corresponding win_<mod>.py ansible would not
correctly detect the module existence at 'play compile time'.

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages