What version of pexpect are the two of you using? On Thu, Dec 3, 2015 at 6:52 AM, Michele Kappa <[email protected]> wrote: > Exactly the same is happening over here, trying to use expect, having > installed the pexpect package earlier in the role tasks. Here is the -vvvv > of ansible, trying to install a gitlab ci runner: > > fatal: [xxx.yyy.zzz]: FAILED! => {"changed": false, "failed": true, > "invocation": {"module_args": {"command": "gitlab-ci-multi-runner register", > "responses": {"Please enter the gitlab-ci coordinator URL (e.g. > https://gitlab.com/ci )": "https://gitlab.com/ci", "Please\\ enter\\ the\\ > Docker\\ image\\ \\(eg\\. ruby\\:2\\.1\\)\\:": "ruby:2.1", "Please\\ enter\\ > the\\ executor\\:\\ shell\\,\\ docker\\,\\ docker\\-ssh\\,\\ ssh\\?": > "docker", "Please\\ enter\\ the\\ gitlab\\-ci\\ description\\ for\\ this\\ > runner": "my-runner", "Please\\ enter\\ the\\ gitlab\\-ci\\ token\\ for\\ > this\\ runner": "xxxxxxxxxxxxxxxxxxxxxx"}}, "module_name": "expect"}, "msg": > "Traceback (most recent call last):\r\n File > \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\", > line 2084, in <module>\r\n main()\r\n File > \"/home/mkappa/.ansible/tmp/ansible-tmp-1449154083.59-269753732902654/expect\", > line 154, in main\r\n out, rc = pexpect.runu(args, timeout=timeout, > withexitstatus=True,\r\nAttributeError: 'module' object has no attribute > 'runu'\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading > configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line > 56: Applying options for *\r\ndebug1: auto-mux: Trying existing > master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: > mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: > request forwardings: 0 local, 0 remote\r\ndebug3: > mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: > entering\r\ndebug3: mux_client_request_alive: done pid = 3439\r\ndebug3: > mux_client_request_session: session request sent\r\ndebug1: > mux_client_request_session: master session id: 2\r\ndebug3: > mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received > exit status from master 0\r\nShared connection to cremaster2.aavv.io > closed.\r\n", "parsed": false} > > Any ideas? > > On Tuesday, 1 December 2015 17:12:25 UTC+1, Karan Singh wrote: >> >> Hello Guys >> >> Here is my ansible task >> >> - name: Firmware path lookup >> shell: rpm -ql hp-firmware-"{{ device.stdout }}" | grep '\.scexe' >> register: FirmwarePath >> >> - expect: >> command: sh "{{ FirmwarePath.stdout }}" >> responses: >> "Continue (y/N)": 'y' >> >> >> And it ends up like this. >> >> TASK [ansible-role-hp-firmware-upgrade : expect command=sh "{{ >> FirmwarePath.stdout }}" responses={u'Continue (y/N)': u'y'}] *** >> fatal: [storage0204]: FAILED! => {"changed": false, "failed": true, "msg": >> "Traceback (most recent call last):\r\n File >> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\", >> line 2084, in <module>\r\n main()\r\n File >> \"/home/ksingh/.ansible/tmp/ansible-tmp-1448985850.39-65513584639595/expect\", >> line 154, in main\r\n out, rc = pexpect.runu(args, timeout=timeout, >> withexitstatus=True,\r\nAttributeError: 'module' object has no attribute >> 'runu'\r\n", "parsed": false} >> >> If i run this manually with script command it works nicely. >> Can you please advice , how can i make this work. >> >> - Karan - >> >> >> >> > -- > 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/0fc45997-057b-4286-9d89-e65fdb133ec1%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout.
-- 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/CAG9juEotQaJDMn2EjbbZfXBwJ1zdZRbwVonH79LqUaD_zJXQsg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
