# command/shell with data provided on stdin?

**URL:** <https://forum.ansible.com/t/command-shell-with-data-provided-on-stdin/14419>\
**Category:** Ansible Project\
**Created:** [January 24, 2014, 4:52pm UTC](https://forum.ansible.com/t/command-shell-with-data-provided-on-stdin/14419 "2014-01-24T16:52:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan\_Jones](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@Evan\_Jones](https://forum.ansible.com/u/Evan_Jones)\
**Post date:** [January 24, 2014, 4:52pm UTC](https://forum.ansible.com/t/command-shell-with-data-provided-on-stdin/14419/1 "2014-01-24T16:52:23Z")

</div>

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
