Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodtreweek/97346ff1fa310e7796bc6f8a07451998 to your computer and use it in GitHub Desktop.
Save rodtreweek/97346ff1fa310e7796bc6f8a07451998 to your computer and use it in GitHub Desktop.
ansible windows 10 WSL configuration
sudo apt-get -y update
sudo apt-get -y install python
sudo easy_install pip
sudo pip install ansible
sudo pip install "pywinrm>=0.2.2"
# kerberos authentication support
#sudo apt-get install -y python-dev libkrb5-dev krb5-user
#sudo pip install pywinrm[kerberos]
# fix for https://github.com/Microsoft/BashOnWindows/issues/286
sudo apt-get install -y execstack
sudo execstack -c /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/_openssl.so
# test connectivity and authentication
ansible windows -i ./hosts -m win_ping -u [email protected] -k
# windows patches (will not reboot)
ansible windows -i ./hosts -m win_updates -u [email protected] -k
# windows reboot
ansible windows -i ./hosts -m win_reboot -u [email protected] -k
# place file here: ./hosts
[windows]
VM.DOMAIN.COM
# place file here: ./group_vars/windows.yml
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_scheme: https
ansible_winrm_transport: ntlm
ansible_winrm_server_cert_validation: ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment