# Run ansible from docker container

**URL:** <https://discuss.elastic.co/t/run-ansible-from-docker-container/225091>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [March 26, 2020, 1:09am UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091 "2020-03-26T01:09:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmclark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xmclark/32/65078_2.png) [@xmclark](https://discuss.elastic.co/u/xmclark)\
**Post date:** [March 26, 2020, 1:09am UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091/1 "2020-03-26T01:09:04Z")

</div>

I'm trying to run ansible to install ES from a docker container host, but I'm running into problems with systemd. Systemd doesn't work easily in docker containers.

I'm not looking to start ES, I only install it with ansible. Is there a way to install and not start? I'm using ansible to build VM images that I deploy and run later.

---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [March 26, 2020, 5:38am UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091/2 "2020-03-26T05:38:29Z")

</div>

We have official [docker images](https://hub.docker.com/_/elasticsearch) and installation [instruction](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/docker.html).  
Would these be useful as a base image of what you are trying to build?

Alternatively, you could install elasticsearch using the archive files [https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html)

---

<div class="post-metadata">

**Author:** ![xmclark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xmclark/32/65078_2.png) [@xmclark](https://discuss.elastic.co/u/xmclark)\
**Post date:** [March 26, 2020, 4:08pm UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091/3 "2020-03-26T16:08:31Z")

</div>

hi @Yang_Wang.

Sorry to be confusing, but I'm not talking about installing elasticsearch in docker. I'm talking about installing elasticsearch in a VM using Ansible, where Ansible is getting executed from a docker container. This is remote installation.

I'm using the elasticsearch supported Ansible package here:

> **[elastic/ansible-elasticsearch](https://github.com/elastic/ansible-elasticsearch)**
>
> Ansible playbook for Elasticsearch. Contribute to elastic/ansible-elasticsearch development by creating an account on GitHub.

The repo mentions engaging with the team on this discuss.

---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [March 26, 2020, 11:57pm UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091/4 "2020-03-26T23:57:36Z")

</div>

Sorry I am not familiar with the ansible roles. Not sure exactly what systemd problem you are running into. Might be helpful if you could share a error log. Also just by searching the ansible repo, there is an option `es_start_service` which can be set to `false` to not start the service after installation.

---

<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:** [April 23, 2020, 11:57pm UTC](https://discuss.elastic.co/t/run-ansible-from-docker-container/225091/5 "2020-04-23T23:57:38Z")

</div>

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