# You need to be root to perform this command.

**URL:** <https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216>\
**Category:** Ansible Project\
**Created:** [August 4, 2016, 9:35pm UTC](https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216 "2016-08-04T21:35:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anushri\_Mishra](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Anushri\_Mishra](https://forum.ansible.com/u/Anushri_Mishra)\
**Post date:** [August 4, 2016, 9:35pm UTC](https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216/1 "2016-08-04T21:35:14Z")

</div>

hi,I have been trying to run this playbook.

- hosts: webservers

vars:

http\_port: 80

max\_clients: 200

remote\_user: root

tasks:

- name: ensure apache is at the latest version

yum: name=httpd state=latest

- name: write the apache config file

template: src=/srv/httpd.j2 dest=/etc/httpd.conf

notify:

- restart apache

- name: ensure apache is running (and enable it at boot)

service: name=httpd state=started enabled=yes

handlers:

- name: restart apache

service: name=httpd state=restarted

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 5, 2016, 6:02pm UTC](https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216/2 "2016-08-05T18:02:53Z")

</div>

You need a space after the colon, and  
sudo: is deprecated so use become: yes

---

<div class="post-metadata">

**Author:** ![Anushri\_Mishra](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Anushri\_Mishra](https://forum.ansible.com/u/Anushri_Mishra)\
**Post date:** [August 5, 2016, 6:42pm UTC](https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216/3 "2016-08-05T18:42:01Z")

</div>

ok. Thank you .

---

<div class="post-metadata">

**Author:** ![Anushri\_Mishra](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Anushri\_Mishra](https://forum.ansible.com/u/Anushri_Mishra)\
**Post date:** [August 5, 2016, 6:42pm UTC](https://forum.ansible.com/t/you-need-to-be-root-to-perform-this-command/22216/4 "2016-08-05T18:42:23Z")

</div>


