# Elasticsearch won't start with Ansible service module

**URL:** <https://discuss.elastic.co/t/elasticsearch-wont-start-with-ansible-service-module/273297>\
**Category:** Elasticsearch\
**Created:** [May 18, 2021, 1:51pm UTC](https://discuss.elastic.co/t/elasticsearch-wont-start-with-ansible-service-module/273297 "2021-05-18T13:51:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferencz](https://avatars.discourse-cdn.com/v4/letter/f/f14d63/32.png) [@Ferencz](https://discuss.elastic.co/u/Ferencz)\
**Post date:** [May 18, 2021, 1:51pm UTC](https://discuss.elastic.co/t/elasticsearch-wont-start-with-ansible-service-module/273297/1 "2021-05-18T13:51:48Z")

</div>

Hi all,

I'm using Ansible to install Elasticsearch and when I want to start the Elasticsearch with service module it won't start but when I execute "service elasticsearch start" manually it is working normally.

Ansible play:

```auto
- name: Start elastic
  service:
    name: elasticsearch
    state: started
    enabled: yes
    use: service
  tags: elastic

```

[Elastic error log](https://pastebin.com/eNaZ8ebm)  
In Ansible it is reporting "changed" for the task execution and not failing.

Other alternatives also not working:

1. "command" module

```auto
command: service elasticsearch start

```

1. "use: sysvinit" parameter in service module

Environment: Ansible 2.10.9, Debian 10.9, Elasticsearch 7.12.1, Python 3.7.3

---

<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:** [June 15, 2021, 1:52pm UTC](https://discuss.elastic.co/t/elasticsearch-wont-start-with-ansible-service-module/273297/2 "2021-06-15T13:52:34Z")

</div>

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