Expect works off of text to expect and a string to send. I tend to think
of them as questions and answers.
You are required to provide both. At minimum I guess you could do
something like:
- expect:
command: /path/to/custom/command
responses:
".*":
- b
- d
- y
That will answer with those letters, in order, based on any match.
On Mon, Jun 13, 2016 at 11:28 AM, Sher Chowdhury <[email protected]>
wrote:
> I have an interactive command that prompts me enter a series of letters,
> b, d, and y. I was wondering if it is possible to run something like this:
>
> - expect:
> command: /path/to/custom/command
> responses:
> - b
> - d
> - y
>
> I don't need to do any regex matching, I just need to pass these letters in.
>
> Although I would like to do regex matching if that is possible with my
> version of ansible, by the way, my verion of ansible is:
>
> $ ansible --version
> ansible 2.0.2.0
> config file = /etc/ansible/ansible.cfg
> configured module search path = Default w/o overrides
>
> Thanks Sher
>
> --
> 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/ab584dff-8c7a-431e-bbc5-5f637cf47323%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ab584dff-8c7a-431e-bbc5-5f637cf47323%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Matt Martz
@sivel
sivel.net
--
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/CAD8N0v-3U2USgQzROYYTGYih6MzCG0OEsy%2B-bTHOPRme6QofKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.