Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2023-04-13 Thread ls440
I think i need to hit enter after each responses how is that possible 
because i see the ansible output fails 
 
"Please enter installation path ':", 
"",
"Installation path?\u001b[0m [ /tmp/output\  ]: "



On Thursday, April 13, 2023 at 3:42:36 PM UTC+2 ls440 wrote:

> Hi all,
>
> i am facing the issues with expect module though the timeout: 600 is 
> mentioned, i always get "msg": "command exceeded timeout", i have 
> around 25 reponses to answer.
>   - name: install file
> expect:
>   command: /tmp/install.run
>   responses:
> 'Installation path\? \[/tmp/output\]:': '/tmp/output/new'
> 'Run after installation\? \[yes\]:': 'yes'
>   timeout: 600
>
>
> On Thursday, June 1, 2017 at 5:46:40 PM UTC+2 Kai Stian Olstad wrote:
>
>> On 30. mai 2017 22:47, Murthy Vipparthy wrote: 
>> > During my further installation, I got another error that script is 
>> looking 
>> > for absolute path. Do you know how to avoid absolute path prompt ?? 
>> All the questions the script ask you'll to add it to your responses in 
>> expect. 
>>
>> -- 
>> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/40117cf1-d51d-4ca9-b340-ac4424e9a608n%40googlegroups.com.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2023-04-13 Thread ls440
Hi all,

i am facing the issues with expect module though the timeout: 600 is 
mentioned, i always get "msg": "command exceeded timeout", i have 
around 25 reponses to answer.
  - name: install file
expect:
  command: /tmp/install.run
  responses:
'Installation path\? \[/tmp/output\]:': '/tmp/output/new'
'Run after installation\? \[yes\]:': 'yes'
  timeout: 600


On Thursday, June 1, 2017 at 5:46:40 PM UTC+2 Kai Stian Olstad wrote:

> On 30. mai 2017 22:47, Murthy Vipparthy wrote:
> > During my further installation, I got another error that script is 
> looking
> > for absolute path. Do you know how to avoid absolute path prompt ??
> All the questions the script ask you'll to add it to your responses in 
> expect.
>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fc8bd187-ae30-4653-b2af-924b7e4e46f4n%40googlegroups.com.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-06-01 Thread Kai Stian Olstad

On 30. mai 2017 22:47, Murthy Vipparthy wrote:

During my further installation, I got another error that script is looking
for absolute path. Do you know how to avoid absolute path prompt ??
All the questions the script ask you'll to add it to your responses in 
expect.


--
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/ddae16c8-07da-7f0e-6f84-3bcf82ac64ea%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-05-30 Thread Murthy Vipparthy

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


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-05-28 Thread Kai Stian Olstad

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.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-05-26 Thread Murthy Vipparthy
*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]: "
]
}






On Friday, May 26, 2017 at 10:57:02 AM UTC-7, Kai Stian Olstad wrote:
>
> On 25. mai 2017 22:22, Murthy Vipparthy wrote: 
> >   
> > *Kai* 
> > Here is my playbook command 
> > 
> > # ansible-playbook opencl.yml --ask-become-pass - 
> > 
> > 
> > When I use my Playbook with below option while 
> > 
> >  responses: 
> >   'Press \[Enter\] to continue:': \n 
> >   '--More--' : \r 
> >   'Do you accept this license\?\[y/n\]': y 
> > 
> >I am being stuck @ Output like below and this is NOT further 
> proceeding 
> > for rest of responses 
> > 
> > *   "", "Press [Enter] to continue:", "", "Do 
> you 
> > accept this license? [y/n]: "]}   Any help on this Thank you 
> -Murthy* 
>
> According to your output you are missing a space between the question 
> mark and the square bracket in your responses. 
>
> -- 
> 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/e247f8cc-ccec-4f8c-a256-1c19accfc8ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-05-26 Thread Kai Stian Olstad

On 25. mai 2017 22:22, Murthy Vipparthy wrote:
  
*Kai*

Here is my playbook command

# ansible-playbook opencl.yml --ask-become-pass -


When I use my Playbook with below option while

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

   I am being stuck @ Output like below and this is NOT further proceeding
