Windows Modules

160 views
Skip to first unread message

Nikhil Shah

unread,
Feb 4, 2016, 6:16:54 PM2/4/16
to Ansible Project
I need to do some custom things, (e.g. git pull/pip install -r requirements) on windows. I was able to connect to the machine over kerberos. But those modules don't seem to work on Windows. It's weird b/c the scripts module does work and not listed under windows modules available to use. My question is, how can i achieve this goal and/or is there a "commands" equivalent for windows?

I thought it was a python path issue, so I added:

vars:

    ansible_python_interpreter: "C:\\Python34\\python.exe"




After adding that, I get the following:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named 'grp'

fatal: [qa-codegen01.theorchard.local]: FAILED! => {"changed": false, "failed": true, "parsed": false}



Are we limited to the amount of modules avail for windows?

Brian Coca

unread,
Feb 4, 2016, 6:42:47 PM2/4/16
to Ansible Project
Even if you got it to execute with python, the modules are python2 not python3.



--
Brian Coca

J Hawkesworth

unread,
Feb 7, 2016, 4:32:08 AM2/7/16
to Ansible Project
Script, fetch and raw are the only modules which run against windows that don't start with the win_ prefix.

The scripting language for Windows hosts is powershell, not Python.

You could probably use raw to run commands, but raw will always report changed = true so you would have to handle idempotency yourself.

Depending on what you want to achieve you might need to write a windows module or two.

Hope this helps,

Jon

Reply all
Reply to author
Forward
0 new messages