Hi Kai,

I was able to combine both tasks like below and able to work OUT. 





*responses:         'Press \[Enter\] to continue:': \n\r         '--More--' 
: \r         'Do you accept this license\? \[y/n\]': y*

During my further installation, I got another error that script is looking 
for absolute path. Do you know how to avoid absolute path prompt ??

-Murthy




On Sunday, May 28, 2017 at 10:35:10 AM UTC-7, Kai Stian Olstad wrote:
>
> On 26. mai 2017 21:44, Murthy Vipparthy wrote: 
> > *Thank you Kai for response. Unfortunately this did NOT work. Let me 
> > explain this scenario once again.* 
> > 
> > *Here is Complete expect Module Code.* 
> > 
> > - name: Perform auto prompt for *responses* 
> >      expect: 
> >        chdir: /tools/murthy/AOCL-SDK-16.0 
> >        command: /bin/bash setup_pro.sh 
> >        responses: 
> >           'Press \[Enter\] to continue:': \n 
> >           '--More--' : \r 
> > 
> >        timeout: 180 
> >        echo: yes 
> > 
> >    - name: Perform auto prompt for *responses2* 
> >      expect: 
> >        chdir: /tools/murthy/AOCL-SDK-16.0 
> >        command: /bin/bash setup_pro.sh 
> >        responses: 
> >           'Do you accept this license\? \[y/n\]': y\n 
> >        echo: yes 
> > 
> > 
> > *Here is Error and final OUT PUT @ below, Can you explain whether first 
> > expect module being executed ?? I am suspecting this command NOT being 
> > executed and timeout happening. When I run manually from terminal, I 
> need 
> > to press [Enter] command @ least 20 times and works OK. but when I use 
> this 
> > expect module, I am NOT able GET this work. I have also separated two 
> > responses also for easy debugging.* 
> > 
> > fatal: [10.10.10.147]: FAILED! => { 
> >      "changed": true, 
> >      "cmd": "/bin/bash setup_pro.sh", 
> >      "delta": "0:03:07.381255", 
> >      "end": "2017-05-26 12:21:14.170676", 
> >      "failed": true, 
> >      "invocation": { 
> >          "module_args": { 
> >              "chdir": "/tools/murthy/AOCL-SDK-16.0", 
> >              "command": "/bin/bash setup_pro.sh", 
> >              "creates": null, 
> >              "echo": true, 
> >              "removes": null, 
> >              "responses": { 
> >                  "--More--": "\\r", 
> >                  "Press \\[Enter\\] to continue:": "\\n" 
> >              }, 
> >              "timeout": 180 
> >          } 
> >      }, 
> >      "msg": "command exceeded timeout", 
> >      "rc": null, 
> >      "start": "2017-05-26 12:18:06.789421", 
> > 
> > 
> > 
> > Also OUTPUT here 
> > 
> > 
> >     "", 
> >          "", 
> >          "Press [Enter] to continue:\\n", 
> >          "", 
> >          "", 
> >          "Do you accept this license? [y/n]: " 
> >      ] 
> > } 
> You can't split the task in two, now the first task is waiting for a 
> response on "Do you accept this license? [y/n]:", but since your first 
> task doesn't contain that. It hang until the timeout and you get a 
> failed task and the play aborts. 
>
> -- 
> Kai Stian Olstad 
>

-- 
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/64764bcb-e20e-4f1c-a515-7178c0d2d087%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to