for rest of responses

*   "", "Press [Enter] to continue:", "", "Do you
accept this license? [y/n]: "]}   Any help on this Thank you -Murthy*


According to your output you are missing a space between the question 
mark and the square bracket in your responses.


--
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/513eb6a4-6986-28ff-a269-ce916f0ef2e5%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2017-05-26 Thread Murthy Vipparthy
 
*Kai*
   Here is my playbook command 

   # ansible-playbook opencl.yml --ask-become-pass -


   When I use my Playbook with below option while 

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

  I am being stuck @ Output like below and this is NOT further proceeding 
for rest of responses 














*   "", "Press [Enter] to continue:", "", "Do you 
accept this license? [y/n]: "]}   Any help on this Thank you -Murthy*


On Friday, August 12, 2016 at 2:31:04 PM UTC-7, Kai Stian Olstad wrote:
>
> On 12. aug. 2016 23:20, chall...@gmail.com  wrote: 
> > thanks, for your suggestion 
> >  i have changed that line but still getting the same error 
> > is there a different way of approach for this problem i am not able to 
> > figure out 
>
> The question mark is also a special character so you need to escape that 
> one also. But then is should work since all the regexp characters is 
> escaped. 
>
>
> -- 
> Kai Stian Olstad 
>
>
On Friday, August 12, 2016 at 2:31:04 PM UTC-7, Kai Stian Olstad wrote:
>
> On 12. aug. 2016 23:20, chall...@gmail.com  wrote: 
> > thanks, for your suggestion 
> >  i have changed that line but still getting the same error 
> > is there a different way of approach for this problem i am not able to 
> > figure out 
>
> The question mark is also a special character so you need to escape that 
> one also. But then is should work since all the regexp characters is 
> escaped. 
>
>
> -- 
> 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/c6b24885-6a7b-4528-9100-4d83869e9b86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2016-08-12 Thread Kai Stian Olstad

On 12. aug. 2016 23:20, challa@gmail.com wrote:

thanks, for your suggestion
 i have changed that line but still getting the same error
is there a different way of approach for this problem i am not able to
figure out


The question mark is also a special character so you need to escape that 
one also. But then is should work since all the regexp characters is 
escaped.



--
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/7990e3e6-4dae-c9e6-961d-1410d158b045%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2016-08-12 Thread challa . tek
thanks, for your suggestion
 i have changed that line but still getting the same error
is there a different way of approach for this problem i am not able to 
figure out

On Friday, August 12, 2016 at 5:02:18 PM UTC-4, Kai Stian Olstad wrote:
>
> On 12. aug. 2016 22:19, chall...@gmail.com  wrote: 
> > "\u001b[7m--More--\u001b[27m\u0007\u0007", "Updates may be licensed to 
> you 
> > by Appligent with additional or different terms.", "", "Do you agree 
> with 
> > this copyright? [y/N] : "]} 
> > 
> > it is like not listening to my next response after more.. i am not able 
> to 
> > understand how this is happening 
> > it is not taking my response for 
> > 'Do you agree with this copyright? [y/N]': y 
>
> That because [ ] are regexp expression, since you mean [ ] literary you 
> need to escape them like this. 
> 'Do you agree with this copyright? \[y/N\]': y 
>
> -- 
> 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/06f68b68-e66d-4734-885b-ab126299efa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Expect module throwing up an error while passing responses

2016-08-12 Thread Kai Stian Olstad

On 12. aug. 2016 22:19, challa@gmail.com wrote:

"\u001b[7m--More--\u001b[27m\u0007\u0007", "Updates may be licensed to you
by Appligent with additional or different terms.", "", "Do you agree with
this copyright? [y/N] : "]}

it is like not listening to my next response after more.. i am not able to
understand how this is happening
it is not taking my response for
'Do you agree with this copyright? [y/N]': y


That because [ ] are regexp expression, since you mean [ ] literary you 
need to escape them like this.

'Do you agree with this copyright? \[y/N\]': y

--
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/b0ee7072-e1b9-a139-79e9-a014008e0525%40olstad.com.
For more options, visit https://groups.google.com/d/optout.