# passwordless sudo

**URL:** <https://forum.ansible.com/t/passwordless-sudo/13866>\
**Category:** Ansible Project\
**Created:** [November 7, 2013, 8:29pm UTC](https://forum.ansible.com/t/passwordless-sudo/13866 "2013-11-07T20:29:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [November 7, 2013, 8:29pm UTC](https://forum.ansible.com/t/passwordless-sudo/13866/1 "2013-11-07T20:29:53Z")

</div>

Is there anyway to adjust ansible to use an account with passwordless sudo?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [November 7, 2013, 8:55pm UTC](https://forum.ansible.com/t/passwordless-sudo/13866/2 "2013-11-07T20:55:43Z")

</div>

yes.

but for a useful answer, you might want to be more specific and add some context to the question.

---

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [November 8, 2013, 5:10pm UTC](https://forum.ansible.com/t/passwordless-sudo/13866/3 "2013-11-08T17:10:59Z")

</div>

I’ve created a set of plays that will deploy all of my applications to all environments, and it works great.

I’m trying to have our build server run the play when builds are completed, however I’m running into TTY issue where sudo is required. I’ve created a general account for ansible to use and it’s limited on the systems in such a way that it cannot effect anything but the deployed applications. I use my user account to handle provisioning/infrastructure side of plays.

There are lot of options in what bamboo can do when the build is completed, but I figured installing ansible on the machine and just running the playbook command was going to be the easiest as I can pass some bamboo variables to the extra\_vars of the play.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [November 8, 2013, 5:16pm UTC](https://forum.ansible.com/t/passwordless-sudo/13866/4 "2013-11-08T17:16:04Z")

</div>

so I suggest not having "sudo\_ask\_pass: True" in your plays, "sudo: True"  
is fine, set you bamboo user with NOPASWORD in the sudoers files and just  
remember to always use -K when executing manually.
