# Struggling with TLS on Elasticsearch \[Ansible\]

**URL:** <https://discuss.elastic.co/t/struggling-with-tls-on-elasticsearch-ansible/378297>\
**Category:** Elasticsearch\
**Created:** [May 19, 2025, 12:09pm UTC](https://discuss.elastic.co/t/struggling-with-tls-on-elasticsearch-ansible/378297 "2025-05-19T12:09:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![H\_TS](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@H\_TS](https://discuss.elastic.co/u/H_TS)\
**Post date:** [May 19, 2025, 12:09pm UTC](https://discuss.elastic.co/t/struggling-with-tls-on-elasticsearch-ansible/378297/1 "2025-05-19T12:09:35Z")

</div>

Hello everyone,

I am currently deploying an Elastic Stack on Azure VM's using Ansible. The installation of the components was ofcourse a walk in the park, but I can't seem to get TLS to work properly. Whenever I try to run my playbooks, the Elasticsearch services refuses to start, resulting in a fatal error like so;

```auto
TASK [Enable and restart elasticsearch] **********************************************************************************************************************************************************************************************
fatal: [52.232.35.228]: FAILED! => {"changed": false, "msg": "Unable to start service elasticsearch: Job for elasticsearch.service failed because the control process exited with error code.\nSee \"systemctl status elasticsearch.service\" and \"journalctl -xeu elasticsearch.service\" for details.\n"}

PLAY RECAP ***************************************************************************************************************************************************************************************************************************
52.232.35.228 : ok=16 changed=5 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 

```

After some more investigation, I found out Elasticsearch faild to bind service as shown below;

```auto
[2025-05-19T12:06:26,352][ERROR][o.e.b.Elasticsearch] [52.232.35.228] fatal exception while booting Elasticsearchorg.elasticsearch.ElasticsearchException: Failed to bind service
        at org.elasticsearch.server@9.0.1/org.elasticsearch.node.NodeConstruction.prepareConstruction(NodeConstruction.java:308)
        at org.elasticsearch.server@9.0.1/org.elasticsearch.node.Node.<init>(Node.java:185)
        at org.elasticsearch.server@9.0.1/org.elasticsearch.bootstrap.Elasticsearch$2.<init>(Elasticsearch.java:426)
        at org.elasticsearch.server@9.0.1/org.elasticsearch.bootstrap.Elasticsearch.initPhase3(Elasticsearch.java:426)
        at org.elasticsearch.server@9.0.1/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:102)

See logs for more details.

ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/elasticsearch-cluster.log

ERROR: Elasticsearch died while starting up, with exit code 1

```

I'm not really sure what's going wrong here, is there anyone who has experienced this before or someone who has a solution? If any more context is needed, i'd be glad to provide this.

-Harmen

---

<div class="post-metadata">

**Author:** ![H\_TS](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@H\_TS](https://discuss.elastic.co/u/H_TS)\
**Post date:** [May 19, 2025, 12:47pm UTC](https://discuss.elastic.co/t/struggling-with-tls-on-elasticsearch-ansible/378297/2 "2025-05-19T12:47:06Z")

</div>

Fixed it, Elasticsearch Data folder was missing.
