Re: [ansible-project] Re: expect "Press enter to continue"

2020-07-08 Thread Stefan Hornburg (Racke)
On 7/8/20 12:19 PM, ritesh0...@gmail.com wrote: > Hi Stefano,  > > Is it necessary to install Pexpect on remote machine as well? > > Thanks & Regards, > Ritesh Gupta. Yes, see the module documentation: https://docs.ansible.com/ansible/latest/modules/expect_module.html Regards Racke >

[ansible-project] Re: expect "Press enter to continue"

2020-07-08 Thread ritesh0...@gmail.com
Hi Stefano, Is it necessary to install Pexpect on remote machine as well? Thanks & Regards, Ritesh Gupta. On Thursday, 16 November 2017 19:30:29 UTC+5:30, stefano...@nap-anywhere.com wrote: > > installed pexpect also on remote machine and nowit is working. > > Now the code you suggested provi

[ansible-project] Re: expect "Press enter to continue"

2018-12-13 Thread Abhishek Yadav
Hi Stefano, I'm too working with the expect module for automating bmc shell upgrade for which I need to telnet to a machine and then login into its bmc shell followed by some commands. The problem I'm facing is while logging into the its bmc shell I need to enter user and password followed by 2

[ansible-project] Re: expect "Press enter to continue"

2017-12-20 Thread ayyappan ramanan
Thanks for the update Stefano. Much appreciated. I have been wanting try your script and respond, but did not get a chance. How do you run this playbook without specifying hosts? On Monday, November 20, 2017 at 9:03:33 PM UTC+11, stefano...@nap-anywhere.com wrote: > > Here the code to make the

[ansible-project] Re: expect "Press enter to continue"

2017-11-20 Thread stefano . bianchi
Here the code to make the CLI configuration: * - name: Launch the CLI first time* *expect:* * command: telnet 0 2200* * responses:* *login: "user"* *Password: "passwd"* *Press any key to continue\.: ""* *Enable Secure Backup mode.*: "n"* *Enab

[ansible-project] Re: expect "Press enter to continue"

2017-11-20 Thread stefano . bianchi
Here the code to make the CLI configuration: * - name: Launch the CLI first time* *expect:* * command: telnet 0 2200* * responses:* *login: "user"* *Password: "passwd"* *Press any key to continue\.: ""* *Enable Secure Backup mode.*: "n"* *Enab

[ansible-project] Re: expect "Press enter to continue"

