You'll need to use the "shell:" version of the module for the piping of commands:
- name: execute script shell: "yes | bash /tmp/a.sh" On Mon, Jul 14, 2014 at 9:05 AM, Paco p <[email protected]> wrote: > Hello, I need interact with a script, so I have a script as(/tmp/a.sh): > > > read var > > if [[ $var == "y" ]]; > then > exit 0; > else > exit 1; > fi > > > > > And in my playbook > > - name: execute script > command: "yes | bash /tmp/a.sh" > > > > > And I am getting the following: > failed: [192.168.1.104] => {"failed": true, "item": "", "parsed": false} > invalid output was: SUDO-SUCCESS-pmmitceeyaxmudspoxnoywwlhxsrkopg > Killed > > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/1da79ca0-c2f6-4359-b657-49757189e76c%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/1da79ca0-c2f6-4359-b657-49757189e76c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMFyvFjPZqE%3DrgjTewd7XXHGsNvYfLTE6jTaCRJKVWx%3Dyz%2BArw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
