How can I automate step 2 and pass a password to the following 2 commands?
./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password.
./bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password
stephenb
(Stephen Brown)
May 12, 2023, 7:12pm
2
Hi @Chuck_Reynolds
Did you look at this ?
To pass the settings values through standard input (stdin), use the --stdin
flag:
cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set
Values for multiple settings must be separated by carriage returns or newlines.
I didn't but it doesn't really make sense to me.
Step 2 says:
If you entered a password when creating the node certificate, run the following commands to store the password in the Elasticsearch keystore:
then it tells you to enter the following command which prompts you for a password.
I would expect to run the command like this.
./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password password:password123
but that doesn't work.
I need to use ansible to automate this part of the basic security so I need to have away to pass the password with the command.
stephenb
(Stephen Brown)
May 12, 2023, 7:30pm
4
echo
or write the password into a file then cat
via stdin
as shown... that is your only option at the moment...
When you say
the.setting.name.to.set
What is the setting name?
stephenb
(Stephen Brown)
May 12, 2023, 8:05pm
6
in your example
echo -e "thepassword" > pw.txt
cat ./pw.txt | bin/elasticsearch-keystore add --stdin xpack.security.transport.ssl.keystore.secure_password
That should work I just tested it, that is bash
... whatever is the equivalent in ansible
system
(system)
Closed
June 9, 2023, 8:05pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.