Unable to install software on Windows with v1.9.2 or v2

Hi all,

I’m getting started with Ansible with the aim of managing Windows servers. My control station is running OSX Yosemite and the target servers are Windows Server 2008 R2. I am testing against a server running in VirtualBox on my laptop.

I prepped the server by:

  1. Installing Chocolatey (v0.9.9.8)
  2. Using choco to install Powershell 4
  3. Running the prep script referenced in the Ansible docs

I started out on my control station with Ansible 1.9.2 installed with pip. I got around the CERTIFICATE_VERIFY_FAILED issue by using the fix-ssl.py callback plugin. Running simple tasks like gathering facts and pinging works. I added a win_chocolatey task to a basic playbook to install JDK7 on the target machine and it never finished. Upon looking at the logs, I could see choco was sitting at the command line waiting for user input (which it obviously wasn’t going to get) - it was asking to confirm execution of the install script.

I saw there has been a fix applied for that (passing -y into the choco command) but it doesn’t seem to be available under 1.9.2 - I only saw it under the devel branch. So I uninstalled the pip installation of Ansible and cloned the repo and now run Ansible from source. But now I’m back at the CERTIFICATE_VERIFY_FAILED problem again as the fix-ssl.py workaround doesn’t work. The callback API changed and I don’t know how to update it.

I guess there are three things I can do from here, in order of preference. Can someone help me to achieve one of the higher preference items?

  1. Find a published version of 1.9 that I can install with pip that has the choco fix (I guess this one isn’t very likely!)
  2. Rewrite the fix-ssl.py callback to work with v2
  3. Keep using 1.9.2 but manually edit the win_chocolatey module to apply the choco fix
    Any help here would be muchly appreciated!

Thanks,
Matt

Hi Matt,

If you create the a directory name “library” in the same level as your playbook and copy the win_choclotey.py and chocolatey.ps1 files from https://github.com/ansible/ansible-modules-extras/tree/devel/windows, the playbook run should pick up the new version of the module.

  • Benno

Hey Benno,

That worked against v1.9.2. You effectively gave me my preferred solution. Thanks!!

my hero!