-
Notifications
You must be signed in to change notification settings - Fork 3
/
es_cluster.yml
67 lines (51 loc) · 1.56 KB
/
es_cluster.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
60
61
62
63
64
65
66
67
---
- hosts: all
sudo: True
# user: ashokrajar
tasks:
- name: Copy Dependency Files
copy: src={{ item }} dest=/opt/
with_fileglob:
- software/*
- name: group hosts by distribution
group_by: key="{{ ansible_distribution }}"
- hosts: CentOS:RedHat
sudo: True
# user: ashokrajar
tasks:
- name: Stop iptables
service: name=iptables state=stopped
- name: Install python-httplib2
yum: name=python-httplib2 state=present
- name: Install Java
yum: name=/opt/jdk-7u55-linux-x64.rpm state=present
- name: Install Elastic Search
yum: name=/opt/elasticsearch-1.1.1.noarch.rpm state=present
- hosts: Ubuntu
sudo: True
# user: ashokrajar
tasks:
- name: Install Java
apt: deb=/opt/oracle-java7-jdk_7u55_amd64.deb state=installed
- name: Install Elastic Search
apt: deb=/opt/elasticsearch-1.1.1.deb state=installed
- hosts: all
sudo: True
# user: ashokrajar
vars:
clustername: rootconf
clustermaster: "192.168.10.10"
tasks:
- name: Configure the Nodes
template: src=elasticsearch.j2 dest=/etc/elasticsearch/elasticsearch.yml
- name: Start Daemons
service: name=elasticsearch state=started
tags:
- start_service
- name: Check Service Status
uri: url=http://{{ 192.168.33.10 }}:9200/_cluster/health?pretty return_content=yes
register: response
tags: check_status
- name: Display Service Status
debug: msg="Cluster Status {{ response.content }}"
tags: check_status