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

1,491 views
Skip to first unread message

Colin Anderson

unread,
Feb 20, 2016, 11:35:15 AM2/20/16
to Ansible Project
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:
---
- name: restart tomcat-datagateway
  service
: name=tomcat-datagateway state=restarted

I'm quite new to Ansible so I was wondering if I've missed something out perhaps?

Thanks,
Colin.

Matt Martz

unread,
Feb 20, 2016, 11:41:24 AM2/20/16
to ansible...@googlegroups.com
`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`
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6ebd6231-4a94-47ba-99a4-c01cb58a9379%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Colin Anderson

unread,
Feb 23, 2016, 12:55:45 PM2/23/16
to Ansible Project
Aah yes, that did the trick; lesson learned. Thanks.

Colin.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages