# systemctl

**URL:** <https://forum.ansible.com/t/systemctl/27815>\
**Category:** Ansible Project\
**Created:** [June 18, 2018, 5:25pm UTC](https://forum.ansible.com/t/systemctl/27815 "2018-06-18T17:25:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Drall](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Pradeep\_Drall](https://forum.ansible.com/u/Pradeep_Drall)\
**Post date:** [June 18, 2018, 5:25pm UTC](https://forum.ansible.com/t/systemctl/27815/1 "2018-06-18T17:25:14Z")

</div>

Hi,

I created playbook for “sudo systemctl start qdrouterd.service” but its not working in Ansible tower and throwing error “ERROR! ‘service’ is not a valid attribute for a Play”. I mentioned below play for systemctl. I also declared state=restarted. Please assist me.

- name: Start service qdrouterd.service  
service:  
name: qdrouterd.service  
state: started  
use: service  
tags:  
start

Regards,  
Pradeep

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [June 18, 2018, 5:34pm UTC](https://forum.ansible.com/t/systemctl/27815/2 "2018-06-18T17:34:02Z")

</div>

Maybe use the systemd instead?

- name: Start service qdrouterd.service  
systemd:  
state: started  
name: qdrouterd.service  
tags:  
start

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 18, 2018, 5:45pm UTC](https://forum.ansible.com/t/systemctl/27815/3 "2018-06-18T17:45:41Z")

</div>

that is a task, it cannot run on it’s own, it must be inside a play.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Drall](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Pradeep\_Drall](https://forum.ansible.com/u/Pradeep_Drall)\
**Post date:** [June 19, 2018, 1:28pm UTC](https://forum.ansible.com/t/systemctl/27815/4 "2018-06-19T13:28:05Z")

</div>

thanks for your reply.

Sorry its not working and throwing same error.

I checked with service and systemd but its working.

Regards,  
Pradeep

---

<div class="post-metadata">

**Author:** ![Rajesh\_Kanna](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@Rajesh\_Kanna](https://forum.ansible.com/u/Rajesh_Kanna)\
**Post date:** [June 27, 2018, 1:02pm UTC](https://forum.ansible.com/t/systemctl/27815/5 "2018-06-27T13:02:14Z")

</div>

Hi Pradeep,
