arvindshmicrosoft commented on a change in pull request #338: WIP# 254 URL: https://github.com/apache/fluo-muchos/pull/338#discussion_r401959274
########## 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 Review comment: Please keep the alignment of comments consistent and have a space between the # sign and the comment proper. The extra blank line between the comment and the Ansible task is not needed. ---------------------------------------------------------------- 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] With regards, Apache Git Services
