I've installed Elasticsearch on Windows server with ansible AWX. Now I'm trying to reset initial password to my new password (with ansible as well).
I know I can do it manually with:
D:\elasticsearch-8.6.0\bin\elasticsearch-reset-password -b -u elastic -i
but I can't find a way to do it / read it via ansible.
I can also send API request with ansible:
- name: Push password
ansible.windows.win_uri:
url: http://localhost:9200/_security/user/_password?pretty
method: PUT
url_username: elastic
url_password: my_password
body:
password: my_new_password
headers:
Content-Type: "application/json"
but it requires me providing old password, which I don't know before I reset it manually (and this is what I'm trying to automate).
Is there a way to do it with ansible?