# ensure service is running

**URL:** <https://forum.ansible.com/t/ensure-service-is-running/14269>\
**Category:** Ansible Project\
**Created:** [January 5, 2014, 9:21am UTC](https://forum.ansible.com/t/ensure-service-is-running/14269 "2014-01-05T09:21:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neubyr](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@neubyr](https://forum.ansible.com/u/neubyr)\
**Post date:** [January 5, 2014, 9:21am UTC](https://forum.ansible.com/t/ensure-service-is-running/14269/1 "2014-01-05T09:21:42Z")

</div>

I have tried few Ansible playbooks and it looks nice. I am confused about task and handler association. Most example show tasks notifying handlers about service state/restart. I was wondering if service state can be controlled without task as well. For example, how can I ensure default ntpd service is running all the time. Do I simply add ntpd handler without any tasks or vars? Any help?

thanks,  
N

---

<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:** [January 5, 2014, 6:57pm UTC](https://forum.ansible.com/t/ensure-service-is-running/14269/2 "2014-01-05T18:57:14Z")

</div>

Of course. Handlers are just special types of tasks.

tasks:

- service: name=foo state=running enabled=yes

etc
