# Ansible role elastic.elasticsearch - how to set listen address of http and api endpoints

**URL:** <https://discuss.elastic.co/t/ansible-role-elastic-elasticsearch-how-to-set-listen-address-of-http-and-api-endpoints/216096>\
**Category:** Elasticsearch\
**Created:** [January 22, 2020, 4:13pm UTC](https://discuss.elastic.co/t/ansible-role-elastic-elasticsearch-how-to-set-listen-address-of-http-and-api-endpoints/216096 "2020-01-22T16:13:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelvecchio](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@jdelvecchio](https://discuss.elastic.co/u/jdelvecchio)\
**Post date:** [January 22, 2020, 4:13pm UTC](https://discuss.elastic.co/t/ansible-role-elastic-elasticsearch-how-to-set-listen-address-of-http-and-api-endpoints/216096/1 "2020-01-22T16:13:48Z")

</div>

Hi, I'm using [https://github.com/elastic/ansible-elasticsearch](https://github.com/elastic/ansible-elasticsearch) and cannot find the variables to set the listen address of the elasticsearch endpoints. By default, they are set to listen on 'localhost' which is a problem since I cannot create a cluster since the nodes don't communicate with each others.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [January 22, 2020, 5:27pm UTC](https://discuss.elastic.co/t/ansible-role-elastic-elasticsearch-how-to-set-listen-address-of-http-and-api-endpoints/216096/2 "2020-01-22T17:27:50Z")

</div>

Looking briefly, I don't see

```
network.host: "0"

```

With any value in the elasticserach.yml.j2 so it's taking a default. If you add the line above to the template, it should listen on "all interfaces". If you need only specific, you will have to create a variable or possibly "ansible\_default\_ipv4". Try ansible -m setup to see if a correct variable exists.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 19, 2020, 5:27pm UTC](https://discuss.elastic.co/t/ansible-role-elastic-elasticsearch-how-to-set-listen-address-of-http-and-api-endpoints/216096/3 "2020-02-19T17:27:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
