Enabling service runs script?

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! :slight_smile:

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 :slight_smile:

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.