-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPSEXP-1635 add elasticsearch role (#432)
- Loading branch information
Showing
11 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
# defaults file for elasticsearch | ||
elasticsearch_tmp_path: /usr/share/elasticsearch/tmp | ||
elasticsearch_systemd_service_path: /etc/systemd/system/elasticsearch.service.d/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
galaxy_info: | ||
author: alfresco | ||
namespace: alfresco | ||
description: Install elasticsearch required by Search Enteprise | ||
company: Hyland Software | ||
|
||
license: Apache-2.0 | ||
|
||
min_ansible_version: "2.12" | ||
|
||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
- bionic | ||
- name: EL | ||
versions: | ||
- "7" | ||
- "8" | ||
|
||
galaxy_tags: [] | ||
|
||
dependencies: | ||
- role: common | ||
- role: buluma.elastic_repo | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include elasticsearch" | ||
include_role: | ||
name: "elasticsearch" |
1 change: 1 addition & 0 deletions
1
roles/elasticsearch/molecule/default/host_vars/elasticsearch-instance.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ansible_user: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: elasticsearch-instance | ||
image: ${MOLECULE_ROLE_IMAGE:-ubuntu:18.04} | ||
dockerfile: ../../../../tests/molecule/Dockerfile-noprivs.j2 | ||
command: "/lib/systemd/systemd" | ||
privileged: true | ||
tmpfs: | ||
- /run | ||
- /run/lock | ||
- /tmp | ||
volume_mounts: | ||
- "/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
groups: | ||
- elasticsearch | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
links: | ||
host_vars: host_vars | ||
group_vars: ../../../../group_vars | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
|
||
- name: Stat the tmp folder for elasticsearch | ||
stat: | ||
path: "/usr/share/elasticsearch/tmp" | ||
register: tmp_path_stat | ||
|
||
- name: Assert that tmp folder is setup correctly | ||
ansible.builtin.assert: | ||
that: | ||
- tmp_path_stat.stat.exists | ||
- tmp_path_stat.stat.isdir | ||
- tmp_path_stat.stat.mode == '0777' | ||
- tmp_path_stat.stat.uid == 0 | ||
- tmp_path_stat.stat.gid == 0 | ||
|
||
- name: Check if port 9200/tcp is listening | ||
wait_for: | ||
port: 9200 | ||
timeout: 30 | ||
connect_timeout: 1 | ||
msg: "Timeout waiting for 9200/tcp to respond" | ||
|
||
- name: Populate service facts | ||
ansible.builtin.service_facts: | ||
|
||
- name: Elasticsearch service is up and running | ||
ansible.builtin.assert: | ||
that: | ||
- ansible_facts.services['elasticsearch.service'] is defined | ||
- ansible_facts.services['elasticsearch.service'].state == 'running' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# tasks file for elasticsearch | ||
- name: Install elasticsearch | ||
become: true | ||
block: | ||
# https://github.com/buluma/ansible-role-elasticsearch/issues/25 | ||
- name: Create alternative tmp directory for elasticsearch | ||
ansible.builtin.file: | ||
path: "{{ elasticsearch_tmp_path }}" | ||
state: directory | ||
mode: "0777" | ||
- name: Create override directory for elasticsearch.service | ||
ansible.builtin.file: | ||
path: "{{ elasticsearch_systemd_service_path }}" | ||
state: directory | ||
mode: "0755" | ||
- name: Set tmpdir override for elasticsearch.service | ||
ansible.builtin.copy: | ||
content: | | ||
[Service] | ||
Environment="ES_TMPDIR={{ elasticsearch_tmp_path }}" | ||
dest: "{{ elasticsearch_systemd_service_path }}/tmpdir.conf" | ||
- name: Install elasticsearch | ||
ansible.builtin.include_role: | ||
name: buluma.elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# vars file for elasticsearch |