When you run Connect-NsxtServer in the PowerCLI, it may show “Unable to connect to the remote server“.
Because the error message is a little bit confusing with other login issues. It’s not easy to troubleshoot. The actual reason is the NSX-T uses a self-signed certificate, and the PowerCLI cannot accept the certificate automatically.
The fix is super easy. You need to set the PowerCLI to ignore the invalid certificate with the following command:
Set-PowerCLIConfiguration -Scope User -InvalidCertificateAction:Ignore -Confirm:$false
Provisioning Windows machines with Terraform is easy. Configuring Windows machines with Ansible is also not complex. However, it’s a little bit challenging to combine them. The following steps are some ideas about handling a Windows machine from provisioning to post configuration without modifying the winrm configuration on the guest operating system.
[win] #Group namedc.zhengwu.org#This is the target server list[win:vars]ansible_connection=winrmansible_user=administrator#It's better a domain admin account.ansible_password=P@ssw0rd#Change this passwordansible_port=5985ansible_winrm_transport=kerberosansible_winrm_server_cert_validation=ignore