-
Notifications
You must be signed in to change notification settings - Fork 0
/
elasticsearch_setup.yml
44 lines (44 loc) · 1.33 KB
/
elasticsearch_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
# For ElasticSearch servers
---
- hosts: final_elasticsearch
remote_user: root
gather_facts: no
become: yes
pre_tasks:
- name: update
apt:
update_cache: yes
tasks:
- name: install git
apt:
name: git
- name: Delete /var/www/ for the git checkout
shell: sudo rm -rf /var/www/
- name: Get git checkout
git:
repo: 'https://github.com/dmu1313/CSE356P3.git'
dest: /var/www/
#### Start Elasticsearch stuff ####
- name: Install jdk 8
apt:
name: openjdk-8-jre
update_cache: yes
- name: Get key for Elastic packages
shell: |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- name: Get apt-transport-https
apt:
name: apt-transport-https
- name: Save repository for Elastic packages.
shell: |
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
- name: Get Elastic Search
apt:
name: elasticsearch
update_cache: yes
- name: Elastic search config
shell: |
sudo mv /var/www/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml
sudo chmod 777 /etc/elasticsearch
sudo chmod 777 /var/log/elasticsearch
sudo systemctl restart elasticsearch