ping: : Name or service not known - while pinging a valid ip

Well, This appears to be a known issue to many but I've applied many of the workarounds I found online but none of them worked!

I'm running packer from a docker container to build an image on openstack. I could get the ip address of the instance but couldn't ping/ssh/execute ansible within packer provisioners.

All of them fail with this error:

openstack: ping: 172.30.16.165: Name or service not known

Funny thing is I could ping the same ip from other machines and the docker container executing packer. So, not sure why the packer provisioner couldn't do. DNS & network settings of the host & docker container are all same.

Also, I could connect to other floating ips on the same openstack tenant. I'm using floating-ip-network to assign to an external ip to connect to the instance at a later point.

{ "type": "shell", "expect_disconnect": "true", "inline": [ "echo Rebooting...", "sudo -u root /sbin/init 6" ] }, { "type": "shell", "pause_before": "60s", "inline": [ "echo waiting for 60s" ] }, { "type": "shell-local", "inline": [ "ping -c 4 $(cat /tmp/ipaddress)" ] }

I did add the ip to /etc/hosts file but it didn't fix the issue. If someone could help me with this, it would be really great.

Thanks in advance.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like