I have a lab resident in a vCenter server, the lab includes 5 windows servers and 3 windows 10 Each time I am running a playbook (any playbook) against this lab, 1 error is appeared in TASK [Gathering Facts]:
[WARNING]: Error when collecting winrm facts: You cannot call a method on a null-valued expression. At line:15 char:17 + ...
$ansibleFacts.ansible_win_rm_certificate_expires = $_.Not ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo :
InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull at <ScriptBlock>, <No file>: line 15 at <ScriptBlock>, <No file>: line
13
My all.yml file includes winrm details
---
# WinRM Protocol Details
ansible_user: DOMAIN\hiddai
ansible_password: F01o3O4
ansible_connection: winrm
ansible_port: 5985
ansible_winrm_scheme: http
ansible_winrm_server_cert_validation: ignore
ansible_winrm_kerberos_delegation: false
ansible_winrm_transport: ntlm
ansible_winrm_read_timeout_sec: 70
ansible_winrm_operation_timeout_sec: 60
The following policies are enabled in the domain:
Windows Components/Windows Remote Management (WinRM)/WinRM Client
- Allow Basic authentication
- Allow CredSSP authentication
- Allow undecrypted traffic
- Trusted Hosts
Windows Components/Windows Remote Management (WinRM)/WinRM Service
- Allow remote server management through WinRM
- Allow CredSSP authentication
- Allow Basic authentication
- Allow unencrypted traffic
- Turn On Compatibility HTTP Listener
- Turn On Compatibility HTTPS Listener
How can I resolve those errors?