Fix export certificate chain task stuck waiting for input #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When executing the v2.3.0 onward of the playbook, I always faced an issue where the playbook would hang forever on the
Export certificate chain
task.When debugging the issue, all variables were properly populated and available in the task, but the
openssl
shell command would never complete:This shows that the openssl command is stuck. On the role associated to this task, it is currently using
stdin
from theshell
module:From my point of view, this means that openssl isn't accepting the
stdin
parameter for the interactive prompt. It might work for standard input but most probably not for the interactive one.As a solution, we could use the standard command line option
-password
fromopenssl
. That's the purpose of this PR. I tested this change and I can see the playbook proceeding properly and the .pem file is being generated successfully (and the content is the same as if you try to execute the openssl command manually).There are 3 occurrences of
stdin
currently and they are all inside theroles/java/tasks/keystores.yml
file:Somehow, the
stdin
doesn't work for thename: Export certificate chain
(openssl) task but it does work for thename: Get certificate container aliases
(keytool). I couldn't check the 3rd one since they are all "skipping" for me.