The expected string to match is a regex string. As such, things like `?` have special meaning. You can give partial string matches to make it easier, so that you don't have to escape things if that will work for you.
On Fri, Apr 26, 2019 at 5:20 AM Kenneth Fribert <[email protected]> wrote: > Hi All > > I've made a small playbook, that installs pip, and pexpect on our target > servers, as I was thinking I needed to use the expect in the playbook. > > So the yaml looks like this: > > - name: Installing Desktop Central Agent > expect: > command: "/root/DesktopCentral_LinuxAgent.bin" > responses: > "Do you want to uninstall the existing agent and re-install this > agent? (y/n)" : n > > So if it asks (because the playbook is rerun) it should just say "n" > > But it fails with this message: > > fatal: [servername]: FAILED! => {"changed": true, "cmd": > "/root/DesktopCentral_LinuxAgent.bin", "delta": "0:00:30.117165", "end": > "2019-04-26 12:06:47.724526", "msg": "command exceeded timeout", "rc": > null, "start": "2019-04-26 12:06:17.607361", "stdout": "ServerInfo File > Exists. Proceeding with Installation.\r\nAgent Already Installed.\r\nDo you > want to uninstall the existing agent and re-install this agent? (y/n) : ", > "stdout_lines": ["ServerInfo File Exists. Proceeding with Installation.", > "Agent Already Installed.", "Do you want to uninstall the existing agent > and re-install this agent? (y/n) : "]} > > So what did I misunderstand? > > Also, I'm unsure if the command will fail on systems not prompting for > anything? > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/3ae658da-4093-472e-82c3-a5de21bc6383%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/3ae658da-4093-472e-82c3-a5de21bc6383%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_zPRnXFrTZN2-8%2B1%2BF_GyB9A_5LVepqdwt4YQNQEYfXw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
