From 9fbe65dd546445323f23288c5e1167db64d7cba2 Mon Sep 17 00:00:00 2001 From: Cas van Cooten Date: Mon, 19 Sep 2022 13:01:47 +0200 Subject: [PATCH] Fix non-batch password reset breaking Ansible --- Ansible/roles/elastic_server/files/set-password-elastic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ansible/roles/elastic_server/files/set-password-elastic.sh b/Ansible/roles/elastic_server/files/set-password-elastic.sh index 3965061..dbf8b87 100644 --- a/Ansible/roles/elastic_server/files/set-password-elastic.sh +++ b/Ansible/roles/elastic_server/files/set-password-elastic.sh @@ -1,3 +1,3 @@ # Reset the password -NEW_PASSWORD=$(echo y | /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic | sed -n 's/^New value: \(.*\)$/\1/p') -curl -X POST --insecure --user elastic:$NEW_PASSWORD https://localhost:9200/_security/user/elastic/_password -H 'Content-Type: application/json' -d "{ \"password\" : \"$1\" }" \ No newline at end of file +NEW_PASSWORD=$(echo y | /usr/share/elasticsearch/bin/elasticsearch-reset-password --batch -u elastic | sed -n 's/^New value: \(.*\)$/\1/p') +curl -X POST --insecure --user elastic:$NEW_PASSWORD https://localhost:9200/_security/user/elastic/_password -H 'Content-Type: application/json' -d "{ \"password\" : \"$1\" }"