I have problems with de expect module

60 views
Skip to first unread message

Javier Esparza

unread,
Oct 1, 2019, 8:17:34 AM10/1/19
to Ansible Project
Hello guys, i have a installation of a scanner, in this instalation y have to anser 4 questions, if i'm agree with the terms etc. i find the expect module but not a lot of information of it. here comes my code..

- name: installation scanner
          expect:
            command: /tmp/uld/install-scanner.sh
            response:
              Questions:
                - "Press Enter to continue or q and then Enter to quit.:" : "\n"
                - "Do you agree ? [y/n]" : "y"
                - "--More--" : "\r"
                - "If you want to configure firewall automatically, enter y or just press Enter. To skip, enter n." : "n"

but i get that:

ErrorAnsible.PNG




Soniya panwar

unread,
Oct 3, 2019, 1:39:34 AM10/3/19
to Ansible Project
Hello Javier,

You are getting this error because you have used response instead of responses in expect module parameters.

Please use the below playbook: 

- name: installation scanner
  expect:
     command: /tmp/uld/install-scanner.sh
      responses:
         Question:
              - "Press Enter to continue or q and then Enter to quit.:" : "\n"
              - "Do you agree ? [y/n]" : "y"
              - "--More--" : "\r"
              - "If you want to configure firewall automatically, enter y or just press Enter. To skip, enter n." : "n"

Thanks 
Soniya

Javier Esparza

unread,
Oct 4, 2019, 11:24:51 AM10/4/19
to Ansible Project
Thanks Soniya for answering, I did it, but I get errors, here they are, I don't know if the error is in the questions or in the answer, can u help me???

ErrorAnsible.PNG

Javier Esparza

unread,
Oct 7, 2019, 5:16:53 PM10/7/19
to Ansible Project
Anyone can help me????


Kai Stian Olstad

unread,
Oct 8, 2019, 11:52:52 AM10/8/19
to ansible...@googlegroups.com
On 07.10.2019 23:16, Javier Esparza wrote:
> Anyone can help me????

I already did by giving you a working task in your previous thread.

--
Kai Stian Olstad

Javier Esparza

unread,
Oct 8, 2019, 12:36:09 PM10/8/19
to Ansible Project
Friend I tryed he code that you given to me but i got some errors

Screenshot_20191008_133306.png

 

Dick Visser

unread,
Oct 8, 2019, 3:50:04 PM10/8/19
to ansible...@googlegroups.com
As requested before, can you please send TEXT only and no pictures. 

Copy paste text.
NO screen dumps. 


Thx

On Tue, 8 Oct 2019 at 18:36, Javier Esparza <javier.e...@gmail.com> wrote:
Friend I tryed he code that you given to me but i got some errors

Screenshot_20191008_133306.png

 

--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/669e5b70-da41-4be8-99d6-ee3c63e2bf7b%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Javier Esparza

unread,
Oct 8, 2019, 5:13:36 PM10/8/19
to Ansible Project
Here comes the error of my playbook..


