# ansible

**URL:** <https://forum.ansible.com/t/ansible/25522>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [September 19, 2017, 6:45am UTC](https://forum.ansible.com/t/ansible/25522 "2017-09-19T06:45:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreekuttan\_Sree](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Sreekuttan\_Sree](https://forum.ansible.com/u/Sreekuttan_Sree)\
**Post date:** [September 19, 2017, 6:45am UTC](https://forum.ansible.com/t/ansible/25522/1 "2017-09-19T06:45:57Z")

</div>

Hi,

playbook is

- hosts: servers  
remote\_user: ubuntu  
become: yes  
become\_user: root  
become\_method: sudo  
tasks:
- name: Install tmux  
apt: name=tmux state=present

error:fatal: [192.168.80.129]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Shared connection to 192.168.80.129 closed.\r\n”, “module\_stdout”: “sudo: a password is required\r\n”, “msg”: “MODULE FAILURE”, “rc”: 1}

Thanks

---

<div class="post-metadata">

**Author:** ![Soniya\_panwar](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Soniya\_panwar](https://forum.ansible.com/u/Soniya_panwar)\
**Post date:** [October 24, 2017, 4:52am UTC](https://forum.ansible.com/t/ansible/25522/2 "2017-10-24T04:52:39Z")

</div>

Hello

The reason for the failure is that the playbook is not able to retrieve the credentials for Ubuntu user to become root. In order to resolve this you will have to use --ask-sudo-pass suffix everytime you execute an ansible-palybook command. Else you may make an entry in ansible.cfg to set ask\_pass : TRUE using either of the below options. This will prompt playbook to explicitly ask for sudo credentials every time at run time:

[OPTION-1] : Add below lines to defaults in ansible.cfg.

[defaults]

sudo\_user = root

ask\_pass = True

[OPTION-2] : Run below export command.

export ANSIBLE\_ASK\_SUDO\_PASS=true

Thanks
