Ansible and 'Ubuntu on Windows'

Hello,

Microsoft announced Ubuntu on Windows recently - there’s a bit of information about it here:

https://insights.ubuntu.com/2016/03/30/ubuntu-on-windows-the-ubuntu-userspace-for-windows-developers/

Obviously this opens up intriguing possibility of running Ansible on a windows machine (without a port, which I understand would be an enormous piece of work.

The preview it seems, isn’t quite capable of running Ansible, though. There’s a bug report here https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13333764-python-bugs

If you happen to be interested in this, please vote on the bug report.

Many thanks,

Jon

I run Ansible on Cygwin and never had any problems with it.

Edgars

sestdiena, 2016. gada 9. aprīlis 22:16:42 UTC+2, J Hawkesworth rakstīja:

I just installed Ansible on Windows 10/Ubuntu. Ansible works just fine if I install it with apt-get (that is version 1.5.4). When I installed ansible with pip, I hit the mentioned bug,

Edgars

sestdiena, 2016. gada 9. aprīlis 22:16:42 UTC+2, J Hawkesworth rakstīja:

pirmdiena, 2016. gada 11. aprīlis 21:12:17 UTC+2, Edgars rakstīja:

have you tried with the ppa?

Its been a while and so there have probably been further updates to the Insider builds currently needed to run this, but I just tried this and managed to get ansible 2.1.0 installed via pip and able to win_ping a couple of windows boxes on my network.

To get to 2.1.0 I did the following

sudo pip install ansible

(got me 1.5.4)

sudo pip install ansible --upgrade

This failed first time as it couldn’t find python.h so I guessed I needed the python development package which I got via

sudo apt-get install python-dev

then I re-ran

sudo pip install ansible --upgrade

said ok but ansible didn’t run, so I ran

sudo pip uninstall ansible

and

sudo pip install ansible --upgrade

That got me a version of 2.1.0 than I could run

ansible localhost -m ping

successfully.

Then I ran

sudo pip install pywinrm

set up my inventory and group_vars and then I was able to

ansible windows -m win_ping

to talk to my windows hosts.

If you are thinking of trying this right now you need to

sign up for insider program (requires a microsoft login of some description)
be running 64 bit windows 10 (not sure if Enterprise edition is required, but that’s what I wound up using).
in advanced windows update settings, enable insider builds and slide the slider to ‘Fast’
wait for and grind through a lot of windows updates (for some reason I had to wait a couple of days to get the right update versions).
Go into windows features and enable Windows Subsystem for Linux (Beta)
Go through another reboot
start a dos box and type bash
wait while lots of stuff downloads

Hopefully not long till this gets into a released windows 10 build.

Jon