Expect module throwing up unknown error

21 views
Skip to first unread message

chall...@gmail.com

unread,
Aug 15, 2016, 10:01:51 AM8/15/16
to Ansible Project
My playbook is
- name: configuring stamp pdf batch
  expect:
   command: ./install.sh
   responses:
    'This will install stamppdf on your system. Do you want to continue[y/N]?': y
    '--More--': \r
    '(?i)Do you agree with this copyright\? \[y/N\]': y
    'AP_FONT_DIR [/usr/local/fonts]': y
    'Now you must enter a valid registration number': '{{ stamp_pdf_key }}'
   echo: yes
  args:
   chdir: '{{ dest_dir }}/StampPDFBatch_60_L26_64'
  become: yes

The error i am getting is
fatal: [10.135.232.213]: FAILED! => {"changed": false, "failed": true, 
"invocation": {"module_name": "expect"}, "module_stderr": "", 
"module_stdout": "Traceback (most recent call last):\r\n  File 
\"/tmp/ansible_V_modk/ansible_module_expect.py\", line 230, in <module>\r\n
main()\r\n  File \"/tmp/ansible_V_modk/ansible_module_expect.py\", line 199,
in main\r\n    events=events, cwd=chdir, echo=echo)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 225, in 
runu\r\n    env=env, _spawn=spawnu, **kwargs)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 246, in 
_run\r\n    index = child.expect(patterns)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 1451, in 
expect\r\n    timeout, searchwindowsize)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 1466, in 
expect_list\r\n    timeout, searchwindowsize)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 1535, in 
expect_loop\r\n    c = self.read_nonblocking(self.maxread, timeout)\r\n  
File \"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 984, in 
read_nonblocking\r\n    s = self._coerce_read_string(s)\r\n  File 
\"/usr/lib/python2.6/site-packages/pexpect/__init__.py\", line 1797, in 
_coerce_read_string\r\n    return self._decoder.decode(s, final=False)\r\n 
 File \"/usr/lib64/python2.6/codecs.py\", line 296, in decode\r\n    
(result, consumed) = self._buffer_decode(data, self.errors, 
final)\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xd2 in 
position 1166: invalid continuation byte\r\n", "msg": "MODULE FAILURE", 
"parsed": false}
Reply all
Reply to author
Forward
0 new messages