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

ansible fatal: [192.168.x.x]: UNREACHABLE #12

Closed
n00bdotlocal opened this issue Jul 8, 2022 · 5 comments
Closed

ansible fatal: [192.168.x.x]: UNREACHABLE #12

n00bdotlocal opened this issue Jul 8, 2022 · 5 comments
Labels
good first issue Good for newcomers

Comments

@n00bdotlocal
Copy link

n00bdotlocal commented Jul 8, 2022

Provisioning the VMs with ansible fails immediately due to not being able to reach the network.Output below. Have tried to then statically set the IP addresses on the Windows VMs however this also does not resolve the issue.

ansible-playbook main.yml
[WARNING]: Could not match supplied host pattern, ignoring: srv01

PLAY [build all] ******************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************
^C [ERROR]: User interrupted execution
^C
ansible-playbook build.yml
[WARNING]: Could not match supplied host pattern, ignoring: srv01

PLAY [build all] ******************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************
fatal: [192.168.56.10]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.10', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90e419c490>, 'Connection to 192.168.56.10 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.22]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.22', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90e419c580>, 'Connection to 192.168.56.22 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.11]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.11', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90e419c580>, 'Connection to 192.168.56.11 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.12]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.12', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90e419c580>, 'Connection to 192.168.56.12 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.23]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.23', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90e419c580>, 'Connection to 192.168.56.23 timed out. (connect timeout=500)'))", "unreachable": true}

PLAY RECAP ************************************************************************************************************************************************************************************************
192.168.56.10 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.56.11 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.56.12 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.56.22 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.56.23 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

@n00bdotlocal n00bdotlocal changed the title ansible fatal: [192.168.56.10]: UNREACHABLE! ansible fatal: [192.168.56.10]: UNREACHABLE Jul 8, 2022
@n00bdotlocal n00bdotlocal changed the title ansible fatal: [192.168.56.10]: UNREACHABLE ansible fatal: [192.168.x.x]: UNREACHABLE Jul 8, 2022
@PaQoo
Copy link

PaQoo commented Jul 8, 2022

Hey ,

I had the same error using the latest version of vagrant (2.2.19) , but i fixed this issue by downgrading vagrant to the previous version (2.2.18)

@Mayfly277
Copy link
Collaborator

can you reach the vm with winrm (login:vagrant/ pass: vagrant) ?
As far as i know (i have no windows host to test), if you use vmware provider the ip are not set up automatically.
You will have to setup the vmnet network to dhcp to get the eth1 working, BUT the ip will not be the same as the one setup in the ansible lab inventory file (hosts). You will have to edit it to setup the ip given by the dhcp.
Also depending of your configuration maybe a downgrade of vagrant can solve the issue like said by @PaQoo.

Please give me this informations when you open an issue:

  • operating system
  • vagrant and ansible version
  • provider (virtualbox or vmware)

By now i could only guarantee the lab work well with a linux operating system and the virtualbox provider.

@Siopy
Copy link

Siopy commented Jul 12, 2022

I have the same problem.

Operating system : Ubuntu 22.04
Vagrant : 2.2.18
Ansible : 2.12.6
Provider : virtualbox

When I connect to the box, the ip is correctly assigned. I tried to run a cme, it does not return any results.

TASK [Gathering Facts] ****************************************************************************************
fatal: [192.168.56.23]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.23', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fdebaf951e0>, 'Connection to 192.168.56.23 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.10]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.10', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fdebaf94f40>, 'Connection to 192.168.56.10 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.12]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.12', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fdebaf951e0>, 'Connection to 192.168.56.12 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.22]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.22', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fdebaf951e0>, 'Connection to 192.168.56.22 timed out. (connect timeout=500)'))", "unreachable": true}
fatal: [192.168.56.11]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='192.168.56.11', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fdebaf951e0>, 'Connection to 192.168.56.11 timed out. (connect timeout=500)'))", "unreachable": true}

PLAY RECAP ****************************************************************************************************
192.168.56.10              : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   
192.168.56.11              : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   
192.168.56.12              : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   
192.168.56.22              : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0   
192.168.56.23              : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0 

@6b6f6c6a61
Copy link

For me installing vagrant 2.2.18 as @PaQoo mentioned and then running vagrant up --provision before using Ansible fixed the issue. I guess the initial failure caused problems during provisioning, which then lead to the connection problems.

@Mayfly277 Mayfly277 added the good first issue Good for newcomers label Jul 19, 2022
@Mayfly277
Copy link
Collaborator

i close as a workaround exist and it was due to vagrant and not the lab.

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

No branches or pull requests

5 participants