From 50bf641b8cc4593891d779858726d5b7efee4f04 Mon Sep 17 00:00:00 2001 From: Wade Rossmann Date: Tue, 25 Aug 2020 23:42:43 -0700 Subject: [PATCH] Properly quote password in shell command (#715) --- tasks/xpack/security/elasticsearch-security.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/xpack/security/elasticsearch-security.yml b/tasks/xpack/security/elasticsearch-security.yml index 50af433..9f29a7c 100644 --- a/tasks/xpack/security/elasticsearch-security.yml +++ b/tasks/xpack/security/elasticsearch-security.yml @@ -28,7 +28,7 @@ - name: Create Bootstrap password for elastic user become: yes - shell: echo "{{es_api_basic_auth_password}}" | {{es_home}}/bin/elasticsearch-keystore add -x 'bootstrap.password' + shell: echo {{ es_api_basic_auth_password | quote }} | {{ es_home }}/bin/elasticsearch-keystore add -x 'bootstrap.password' when: - es_api_basic_auth_username is defined and list_keystore is defined and es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines environment: