expect and "Press <Enter> to continue."

26 views
Skip to first unread message

Jost Rakovec

unread,
Mar 23, 2020, 4:48:37 PM3/23/20
to Ansible Project
Hi

how can I use expect module to responds to  "Press <Enter> to continue." during installation of software on linux?

The questins during installations are:

Press <Enter> to continue.  --> then show licence you have to go to the last line with enter
If yes, enter ‘y’ to accept the license agreement. If no, enter ‘n’ to cancel the installation: y
VVAgent is still running. Do you wish to stop it? ([Y]/n) y
Installation directory? [/opt/BUAgent]
Select language: [en-US]
This will invalidate your previous registration. (y/[N]) N
Select option (A|B) (default A) A



- name: CV upgrade
  expect:
    command: "/root/evault/Agent-Linux-x64-8.63.7483/install.sh"
    responses:
      Question:
         - ''
         - y
         - y
         - /opt/BUAgent
         - en-US
         - N
         - A


in verbose mode I'm getting this:

    "start": "2020-03-23 21:40:15.642239",
    "stdout": "Verifying installer integrity... OK.\r\nVerifying prerequisites... OK.\r\nInstall started at 21:40:16 2020.03.23\r\n\u001b[3;J\u001b[H\u001b[2J--------------------------------------------------------------------------------\r\nBefore installing VVAgent, please read and agree to the terms\r\nand conditions of its user license.\r\n--------------------------------------------------------------------------------\r\nPress <Enter> to continue.",
    "stdout_lines": [
        "Verifying installer integrity... OK.",
        "Verifying prerequisites... OK.",
        "Install started at 21:40:16 2020.03.23",
        "\u001b[3;J\u001b[H\u001b[2J--------------------------------------------------------------------------------",
        "Before installing VVAgent, please read and agree to the terms",
        "and conditions of its user license.",
        "--------------------------------------------------------------------------------",
        "Press <Enter> to continue."



thanks

Jost Rakovec

unread,
Mar 27, 2020, 6:18:55 AM3/27/20
to Ansible Project
Hi

is that possible to do with ansible or no one knows?

thanks

Jean-Yves LENHOF

unread,
Mar 27, 2020, 6:28:31 AM3/27/20
to ansible...@googlegroups.com

I think 'Question' is not a parameter, it's the real question in the sample of ansible expect module

I think you could probably remove this line as you want only one answer to each question.

Regards,

--
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/5feab149-3580-46c5-85cb-35409959c3f5%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages