Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Connect to Windows VM over WinRM using Azure Driver #188

Open
milind173 opened this issue Sep 1, 2023 · 1 comment
Open

Unable to Connect to Windows VM over WinRM using Azure Driver #188

milind173 opened this issue Sep 1, 2023 · 1 comment

Comments

@milind173
Copy link

milind173 commented Sep 1, 2023

Issue Description

I'm trying to use the Azure driver with Molecule, to test Ansible windows role on a virtual machine created in Azure Cloud.
The Windows virtual machine is successfully created on Azure Cloud with molecule setup.
But molecule is unable to connect to the VM over WinRM unless I manually provide the IP address.

Molecule and Ansible details are here below

molecule 5.1.0 using python 3.9
ansible:2.15.2
azure:0.5.0 from molecule_azure
delegated:5.1.0 from molecule

error message

fatal: [instance]: UNREACHABLE! => {"changed": false, "msg": "basic: HTTPSConnectionPool(host='instance', port=5986): Max retries exceeded with url: /wsman (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7ff698466ee0>: Failed to resolve 'instance' ([Errno -2] Name or service not known)"))", "unreachable": true}

molecule.yml

---
dependency:
  name: galaxy
driver:
  name: azure


platforms:
  - name: "instance"
    hostname: "win-test-molecule"
    image:
      offer: WindowsServer
      publisher: MicrosoftWindowsServer
      sku: 2019-Datacenter
      version: latest
    managed_disk_type: "Premium_LRS"
    managed_disk_size_gb: "128"

provisioner:
  name: ansible
   connection_options:
     ansible_user: <username>
     ansible_password: <password>
     ansible_connection: winrm
     ansible_port: 5986
     ansible_winrm_scheme: https
     ansible_winrm_transport: basic
     ansible_winrm_server_cert_validation: ignore

verifier:
  name: ansible

Please let me know any further details need from my end.

@zhan9san
Copy link
Member

@milind173

Would you please provide the full log?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants