Work around for ansible v2.2 to manage windows 2003 with powershell 2.0

Hi Everyone
My circumstance required me to be able to reboot windows 2003 servers via ansible and wait for them to come back and check availability. we do not need to properly configuration manage windows 2003 servers. Anyway we can achieve this on a windows 2003 server with powershell 2.0?

Any help or pointing me to useful resource are much appreciated

Regards
JZ

Hi,

I have a couple of ideas:

1/ There’s a pull request to add a module that can run psexec, which might be something you could use, here: https://github.com/ansible/ansible/pull/20141 If you can give that a try and leave some feedback it would help get it added into forthcoming ansible 2.3. There’s some information here about testing ansible pull requests if that’s not something you’ve done before: http://docs.ansible.com/ansible/dev_guide/developing_test_pr.html

Alternatively, I knocked up the following powershell script a long time ago as a proof of concept, but never made use of it (see below). Passing the username and password required as parameters to the script probably isn’t the most secure thing but that might not be your priority.

$ cat legacy_connect.ps1

This example powershell script shows how you can run a remote command on a powershell 2.0 only host