# unable to configure ansible properly - sudo: True has no effect on any task

**URL:** <https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [April 13, 2014, 5:53am UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005 "2014-04-13T05:53:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_Hughes](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joel\_Hughes](https://forum.ansible.com/u/Joel_Hughes)\
**Post date:** [April 13, 2014, 5:53am UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005/1 "2014-04-13T05:53:18Z")

</div>

sudo: True has no effect on any task  
This is a configuration issue, but after many hours I’m unable to locate it.

Tested against ansible 1.4.5, 1.5.0 through 1.5.4 and development branch so I’m sure it’s not ansible.  
Hosts: Ubuntu 12.04.4 fully patched.  
ssh and sudo both passwordless

cat /etc/sudoers.d/admin  
jhughes ALL=(ALL) NOPASSWD:ALL

ansible.cfg delta  
hostfile

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [April 17, 2014, 5:06pm UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005/2 "2014-04-17T17:06:05Z")

</div>

Joel,

Did you try adding `sudo_user: jhughes` to the task?

---

<div class="post-metadata">

**Author:** ![Adam\_Morris](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Adam\_Morris](https://forum.ansible.com/u/Adam_Morris)\
**Post date:** [April 17, 2014, 6:41pm UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005/3 "2014-04-17T18:41:12Z")

</div>

That would cause it to run sudo to become jhughes before running the command.

Probably not what is wanted.

I’m not sure what you’re expecting differently… Are you getting errors?

What are the errors? What are the tasks?

Adam

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 17, 2014, 10:17pm UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005/4 "2014-04-17T22:17:11Z")

</div>

Ansible does know that if logging in as foo and sudo’ing to foo, it’s smart enough to avoid doing the sudo at all.

This has been a point of contention with one user’s SELinux environment where logging in as root didn’t get full privs until sudoing, at which point it was proposed a setting to control this behavior.

That all being said, I’m not sure this is what you were seeing, but it can explain scenarios when ansible ignores a sudo statement.

Otherwise, sudo: True is functional, and we’d need to see more detail.

---

<div class="post-metadata">

**Author:** ![Joel\_Hughes](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joel\_Hughes](https://forum.ansible.com/u/Joel_Hughes)\
**Post date:** [April 18, 2014, 3:46am UTC](https://forum.ansible.com/t/unable-to-configure-ansible-properly-sudo-true-has-no-effect-on-any-task/15005/5 "2014-04-18T03:46:22Z")

</div>

Please see post: **request help with configuration issue: ‘sudo: True’ has no effect** which has been resolved.  
This post was accidentally sent before completed.