2017-11-20 Thread stefano . bianchi
Hi ayyappan ramanan I finally figured out my issue, now i am able to configure the CLI correctly using expect module as explained by Kai. Once i fixed minor issues, i will post the whole code so that can be helpful to everyone need this kind of configuration. On Wednesday, 15 November 2017 15

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread ayyappan ramanan
Hi Stefano, I am an Ansible newb. I have a similar problem as yours. I was looking for solutions to send break sequence to the console (Ctrl+]). I am unsure if this helps, but in some google groups, I remember seeing EXPECT module being used to interact with such CLIs. Just in case if you did

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread Kai Stian Olstad
On Friday, 17 November 2017 17.46.20 CET stefano.bian...@nap-anywhere.com wrote: > Yes kai it was the problem! > > Now i am sure the number of exit is correct and the configuration go fine, > at the end now i get this message, even if the configuration is done i get > such an error how can i avo

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
Yes kai it was the problem! Now i am sure the number of exit is correct and the configuration go fine, at the end now i get this message, even if the configuration is done i get such an error how can i avoid it? I mean now this error it is not an error, after i finished the configuration i exit

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread Kai Stian Olstad
On Friday, 17 November 2017 17.23.19 CET stefano.bian...@nap-anywhere.com wrote: > Thank you again Kai, > > I tried your code and i get this output: > > *The full traceback is:* > * File "/tmp/ansible_its4CY/ansible_module_expect.py", line 109, in > wrapped* > *return next(resp_gen)* > > *

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
Thank you again Kai, I tried your code and i get this output: *The full traceback is:* * File "/tmp/ansible_its4CY/ansible_module_expect.py", line 109, in wrapped* *return next(resp_gen)* *fatal: [stefano2]: FAILED! => {* *"changed": false,* *"failed": true,* *"invocation": {*

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
Thank you again Kai, I tried your code and i get this output: *The full traceback is:* * File "/tmp/ansible_its4CY/ansible_module_expect.py", line 109, in wrapped* *return next(resp_gen)* *fatal: [stefano2]: FAILED! => {* *"changed": false,* *"failed": true,* *"invocation": {*

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread Kai Stian Olstad
On Friday, 17 November 2017 16.10.08 CET stefano.bian...@nap-anywhere.com wrote: > Thank you Kai > > i write my code here just to explain what i'm doing: > > > - name: Launch the CLI with new password > expect: > command: telnet 0 2200 > responses: > login: "user" >

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
Thank you Kai i write my code here just to explain what i'm doing: - name: Launch the CLI with new password expect: command: telnet 0 2200 responses: login: "user" Password: "password" Press any key to continue\.: "" Enable Secure Backup mode.*:

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
Thank you Kai i write my code here just to explain what i'm doing: - name: Launch the CLI with new password expect: command: telnet 0 2200 responses: login: "admin" Password: "P55tp4xe!" Press any key to continue\.: "" Enable Secure Backup mode.*

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread Kai Stian Olstad
On Friday, 17 November 2017 15.14.18 CET stefano.bian...@nap-anywhere.com wrote: > HI again, > > i'm going on with the cli configuration i'm stuck on this point, i don't > know how to express this: > > *idg(config web-mgmt)#: "some conf"* > > Considering what you suggested for regex for special

[ansible-project] Re: expect "Press enter to continue"

2017-11-17 Thread stefano . bianchi
HI again, i'm going on with the cli configuration i'm stuck on this point, i don't know how to express this: *idg(config web-mgmt)#: "some conf"* Considering what you suggested for regex for special characters. On Wednesday, 15 November 2017 15:07:58 UTC+1, stefano...@nap-anywhere.com wrote:

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread Kai Stian Olstad
On Thursday, 16 November 2017 17.06.18 CET stefano.bian...@nap-anywhere.com wrote: > If i use what you suggest i obtained this: > > > I was expecting that Enable Sec

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
If i use what you suggest i obtained this: I was expecting that Enable Secure Backup was underlined in blue as the previous one, which works properly. On We

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread Kai Stian Olstad
On Thursday, 16 November 2017 15.54.50 CET stefano.bian...@nap-anywhere.com wrote: > Yes Kai! Now i can see the progress within the CLI. > > What about this kind of question? > > Enable Secure Backup mode? Yes/No [y/n]: > > How can i write it? Responses are regex so regexp special character ne

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
Yes Kai! Now i can see the progress within the CLI. What about this kind of question? *Enable Secure Backup mode? Yes/No [y/n]:* How can i write it? On Wednesday, 15 November 2017 15:07:58 UTC+1, stefano...@nap-anywhere.com wrote: > > HI > > I created an ansble role which install on the target

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread Kai Stian Olstad
On Thursday, 16 November 2017 15.00.29 CET stefano.bian...@nap-anywhere.com wrote: > installed pexpect also on remote machine and nowit is working. > > Now the code you suggested provides this output: > > fatal: [stefano2]: FAILED! => { > "changed": true, > "cmd": "telnet 0.0.0.0 2200",

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
installed pexpect also on remote machine and nowit is working. Now the code you suggested provides this output: *fatal: [stefano2]: FAILED! => {* *"changed": true,* *"cmd": "telnet 0.0.0.0 2200",* *"delta": "0:00:26.267272",* *"end": "2017-11-16 14:57:39.806298",* *"failed":

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
I installed pexpect also on remote machine and nowit is working. Now the code you suggested provides this output: *fatal: [stefano2]: FAILED! => {* *"changed": true,* *"cmd": "telnet 0.0.0.0 2200",* *"delta": "0:00:26.267272",* *"end": "2017-11-16 14:57:39.806298",* *"failed":

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
I have a question. I installed pexpect with pip since i had 2.3 version. If i launch the suggested command: *python -c 'import pexpect; print pexpect.__version__'* I am able to see 4.3 version. Then i tried to run the last code suggested by Kai and i get again the error: fatal: [stefano2]: F

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread Kai Stian Olstad
On 16.11.2017 12:15, stefano.bian...@nap-anywhere.com wrote: Step 6 is regarding an IBM command line interface configuration. When i perform the manual configuration after all it has been installed, and the service up, i need to access to the CLI using the following command: *$ telnet 0 2200*

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
Probablyi need to describe my problem better. I need to create a role which performs the following steps: 1. Download prerequisites packages like telnet schroot and wget 2. create the appropriate folder if does not exists 3. download a couple of .rpm packages within this folder 4. ins

[ansible-project] Re: expect "Press enter to continue"

2017-11-16 Thread stefano . bianchi
Probablyi need to describe my problem better. I need to create a role which performs the following steps: 1. Download prerequisites packages like telnet schroot and wget 2. create the appropriate folder if does not exists 3. download a couple of .rpm packages within this folder 4. ins

Re: [ansible-project] Re: expect "Press enter to continue"

2017-11-15 Thread Kai Stian Olstad
On Wednesday, 15 November 2017 16.01.10 CET stefano.bian...@nap-anywhere.com wrote: > i tried to install it on my centos control machine with: yum install -y > pexpect > > i still have the error. Is it the right package? I guess that's the correct package name, but is the version >=3.3, that's

[ansible-project] Re: expect "Press enter to continue"

2017-11-15 Thread stefano . bianchi
i tried to install it on my centos control machine with: yum install -y pexpect i still have the error. Is it the right package? On Wednesday, 15 November 2017 15:07:58 UTC+1, stefano...@nap-anywhere.com wrote: > > HI > > I created an ansble role which install on the target hosts IBM api conne