'unsupported parameter for module: notify' error when trying to call notify from a task

Hi,

I’m trying to run a playbook that installs and restarts a tomcat instance but when I run it it fails with the following message:

TASK [tomcat-datagateway : Configure the tomcat-datagateway server.xml] ******** fatal: [10.10.1.3]: FAILED! => {"changed": true, "failed": true, "msg": "unsupported parameter for module: notify"}

I have the following layout for the tomcat-datagateway role:

`
roles/tomcat-datagateway/
files/
tomcat-datagateway (environment script)
tomcat-datagateway.sh (init.d script)
handlers/
main.yml
tasks/
main.yml
templates/
server.xml
tomcat-users.xml
vars/
main.yml

`

The relevant part of the tasks/main.yml looks like this (everything up until this point works fine):

`

  • name: Configure the tomcat-datagateway server.xml
    template:
    src: server.xml
    dest: /home/apiproc/tomcat-datagateway/apache-tomcat-8.0.32/conf
    notify: restart tomcat-datagateway
    `

The handlers/main.yml looks like this:

`

notify is indeed not a parameter of the template module.

Effectively this error is stating that you have indented your notify too far. It should be directly aligned with template and name and not nested under template

Aah yes, that did the trick; lesson learned. Thanks.

Colin.