From e38755d897872e796d72bf6219a081c57c1e061a Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Fri, 19 Apr 2019 09:07:35 -0700 Subject: [PATCH] Update install-elasticsearch.yml adding config updates --- .../linux/elastic/install-elasticsearch.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/playbook/linux/elastic/install-elasticsearch.yml b/playbook/linux/elastic/install-elasticsearch.yml index fe40405..1f38dbf 100644 --- a/playbook/linux/elastic/install-elasticsearch.yml +++ b/playbook/linux/elastic/install-elasticsearch.yml @@ -31,6 +31,26 @@ apt: name: elasticsearch + + # This will work on a new install. + # If any changes are needed to the cluster name on an existing install add another function + - name: Config - cluster.name 'elastic-DMI01' + become: true + lineinfile: + path: /etc/elasticsearch/elasticsearch.yml + regex: '^cluster.name' + insertafter: '#cluster.name: my-application' + line: 'cluster.name: elastic-DMI01' + backup: yes + + - name: Config - node.name + become: true + lineinfile: + path: /etc/elasticsearch/elasticsearch.yml + regex: '^node.name' + insertafter: '#node.name: node-1' + line: "node.name: {{ ansible_eno1.ipv4.address }}" + - name: Allow port 9200 though UFW become: true ufw: