cd ~
virtualenv venv_ansible
. venv_ansible/bin/activate
(venv_ansible): pip install --upgrade pip
(venv_ansible): pip install --upgrade setuptools
(venv_ansible): pip install --upgrade xmltodict
(venv_ansible): pip install --upgrade pywinrm
(venv_ansible): pip install --upgrade requests_kerberos
(venv_ansible): pip install --upgrade pycrypto
(venv_ansible): pip install ansible
(venv_ansible): pip list
ansible (2.4.3.0)
asn1crypto (0.24.0)
bcrypt (3.1.4)
certifi (2018.1.18)
cffi (1.11.5)
chardet (3.0.4)
cryptography (2.1.4)
enum34 (1.1.6)
idna (2.6)
ipaddress (1.0.19)
Jinja2 (2.10)
MarkupSafe (1.0)
ntlm-auth (1.0.6)
paramiko (2.4.0)
pip (9.0.1)
pyasn1 (0.4.2)
pycparser (2.18)
pycrypto (2.6.1)
pykerberos (1.2.1)
PyNaCl (1.2.1)
pywinrm (0.3.0)
PyYAML (3.12)
requests (2.18.4)
requests-kerberos (0.12.0)
requests-ntlm (1.1.0)
setuptools (38.5.1)
six (1.11.0)
urllib3 (1.22)
xmltodict (0.11.0)
(venv_ansible): vi hosts
--------------------------------------------
[windows]
server1.domain.local
[all:vars]
ansible_port=5985
ansible_user=userid@DOMAIN.LOCAL
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
ansible_winrm_transport=kerberos
ansible_winrm_operation_timeout_sec=60
ansible_winrm_read_timeout_sec=70
--------------------------------------------
(venv_ansible): kinit userid@DOMAIN.LOCAL
(venv_ansible): ansible -m win_ping -i hosts windows -vvvvv
ansible 2.4.3.0
config file = None
configured module search path = [u'/home/userid/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/userid/venv_ansible/local/lib/python2.7/site-packages/ansible
executable location = /home/userid/venv_ansible/bin/ansible
python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
No config file found; using defaults
setting up inventory plugins
Parsed /home/userid/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /home/userid/venv_ansible/local/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc
META: ran handlers
Using module file /home/userid/venv_ansible/local/lib/python2.7/site-packages/ansible/modules/windows/win_ping.ps1
<server1.DOMAIN.LOCAL> ESTABLISH WINRM CONNECTION FOR USER: userid@DOMAIN.LOCAL on PORT 5985 TO server1.domain.local
checking if winrm_host server1.domain.local is an IPv6 address
<server1.DOMAIN.LOCAL> WINRM CONNECT: transport=kerberos endpoint=http://server1.domain.local:5985/wsman
<server1.DOMAIN.LOCAL> WINRM CONNECTION ERROR: Bad HTTP response returned from server. Code 400
Traceback (most recent call last):
File "/home/userid/venv_ansible/local/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", line 240, in _winrm_connect
self.shell_id = protocol.open_shell(codepage=65001) # UTF-8
File "/home/userid/venv_ansible/local/lib/python2.7/site-packages/winrm/protocol.py", line 157, in open_shell
res = self.send_message(xmltodict.unparse(req))
File "/home/userid/venv_ansible/local/lib/python2.7/site-packages/winrm/protocol.py", line 242, in send_message
raise ex
WinRMTransportError: Bad HTTP response returned from server. Code 400
server1.domain.local | UNREACHABLE! => {
"changed": false,
"msg": "kerberos: Bad HTTP response returned from server. Code 400",
"unreachable": true
}
On the same machine, I have an older virtualenv which is working fine, the only difference are some module versions:
(venv_ansible_ok): pip list
ansible (2.4.3.0)
asn1crypto (0.24.0)
bcrypt (3.1.4)
certifi (2017.4.17)
cffi (1.11.4)
chardet (3.0.4)
cryptography (2.1.4)
enum34 (1.1.6)
idna (2.6)
ipaddress (1.0.19)
Jinja2 (2.10)
MarkupSafe (1.0)
ntlm-auth (1.0.4)
ordereddict (1.1)
paramiko (2.4.0)
pip (9.0.1)
pyasn1 (0.4.2)
pycparser (2.18)
pycrypto (2.6.1)
pykerberos (1.1.14)
PyNaCl (1.2.1)
pywinrm (0.2.2)
PyYAML (3.12)
requests (2.18.1)
requests-kerberos (0.11.0)
requests-ntlm (1.0.0)
setuptools (38.5.1)
six (1.11.0)
urllib3 (1.21.1)
xmltodict (0.11.0)
Jon
Thanks for the information you provided.
Jordan