plainolneesh commented on a change in pull request #338:
URL: https://github.com/apache/fluo-muchos/pull/338#discussion_r444370906



##########
File path: ansible/roles/elasticsearch/tasks/main.yml
##########
@@ -0,0 +1,78 @@
+---
+#
+# Installing Elasticsearch
+#
+
+ # Add the Elasticsearch yum repo. 
+
+- name: "download elasticsearch rpm"
+  get_url: 
+  args:
+    url: https://artifacts.elastic.co/downloads/elasticsearch/{{ 
elasticsearch_rpm }}
+    dest: /tmp/{{ elasticsearch_rpm }}
+    force: no  
+  
+#Check for file exists 
+
+- name: "check that file exists in directory"
+  stat: 
+    path: /tmp/{{ elasticsearch_rpm }}
+    register: stat_result
+
+ #Install elasticsearch    
+
+- name: "ensure elasticsearch is installed"
+  become: true
+  yum: name=/tmp/{{ elasticsearch_rpm }} state=present
+  when: stat_result.stat.exists == False
+
+
+# Update Elasticsearch config file to allow access (to secure Elasticsearch, 
bind to 'localhost'). 
+
+- name: Updating the config file to allow outside access
+  lineinfile:
+   destfile: /etc/elasticsearch/elasticsearch.yml
+   regexp: 'network.host:'
+   line: 'network.host: 0.0.0.0'
+  become: true
+ 
+# Update Elasticsearch port in config file 
+
+- name: Updating the port in config file 
+  lineinfile:
+   destfile: /etc/elasticsearch/elasticsearch.yml
+   regexp: 'http.port:'
+   line: 'http.port: 9200'
+  become: true
+
+#Update Discovery Settings in config file
+
+- name: Update the Discovery Seed Host 
+  lineinfile:
+   destfile: /etc/elasticsearch/elasticsearch.yml
+   regexp: 'discovery.seed_hosts:'
+   line: 'discovery.seed_hosts: ["leader1"]'
+  become: true
+
+  #Update Discovery Settings in config file
+
+- name: Update the Discovery Seed Host 
+  lineinfile:
+   destfile: /etc/elasticsearch/elasticsearch.yml
+   regexp: 'cluster.initial_master_nodes:'
+   line: 'cluster.initial_master_nodes: ["leader1"]'
+  become: true
+
+#Enable Elasticsearch 
+- name: Enable Elasticsearch
+  service: 

Review comment:
       The "reformatted yml and files" commit handles this. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to