From c4d41219bdbd772452fda1e262c6a92a72164b93 Mon Sep 17 00:00:00 2001
From: kaali09 <kaliraja1992@gmail.com>
Date: Thu, 9 Jan 2020 14:34:24 +0530
Subject: [PATCH] DO-2059 updated the syntax error

---
 ansible/roles/log-es6/tasks/elasticsearch-Debian.yml | 12 ++++++++++++
 ansible/roles/log-es6/tasks/elasticsearch-config.yml | 11 -----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/ansible/roles/log-es6/tasks/elasticsearch-Debian.yml b/ansible/roles/log-es6/tasks/elasticsearch-Debian.yml
index ebaaa6174..32b723c32 100644
--- a/ansible/roles/log-es6/tasks/elasticsearch-Debian.yml
+++ b/ansible/roles/log-es6/tasks/elasticsearch-Debian.yml
@@ -29,6 +29,18 @@
   include: elasticsearch-Debian-version-lock.yml
   when: es_version_lock
 
+  #Copy the elasticsearch mandatory variable
+
+- name: Copy the elasticsearch mandatory variables
+  become: yes
+  template:
+    src: environment.j2
+    dest: "{{ env_dir }}/elasticsearch"
+    owner: "{{ es_user }}"
+    group: "{{ es_group }}"
+    mode: 0660
+    force: yes
+
 - name: Debian - Ensure elasticsearch is installed
   become: yes
   apt: name=elasticsearch{% if es_version is defined and es_version != "" %}={{ es_version }}{% endif %} state=present force={{force_install}} allow_unauthenticated={{ 'no' if es_apt_key else 'yes' }} cache_valid_time=86400
diff --git a/ansible/roles/log-es6/tasks/elasticsearch-config.yml b/ansible/roles/log-es6/tasks/elasticsearch-config.yml
index 437b86213..ff788d1c5 100644
--- a/ansible/roles/log-es6/tasks/elasticsearch-config.yml
+++ b/ansible/roles/log-es6/tasks/elasticsearch-config.yml
@@ -15,17 +15,6 @@
   file: path={{ item }} state=directory owner={{ es_user }} group={{ es_group }}
   with_items:
     - "{{data_dirs}}"
-
-#Copy the elasticsearch mandatory variable
-- name: Copy the elasticsearch mandatory variables
-  become: yes
-  template:
-    src: environment.j2
-    dest: "{{ env_dir }}/elasticsearch"
-    owner: "{{ e_user }}"
-    group: "{{ es_group }}"
-    mode: 0660
-    force: yes
     
 #Copy the config template
 - name: Copy Configuration File
-- 
GitLab