Imported from the legacy wiki archive. The date above is inferred from the strongest available evidence and may represent a known range rather than the exact publication day.

Introduction

This document is geared towards Ansible developers and users who are debugging or testing Windows.

Requirements

  • vagrant
  • virtualbox
  • ansible

Initial Setup

  • install ansible
  • pip install git+https://github.com/diyan/pywinrm
  • git clone https://github.com/jborean93/ansible-windows
  • cd ansible-windows/vagrant
  • edit the inventory.yml file and comment out all “domain_children” hosts except for the “SERVER2016” host.
  • export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
  • vagrant up

Once the boxes are downloaded and provisioned, a connection test should fire off in one of the tasks. If you notice it hanging, login to each of the VMs and run this command in an administrator powershell: Reset-WinRMConfig

  • ansible SERVER2016 -vvvvv -i inventory.yml -m win_ping

Switching to kerberos [mac]

  • pip install pywinrm[kerberos]
  • pip install pexpect
  • echo “nameserver 192.168.56.10” > /etc/resolver/domain.local
  • set “ansible_winrm_transport” to “kerberos” in inventory.yml
  • set “ansible_user” to “vagrant-domain@DOMAIN.LOCAL” in inventory.yml
  • set “ansible_password” to “VagrantPass1” in inventory.yml
  • export KRB5_TRACE=/dev/stdout
  • ansible SERVER2016 -vvvvv -i inventory.yml -m win_ping

Appendix

https://github.com/redhat-cop/automate-windows/tree/master/windows-certificates