I have problem with ansible. I want to configure sudo from another user:
hosts: testnodes
become: yes
become_user: nadya
become_method: sudo
But when I execute playbook, I have an error:
An exception occurred during task execution. The full traceback is: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 119, in run res = self._execute() File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 490, in _execute result = self._handler.run(task_vars=variables) File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/normal.py", line 33, in run results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars)) File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/init.py", line 617, in _execute_module self._fixup_perms2(remote_files, remote_user) File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/init.py", line 394, in _fixup_perms2 ' see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user'.format(res['rc'], res['stderr'])) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 29: ordinal not in range(128)
fatal: [192.168.3.99]: FAILED! => { "failed": true, "msg": "Unexpected failure during module execution.", "stdout": "" }
ansible --version ansible 2.2.0.0
If I set become_user: root
everything is ok.
On remote host /etc/sudo:
ansible ALL=(nadya) NOPASSWD:ALL
Can anybody help me? Thanks.