# Error 'msg: You need to be root to perform this command.' with sudo on

**URL:** <https://forum.ansible.com/t/error-msg-you-need-to-be-root-to-perform-this-command-with-sudo-on/15766>\
**Category:** Ansible Project\
**Created:** [July 24, 2014, 4:58pm UTC](https://forum.ansible.com/t/error-msg-you-need-to-be-root-to-perform-this-command-with-sudo-on/15766 "2014-07-24T16:58:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Hudson](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@Thomas\_Hudson](https://forum.ansible.com/u/Thomas_Hudson)\
**Post date:** [July 24, 2014, 4:58pm UTC](https://forum.ansible.com/t/error-msg-you-need-to-be-root-to-perform-this-command-with-sudo-on/15766/1 "2014-07-24T16:58:38Z")

</div>

I’m getting this error with the following playbook:

---

<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:** [July 24, 2014, 9:01pm UTC](https://forum.ansible.com/t/error-msg-you-need-to-be-root-to-perform-this-command-with-sudo-on/15766/2 "2014-07-24T21:01:44Z")

</div>

“What am I doing wrong?”

Not running this step as root.

Consider “remote\_user: root” in your playbook for this step, as you can’t run it as user “raven”.

Also, sudo’ing from raven to raven is a little strange, I think you probably want to just not set sudo\_user, then it would assume “raven” is sudoing to “root”.
