NETWAYS/ansible-collection-elasticstack

Broken name resolution in some molecule scenarios

Closed this issue · 3 comments

Just ran a few molecule tests and found that not all hosts can resolve each other by name. Maybe we should have the names added to /etc/hosts.

I forgot you can't edit /etc/hosts in Docker containers... :-(

Solution would be to add the hosts to the docker call, but since I see no option to add it to Molecule, I'm a bit stuck. Maybe we should go back and fix the problem with the name resolution in the first place, if this problem is reproducable.

I saw it when running: molecule converge -s elasticstack_default. Logstash won't restart and can't connect to Elasticsearch instance on the other host.

Just tested it again. Jumped into one container and tried to reach the other one by name:

[widhalmt@act ~]$ docker exec -it 569069a4646e /bin/bash
[root@elasticstack8-cluster1-rockylinux8 /]# ping elasticstack8-cluster1-rockylinux8
PING elasticstack8-cluster1-rockylinux8 (172.17.0.2) 56(84) bytes of data.
64 bytes from elasticstack8-cluster1-rockylinux8 (172.17.0.2): icmp_seq=1 ttl=64 time=0.074 ms
^C
--- elasticstack8-cluster1-rockylinux8 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.074/0.074/0.074/0.000 ms
[root@elasticstack8-cluster1-rockylinux8 /]# ping elasticstack8-cluster2-rockylinux8
ping: elasticstack8-cluster2-rockylinux8: Name or service not known

Update: Latest tests just went through. Elasticsearch uses IP addresses for clustering and these work. But Logs of e.g. Logstash are full of failed connections to the other node.

Can somebody verify? Is it my molecule / docker installation or is there something broken in our code?

I couldn't reproduce this issue. So I'm closing it.