-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_elasticsearch.yml
59 lines (51 loc) · 1.32 KB
/
install_elasticsearch.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
51
52
53
54
55
56
57
58
59
---
- name: Install Elasticsearch on Ubuntu
hosts: all
become: yes
gather_facts: False
tasks:
- name: Update apt repo and cache on all Ubuntu box
apt:
update_cache: yes
force_apt_get: yes
cache_valid_time: 3600
- name: Upgrade all packages on servers
apt:
upgrade: dist
force_apt_get: yes
- name: Set hostname
hostname:
name: elastsrv.citizix.com
- name: Install Common packages
apt:
name:
- vim
- wget
state: latest
- name: Import the Elasticsearch PGP Key
shell: |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
args:
warn: no
- name: Add repository defiition
copy:
dest: /etc/apt/sources.list.d/elastic-7.x.list
content: |
deb https://artifacts.elastic.co/packages/7.x/apt stable main
- name: Install the Elasticsearch package
apt:
name: elasticsearch
state: present
update_cache: yes
notify:
- Start Elasticsearch
- Enable Elasticsearch
handlers:
- name: Start Elasticsearch
systemd:
name: elasticsearch
state: started
- name: Enable Elasticsearch
systemd:
name: elasticsearch
enabled: yes