clong / DetectionLab

Automate the creation of a lab environment complete with security tooling and logging best practices
MIT License
4.6k stars 980 forks source link

Exchange deployment on ESXi hangs indefinitely at "Install Exchange Prereqs" ansible task #771

Closed certrik closed 2 years ago

certrik commented 2 years ago

Exchange deployment on ESXi hangs indefinitely at "Install Exchange Prereqs" ansible task and then quits with error ...

TASK [exchange : Install Exchange Prereqs] **************************************************************************************************************************************************
task path: /home/<redacted>/GitHub/DetectionLab/ESXi/ansible/roles/exchange/tasks/main.yml:65
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
Using module file /home/<redacted>/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1                                                                        Pipelining is enabled.
<redacted> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5985 TO <redacted>
EXEC (via pipeline wrapper)
fatal: [<redacted>]: UNREACHABLE! => {                                                                                                                                                           "changed": false,
    "msg": "winrm connection error: HTTPConnectionPool(host='<redacted>', port=5985): Read timed out. (read timeout=30)",                                                                        "unreachable": true
} 
certrik commented 2 years ago

@clong If I run the same script as Administrator locally on the VM it works without errors. So it seems that there is some problem in the way ansible is trying to do it. Is there any way to really see in realtime what is happening in the script via ansible?

clong commented 2 years ago

Part of the reason I deprecated the Exchange boxes was that debugging Ansible was becoming a nightmare. Ansible commands are basically wrapped powershell script, but that act of wrapping the powershell inherently changes the behavior and makes debugging more difficult. Consider the Ansible code for it a "best effort".