Hi,

I ran across a problem with expect response the same value to all prompt.

I have a task that execute a command and expecting four prompt the expect 
module response to the first prompt correctly but response to the 2nd & 3rd 
prompt with the same value from the 1st prompt.

 - expect:
    command: /path/to/the/script.sh
    responses:
     '.*?:$': '12345'
     '.*?:$': '12345'
     '.*?:$': 'xena-warrior'
     '.*?:$': '12345'
    echo: yes

All prompts have end of line ':'

>From the output I can see the reponse '12345' in the third prompt and not 
'xena-warrior'.

Any help would greatly appreciated,

David.


On Friday, September 4, 2015 at 4:53:57 AM UTC-5, Edgars wrote:
>
> Hi
>
> I have this task:
>
>   tasks:
>     - expect:
>         command: /path/to/bash/script.sh
>         responses:
>           '#? ': '5'
>           "[y/N]": 'y'
>
> expect module correctly responds to first prompt, but not to second. It 
> responds to second prompt with '5' when it should respond with 'y'.
>
> When I enable echo=yes, I see:
>
> ...
> "#? 5"
>
> "[y/N]5"
>
> ...
>
> You can easily reproduce it with bash script and two echo/read
>
> Edgars
>

-- 
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/f8753982-6d44-4381-b0ca-dda5a0b9b2dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to