3
votes

We just installed Elasticsearch 7.x. We want to use the x-pack security module. We already automated everything via Ansible but we have a problem creating/setting the built in users with password:

ElsticSearch how to:

Run on system: /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive or auto.

Then you are asked for a password for each user in ElasticSearch. Are there any possibilities to automate this? Like some autoanswer question in Ansible or anything else?

Thanks

2

2 Answers

0
votes

If you use the auto mode, then random passwords are generated and written to the console that you can maybe read.

Another solution is to call the Change password API in order to change user passwords after the fact.

0
votes

You can try to use interactive mode and ansible expect module: https://docs.ansible.com/ansible/latest/modules/expect_module.html