# Unable to change user for play

**URL:** <https://forum.ansible.com/t/unable-to-change-user-for-play/21720>\
**Category:** Ansible Project\
**Created:** [June 9, 2016, 12:04pm UTC](https://forum.ansible.com/t/unable-to-change-user-for-play/21720 "2016-06-09T12:04:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mona\_Gopal](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mona\_Gopal](https://forum.ansible.com/u/Mona_Gopal)\
**Post date:** [June 9, 2016, 12:04pm UTC](https://forum.ansible.com/t/unable-to-change-user-for-play/21720/1 "2016-06-09T12:04:19Z")

</div>

Hi,

Oam.yml

- name: apply common configuration to all nodes

hosts: all

# user: root

become: yes

become\_user: sudo

become\_method: sudo

vars\_files:

- dependency\_list.yml

- client\_dependency\_list.yml

roles:

- { role: server, when: server\_or\_client\_installation|int == 1, tags: server, when: ansible\_os\_family == “RedHat” and ansible\_distribution\_major\_version|int \>= 6}

- { role: client, when: server\_or\_client\_installation|int == 2, tags: client, when: ansible\_os\_family == “RedHat” and ansible\_distribution\_major\_version|int \>= 6}

Hosts

172.19.4.64 ansible\_ssh\_user=“root”

Query:

Want to sudo on the server where i am running this playbook and it sudo does not require a password.

the above play throws authentication failure error

Please help.

Thanks in advance,

Mona G

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [June 9, 2016, 1:45pm UTC](https://forum.ansible.com/t/unable-to-change-user-for-play/21720/2 "2016-06-09T13:45:49Z")

</div>

ansible\_ssh\_user=root means, logg in to 172.19.4.64 as the user root.  
If you log in as root you don't need sudo, so I suspect you have the wrong user here since you would like to use sudo and get authentication failure.
