Hi,
I am trying to add a key to kibana-keystore via (ansible) script. I have same issue when running via bash directly or via ansible script.
For elasicsearch-keystore this works awesome:
echo mypassword | ./elasticsearch-keystore add -f xpack.security.http.ssl.keystore.secure_password
Tried following things for kibana-keystore:
bash-4.2$ echo kibana | /usr/share/kibana/bin/kibana-keystore -f -x add 'elasticsearch.username'
bash-4.2$ /usr/share/kibana/bin/kibana-keystore list
bash-4.2$ echo kibana | /usr/share/kibana/bin/kibana-keystore -f -x add elasticsearch.username
bash-4.2$ /usr/share/kibana/bin/kibana-keystore list
If I omit -x and -f it works from bash:
bash-4.2$ echo kibana | /usr/share/kibana/bin/kibana-keystore add elasticsearch.username
Enter value for elasticsearch.username: kibana
bash-4.2$
But in ansible I get following error:
fatal: [qdetjt]: FAILED! => {"changed": true, "cmd": "echo kibana1 | ./kibana-keystore add elasticsearch.password", "delta": "0:00:00.420190", "end": "2019-12-17 09:24:23.094345", "msg": "non-zero return code", "rc": 1, "start": "2019-12-17 09:24:22.674155", "stderr": "/usr/share/kibana/src/legacy/server/utils/prompt.js:87\n output.cursorTo(questionPrompt.length);\n ^\n\nTypeError: output.cursorTo is not a function\n at Socket.input.on.char (/usr/share/kibana/src/legacy/server/utils/prompt.js:87:20)\n at Socket.emit (events.js:194:15)\n at addChunk (_stream_readable.js:284:12)\n at readableAddChunk (_stream_readable.js:265:11)\n at Socket.Readable.push (_stream_readable.js:220:10)\n at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)", "stderr_lines": ["/usr/share/kibana/src/legacy/server/utils/prompt.js:87", " output.cursorTo(questionPrompt.length);", " ^", "", "TypeError: output.cursorTo is not a function", " at Socket.input.on.char (/usr/share/kibana/src/legacy/server/utils/prompt.js:87:20)", " at Socket.emit (events.js:194:15)", " at addChunk (_stream_readable.js:284:12)", " at readableAddChunk (_stream_readable.js:265:11)", " at Socket.Readable.push (_stream_readable.js:220:10)", " at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)"], "stdout": "Enter value for elasticsearch.password: ", "stdout_lines": ["Enter value for elasticsearch.password: "]}
Any Idea how I can add an entry to kibana's keystore?
It's a pity, that the keystore application is behaving different in logstash, kibana and elasticsearch!
Thanks, Andreas