Short summary: I need to run a command with some data on stdin (from a variable). Can I do this with any of the built-in modules? It appears the answer is no, so I wrote my own.
Use case: I’m running openssl with a password passed in stdin so it isn’t visible with -v or to other processes, in order to decrypt some data as part of the playbook.
Details:
ansible.module_utils.basic.run_command, which seems to be what the built-in shell and command modules use, has a “data” keyword argument that does exactly what I want, so my “stdin_command” module is pretty trivial. If I submitted a patch to add a “stdin” or “data” argument to the existing shell and command modules, would it be welcomed? Happy to do that if it makes sense.
Thanks,
Evan Jones