forked from project-sunbird/sunbird-learning-platform-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
es_composite_search_cluster_setup.yml
50 lines (49 loc) · 1.63 KB
/
es_composite_search_cluster_setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: composite-search-cluster
name: Setup composite search ES cluster
become: yes
pre_tasks:
- name: Create ecosystem group
become: yes
group:
state: present
name: "{{ ecosystem_group }}"
system: yes
- name: Create ecosystem user
become: yes
user:
state: present
name: "{{ ecosystem_user }}"
comment: ecosystem user
system: yes
createhome: yes
- name: Uncompressing and copying to system path
unarchive:
src: https://sunbirdpublic.blob.core.windows.net/installation/jre-8u144-linux-x64.tar.gz
dest: /opt/
remote_src: yes
keep_newer: yes
become: yes
register: tar
- name: Updating java jre to system path
become: yes
shell: update-alternatives --install /usr/bin/java java /opt/jre1.8.0_144/bin/java 9999
- name: Registering node name
set_fact:
es_instance_name: "{% for servername in play_hosts %}{% if inventory_hostname==servername %}cs-node-{{ loop.index }}{% endif %}{% endfor %}"
remote_user: ecosystem
roles:
- { role: es6,
es_config: {
cluster.name: "elasticsearch-composite-search",
discovery.zen.ping.unicast.hosts: "{{ groups['composite-search-cluster'] }}",
http.port: 9200,
transport.tcp.port: 9300,
node.data: "true",
node.master: "true",
bootstrap.memory_lock: true,
},
es_heap_size: "2g",
es_etc_discovery_zen_ping_unicast_hosts: "{{ groups['composite-search-cluster'] }}",
es_etc_cluster_name: "elasticsearch-composite-search"
}