TASK [Ejecutamos el script] ***************************************************************************************************************************************************************************************************** 
fatal: [MP00402]: FAILED! => {"changed": true, "cmd": "/tmp/uld/install-scanner.sh", "delta": "0:00:30.359897", "end": "2019-10-08 15:04:09.800651", "msg": "command exceeded timeout", "rc": null, "start": "2019-10-08 15:03:39
.440754", "stdout": "**** Running install ...\r\n**** Press 'Enter' to continue or 'q' and then 'Enter' to quit. : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\nEND-USER LICENSE AGREEMENT FO
R SAMSUNG ELECTRONICS SOFTWARE PRODUCT \r\n\r\nIMPORTANT-READ CAREFULLY: This Samsung Electronics End-User License Agreement (\"\r\nEULA\") is a legal agreement between you (either an individual or a single entity\r\n) and Sa
msung Electronics Co., Ltd. (\"SAMSUNG ELECTRONICS\") with respect to the \r\nSAMSUNG ELECTRONICS software product intended to be used with the SAMSUNG device\r\ns. The SAMSUNG ELECTRONICS software product may include associa
ted software comp\r\nonents, media, printed materials and \"online\" or electronic documentation develo\r\nped and provided by SAMSUNG ELECTRONICS (\"SOFTWARE PRODUCT\"). For all other thir\r\nd party software products which 
may be supplied with or for the SAMSUNG devices,\r\n your use of such software products shall be subject to separate terms of use an\r\nd end user license agreements of such third parties.   By installing, copying, d\r\nownlo
ading or using the SOFTWARE PRODUCT, you agree to be bound by the terms of \r\nthis EULA. If you do not agree to the terms of this EULA, you may not install or\r\n use the SOFTWARE PRODUCT. \r\n\r\n1.\tGRANT OF LICENSE. \r\nT
he SOFTWARE PRODUCT is licensed, not sold. Subject to the condition that you ar\r\ne in compliance with the terms of this EULA, SAMSUNG ELECTRONICS grants you the \r\nfollowing licenses: you may install and use as many copies
of the SOFTWARE PRODU\r\nCT, or any prior version for the same operating system, for use strictly for the\r\n personal use, on any computer owned and used by members. No other use, copying \r\nor distribution of the SOFTWARE
PRODUCT is permitted. Your use of the SOFTWARE P\r\n\u001b[7m--Más--\u001b[27m", "stdout_lines": ["**** Running install ...", "**** Press 'Enter' to continue or 'q' and then 'Enter' to quit. : - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -", "END-USER LICENSE AGREEMENT FOR SAMSUNG ELECTRONICS SOFTWARE PRODUCT ", "", "IMPORTANT-READ CAREFULLY: This Samsung Electronics End-User License Agreement (\"", "EULA\") is a l
egal agreement between you (either an individual or a single entity", ") and Samsung Electronics Co., Ltd. (\"SAMSUNG ELECTRONICS\") with respect to the ", "SAMSUNG ELECTRONICS software product intended to be used with the SA
MSUNG device", "s. The SAMSUNG ELECTRONICS software product may include associated software comp", "onents, media, printed materials and \"online\" or electronic documentation develo", "ped and provided by SAMSUNG ELECTRONICS
(\"SOFTWARE PRODUCT\"). For all other thir", "d party software products which may be supplied with or for the SAMSUNG devices,", " your use of such software products shall be subject to separate terms of use an", "d end user
license agreements of such third parties.   By installing, copying, d", "ownloading or using the SOFTWARE PRODUCT, you agree to be bound by the terms of ", "this EULA. If you do not agree to the terms of this EULA, you may n
ot install or", " use the SOFTWARE PRODUCT. ", "", "1.\tGRANT OF LICENSE. ", "The SOFTWARE PRODUCT is licensed, not sold. Subject to the condition that you ar", "e in compliance with the terms of this EULA, SAMSUNG ELECTRONIC
S grants you the ", "following licenses: you may install and use as many copies of the SOFTWARE PRODU", "CT, or any prior version for the same operating system, for use strictly for the", " personal use, on any computer owned
and used by members. No other use, copying ", "or distribution of the SOFTWARE PRODUCT is permitted. Your use of the SOFTWARE P", "\u001b[7m--Más--\u001b[27m"]}    

P. Varsha

unread,
Oct 9, 2019, 1:18:22 AM10/9/19
to ansible...@googlegroups.com
once check your file name install-scanner.sh is correct?

I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.

--
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-proje...@googlegroups.com.

I’m protected online with Avast Free Antivirus. Get it here — it’s free forever.

Javier Esparza

unread,
Oct 9, 2019, 8:12:09 AM10/9/19
to Ansible Project
Yeah that's right. The problem I can read is that the installation does not go to the next question, It stays charging in the terms and conditions part.





Kai Stian Olstad

unread,
Oct 10, 2019, 3:36:12 PM10/10/19
to ansible...@googlegroups.com
On 08.10.2019 23:13, Javier Esparza wrote:
> Here comes the error of my playbook..
>
>
> TASK [Ejecutamos el script]
>> *****************************************************************************************************************************************************************************************************
>> fatal: [MP00402]: FAILED! => {"changed": true, "cmd":
>> "/tmp/uld/install-scanner.sh", "delta": "0:00:30.359897", "end":
>> "2019-10-08 15:04:09.800651", "msg": "command exceeded timeout", "rc":

<snip />

An output without the task/playbook is more and less useless.
For more readability please set the stdout_callback = debug in
ansible.cfg or use this when you run ansible-playbook

ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook playbook.yml

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages