user_dev
user_dev

Reputation: 1431

Why ansible not including handler?

I am writing a role where I am including handler. This is the structure I have :

role-->
   |____>handlers---> main.yml
   |____>tasks------> main.yml
              ------> controller.yml

Here is the code: handlers/main.yml

---
- name: Restart Jenkins
  service: name=jenkins state=restarted

inside controller.yml I am using it like:

  notify: restart Jenkins

But when I run the role it gives me this error:

ERROR! The requested handler 'restart Jenkins' was not found in any of the known handlers

Ansible version I have is ansible 2.1.1.0

Upvotes: 5

Views: 6417

Answers (1)

MillerGeek
MillerGeek

Reputation: 3137

This is simply a case of improper capitalization. You have notify: restart Jenkins when it should be notify: Restart Jenkins

Upvotes: 4

Related Questions