# "sudo: a password is required" error in Ansible v2

**URL:** <https://forum.ansible.com/t/sudo-a-password-is-required-error-in-ansible-v2/20848>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [March 11, 2016, 11:31pm UTC](https://forum.ansible.com/t/sudo-a-password-is-required-error-in-ansible-v2/20848 "2016-03-11T23:31:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshmi\_Narasimhan\_P](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@Lakshmi\_Narasimhan\_P](https://forum.ansible.com/u/Lakshmi_Narasimhan_P)\
**Post date:** [March 11, 2016, 11:31pm UTC](https://forum.ansible.com/t/sudo-a-password-is-required-error-in-ansible-v2/20848/1 "2016-03-11T23:31:53Z")

</div>

Hi,  
I’m running an ansible 2 playbook against an EC2 inventory.  
It installs wordpress and apache on an EC2 instance.

Here’s the command I used:

`$ ansible-playbook -i ec2.py site.yml`

I get this error:

`  
PLAY [install apache, php, mysql server, wordpress] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [52.62.169.76]: UNREACHABLE! =\> {“changed”: false, “msg”: “SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue”, “unreachable”: true}  
ok: [52.87.100.226]

TASK [web : install apache, php, and php-mysql] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226] =\> (item=[u’httpd’, u’php’, u’php-mysql’])

TASK [web : start and enable httpd] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]

TASK [mysql : install mysql server] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226] =\> (item=[u’mysql-server’, u’MySQL-python’])

TASK [mysql : create mysql configuration file] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]

TASK [mysql : start mysql service] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]

TASK [wordpress : download wordpress] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]

TASK [wordpress : extract wordpress archive] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]  
[WARNING]: Consider using unarchive module rather than running tar

TASK [wordpress : copy wordpress to apache root directory] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [52.87.100.226]

TASK [wordpress : fetch random salts for wordpress config] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [52.87.100.226 → localhost]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “sudo: a password is required\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “parsed”: false}

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

RUNNING HANDLER [mysql : restart mysql] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @site.retry

`

Here’s the source code of the roles I’, using:

[https://github.com/badri/ansible-for-aws/tree/zone-changes/wordpress](https://github.com/badri/ansible-for-aws/tree/zone-changes/wordpress)

Am I missing any step or configuration?

Thanks  
Lakshmi
