I have problems with de expect module

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

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

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

Anyone can help me???

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

Friend I tryed he code that you given to me but i got some errors

As requested before, can you please send TEXT only and no pictures.

Copy paste text.
NO screen dumps.

Thx

(attachments)

Here comes the error of my playbook…

once check your file name install-scanner.sh is correct?

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.

<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