# Per-task sudo officially supported?

**URL:** <https://forum.ansible.com/t/per-task-sudo-officially-supported/12759>\
**Category:** Ansible Project\
**Created:** [May 2, 2013, 5:45pm UTC](https://forum.ansible.com/t/per-task-sudo-officially-supported/12759 "2013-05-02T17:45:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [May 2, 2013, 5:45pm UTC](https://forum.ansible.com/t/per-task-sudo-officially-supported/12759/1 "2013-05-02T17:45:30Z")

</div>

Is it possible to specify “sudo” at the task level instead of the play level, e.g.:

tasks:

- command: whoami

sudo: true

I couldn’t find anything in the docs or examples about this, but it seems to work.

Lorin

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 2, 2013, 6:58pm UTC](https://forum.ansible.com/t/per-task-sudo-officially-supported/12759/2 "2013-05-02T18:58:43Z")

</div>

If it seems to work, then it is so 🙂
