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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/56bf1bb2-26bb-983b-a1c9-abe10f847734%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to