# issue using become (to sudo su - msp" - Pl Help

**URL:** <https://forum.ansible.com/t/issue-using-become-to-sudo-su-msp-pl-help/20884>\
**Category:** Ansible Project\
**Created:** [March 16, 2016, 9:24am UTC](https://forum.ansible.com/t/issue-using-become-to-sudo-su-msp-pl-help/20884 "2016-03-16T09:24:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_Kuncham](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Srinivas\_Kuncham](https://forum.ansible.com/u/Srinivas_Kuncham)\
**Post date:** [March 16, 2016, 9:24am UTC](https://forum.ansible.com/t/issue-using-become-to-sudo-su-msp-pl-help/20884/1 "2016-03-16T09:24:27Z")

</div>

Hi All,  
I am facing issues with being able to login with my credentials and then sudo (become) msp user…  
When I manually ssh to the test\_server, I use the command “sudo su - msp” to switch user and run few commands. But it doesnt seem to be working with ansibal.

Can someone please help?

Playbook:

- hosts: test\_servers  
become: yes  
tasks:
- shell: whoami

Command to run:  
ansible-playbook b02.yml -u fn.last --ask-pass

cfg Entries:  
[privilege\_escalation]  
become=True  
become\_method=sudo  
become\_user=msp  
become\_ask\_pass=True

Output  
$ ansible-playbook b02.yml -u fn.last --ask-pass  
SSH password:  
SUDO password[defaults to SSH password]:

PLAY [test\_servers] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [10.6.48.231]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “”, “module\_stdout”: “\r\nSorry, user fn.last is not allowed to execute ‘/bin/sh -c echo BECOME-SUCCESS-glazbpbnkugukpfbzcrgnqvrudvwsevw; LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /opt/msp/pkg/python/bin/python /tmp/ansible-tmp-1458116615.7-96652222108952/setup’ as msp on LQASEDCODAP008V.\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @b02.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10.6.48.231 : ok=0 changed=0 unreachable=0 failed=1

TIA  
Srini

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 17, 2016, 10:06pm UTC](https://forum.ansible.com/t/issue-using-become-to-sudo-su-msp-pl-help/20884/2 "2016-03-17T22:06:54Z")

</div>

`sudo su` does not work, you need to be able to use sudo to run any command as msp.

[http://docs.ansible.com/ansible/become.html](http://docs.ansible.com/ansible/become.html) \<= read notes
