# Ansible role for opendistro

**URL:** <https://forum.opensearch.org/t/ansible-role-for-opendistro/381>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [April 9, 2019, 7:59am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381 "2019-04-09T07:59:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pemontto](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@pemontto](https://forum.opensearch.org/u/pemontto)\
**Post date:** [April 9, 2019, 7:59am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/1 "2019-04-09T07:59:23Z")

</div>

Is anyone working on an ansible role for opendistro? The [searchguard role](https://github.com/floragunncom/search-guard-ansible) is outdated so would be difficult to use as a base. Not sure how much work would be involved to update [ansible-elasticsearch](https://github.com/elastic/ansible-elasticsearch) to use opendistro OR xpack.

Any ideas?

---

<div class="post-metadata">

**Author:** ![gabidrg](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@gabidrg](https://forum.opensearch.org/u/gabidrg)\
**Post date:** [April 26, 2019, 5:54am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/2 "2019-04-26T05:54:35Z")

</div>

I am currently looking into creating an Ansible role for OpenDistro based on the old searchguard role. By the way, the old SG role does not seem to be very far away from what OpenDistro requires for deployment, or maybe I am missing something essential? I will post a link to a github repo as soon as I have something working and ready for an initial commit.

---

<div class="post-metadata">

**Author:** ![pemontto](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@pemontto](https://forum.opensearch.org/u/pemontto)\
**Post date:** [April 26, 2019, 9:22am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/3 "2019-04-26T09:22:03Z")

</div>

The thing is it’s quite far behind the ansible-elasticsearch repo it forked. Otherwise off the top of my head it would be

- Renaming the SG admin tools and paths
- Confirming the [Java components and tools.jar](https://opendistro.github.io/for-elasticsearch-docs/docs/install/rpm/) are available
- Updating the systemd service template
- Managing CA and certs (should the role do this?)
- Ensure the ES OSS package is installed (this happens as a dependency of opendistroforelasticsearch)

My fork of [ansible-elasticsearch](https://github.com/elastic/ansible-elasticsearch/compare/master...pemontto:feature-opendistro?expand=1), very limited beginnings. It’s perhaps a pipe dream I should give up on, but I’d like to support X-Pack and OpenDistro.

---

<div class="post-metadata">

**Author:** ![rt711](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rt711](https://forum.opensearch.org/u/rt711)\
**Post date:** [April 29, 2019, 7:46pm UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/4 "2019-04-29T19:46:27Z")

</div>

Created a playbook to maintain Open Distro for ElasticSearch: [GitHub - rt711/opendistro-for-elasticsearch-ansible: OpenDistro for ElasticSearch Ansible deployment](https://github.com/rt711/opendistro-for-elasticsearch-ansible)  
Currently deploys the cluster with default passwords but I will change this shortly.  
Feedback welcome.

As far as I know the role requirements will change with new Ansible Galaxy version, so maybe I will revisit the separate role idea a bit later.

---

<div class="post-metadata">

**Author:** ![pemontto](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@pemontto](https://forum.opensearch.org/u/pemontto)\
**Post date:** [April 30, 2019, 7:26am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/5 "2019-04-30T07:26:15Z")

</div>

How does this handle deploying the CA and certificates?

---

<div class="post-metadata">

**Author:** ![rt711](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rt711](https://forum.opensearch.org/u/rt711)\
**Post date:** [April 30, 2019, 8:09pm UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/6 "2019-04-30T20:09:20Z")

</div>

Thank you for the question.  
I hopefully add it this week. The playbook you have seen deploys default ones, but I aim for custom certificate deployment. I have couple of ideas how to do it:

- use Ansible to manage the certs outside the repository: …/certs/
  - this comes first - done /as of 9th May 2019/

- use Ansible to generate CSR, self sign maybe?
  - second

- use Ansible with opendistro tooling to generate the certs

---

<div class="post-metadata">

**Author:** ![vgupta](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vgupta](https://forum.opensearch.org/u/vgupta)\
**Post date:** [August 17, 2019, 12:05pm UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/7 "2019-08-17T12:05:43Z")

</div>

Hi All, I am also going to build my opendistro role and would open source it soon as well. I am trying to support xpack as well. I would welcome the collaboration.

---

<div class="post-metadata">

**Author:** ![alolitas](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@alolitas](https://forum.opensearch.org/u/alolitas)\
**Post date:** [October 2, 2019, 3:40am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/8 "2019-10-02T03:40:33Z")

</div>

Hi @rt711 did you update your Ansible role for the latest Open Distro version 1.2.0? Please submit your Ansible PR at [GitHub - opendistro-for-elasticsearch/opendistro-build: 🧰 Open Distro Build Scripts](https://github.com/opendistro-for-elasticsearch/opendistro-build/) so that we can test and possibly integrate.

---

<div class="post-metadata">

**Author:** ![rt711](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rt711](https://forum.opensearch.org/u/rt711)\
**Post date:** [October 2, 2019, 7:14pm UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/9 "2019-10-02T19:14:50Z")

</div>

Hi @alolitas, I’m in the middle of moving house so there will be some delay, but I will make it work.  
It’s actually a playbook and it has a role for the opendistro related configuration, once I make the required changes it shouldn’t be a big effort to convert it to a role.

---

<div class="post-metadata">

**Author:** ![alolitas](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@alolitas](https://forum.opensearch.org/u/alolitas)\
**Post date:** [November 20, 2019, 4:22am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/10 "2019-11-20T04:22:41Z")

</div>

Hi @rt711 Let us know when you’re ready to update the Ansible role to the latest Open Distro version.

---

<div class="post-metadata">

**Author:** ![creativefre](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creativefre](https://forum.opensearch.org/u/creativefre)\
**Post date:** [February 19, 2020, 12:15pm UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/11 "2020-02-19T12:15:39Z")

</div>

Any update on the ansible role for opendistro?

---

<div class="post-metadata">

**Author:** ![alolitas](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@alolitas](https://forum.opensearch.org/u/alolitas)\
**Post date:** [May 12, 2020, 7:16am UTC](https://forum.opensearch.org/t/ansible-role-for-opendistro/381/12 "2020-05-12T07:16:10Z")

</div>

Hi @creativefre we’re in the process of reviewing an Ansible role for Open Distro? Stay tuned. Please watch the [GitHub - opendistro-for-elasticsearch/opendistro-build: 🧰 Open Distro Build Scripts](https://github.com/opendistro-for-elasticsearch/opendistro-build) repo for updates.
