# Enabling service runs script?

**URL:** <https://forum.ansible.com/t/enabling-service-runs-script/13347>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [August 21, 2013, 11:47pm UTC](https://forum.ansible.com/t/enabling-service-runs-script/13347 "2013-08-21T23:47:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [August 21, 2013, 11:47pm UTC](https://forum.ansible.com/t/enabling-service-runs-script/13347/1 "2013-08-21T23:47:51Z")

</div>

In my playbook, I have:

- name: Set OWF to start at boot  
service: name=owf enabled=yes

The result:

TASK: [Set OWF to start at boot] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
…  
failed: [demo] =\> {“failed”: true}  
msg: Usage: {start|stop|restart}

Adding ‘-x’ to the shebang of /etc/init.d/owf shows that ansible is executing that file:

failed: [demo] =\> {“failed”: true}  
msg: + OWF\_BIN\_WHAT=Ozone Web Framework 5.0

- OWF\_BIN=/opt/OWF/apache-tomcat-7.0.21
- test -x /opt/OWF/apache-tomcat-7.0.21
- echo Usage: {start|stop|restart}
- exit 1

We’re supposed to be ENABLING that service, not executing it! 🙂

System is Ubuntu 12.04 I suppose I could use ‘command’ or ‘shell’ to do this, but I like to find out what went wrong and why 🙂

---

<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:** [August 22, 2013, 3:51am UTC](https://forum.ansible.com/t/enabling-service-runs-script/13347/2 "2013-08-22T03:51:48Z")

</div>

It’s executing it to get service status.

It sounds pretty well like this script doesn’t support returning a status, in which case specify the “pattern=” argument to the service module (see module docs) so it can pull up the service status that way.
