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\" }"