# notifier is not working

**URL:** <https://forum.ansible.com/t/notifier-is-not-working/23511>\
**Category:** Ansible Project\
**Created:** [January 19, 2017, 11:22pm UTC](https://forum.ansible.com/t/notifier-is-not-working/23511 "2017-01-19T23:22:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jithendra\_myla](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@jithendra\_myla](https://forum.ansible.com/u/jithendra_myla)\
**Post date:** [January 19, 2017, 11:22pm UTC](https://forum.ansible.com/t/notifier-is-not-working/23511/1 "2017-01-19T23:22:02Z")

</div>

notifier is not working even though i mention everything correctly, Please help

[ansible@centos1 ansible\_playbooks]$ cat install\_plays.yml  
— # install software on multiple hosts

- hosts: apacheweb  
remote\_user: ansible  
connection: ssh  
become: yes  
become\_method: sudo  
gather\_facts: yes  
vars\_files:

- values.property  
tasks:

- name: install apache  
yum: name={{ apache }} state={{ stat }}

- name: copy the httpd.conf  
template: src=httpd.conf dest=/etc/httpd/conf  
notify:

- restart apache1  
handlers:

- name: restart apache1  
service: name=httpd state=restarted enabled=yes

- hosts: appserver  
remote\_user: ansible  
connection: ssh  
gather\_facts: yes  
become: yes  
become\_method: sudo  
vars\_files:

- values.property  
tasks:

- name: Install telnet  
yum: name={{ package }} state={{ stat }}

- hosts: debian  
remote\_user: ansible  
connection: ssh  
become: yes  
become\_method: sudo  
gather\_facts: yes  
vars\_files:

- values.property  
tasks:

- name: Install lynx  
apt: name={{ package1 }} state={{ stat }}

- hosts: localhost  
remote\_user: ansible  
connection: ssh  
gather\_facts: yes  
become: yes  
become\_method: sudo  
vars\_files:

- values.property  
tasks:

- name: Install telnet  
yum: name={{ package }} state={{ stat }}

[ansible@centos1 ansible\_playbooks]$ cat values.property  
apache: httpd  
package: telnet  
package1: lynx  
stat: latest  
port: 8000  
[ansible@centos1 ansible\_playbooks]$

[ansible@centos1 ansible\_playbooks]$ ansible-playbook install\_plays.yml --extra-vars “stat=present”

PLAY [apacheweb] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [[centos2.ohari.com](http://centos2.ohari.com)]

TASK [install apache] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [[centos2.ohari.com](http://centos2.ohari.com)]

TASK [copy the httpd.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [[centos2.ohari.com](http://centos2.ohari.com)]

PLAY [appserver] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [[centos3.ohari.com](http://centos3.ohari.com)]

TASK [Install telnet] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [[centos3.ohari.com](http://centos3.ohari.com)]

PLAY [debian] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [[ubuntu2.ohari.com](http://ubuntu2.ohari.com)]

TASK [Install lynx] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [[ubuntu2.ohari.com](http://ubuntu2.ohari.com)]

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [Install telnet] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[centos2.ohari.com](http://centos2.ohari.com) : ok=3 changed=1 unreachable=0 failed=0  
[centos3.ohari.com](http://centos3.ohari.com) : ok=2 changed=1 unreachable=0 failed=0  
localhost : ok=2 changed=1 unreachable=0 failed=0  
[ubuntu2.ohari.com](http://ubuntu2.ohari.com) : ok=2 changed=1 unreachable=0 failed=0

[ansible@centos1 ansible\_playbooks]$

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 20, 2017, 12:34am UTC](https://forum.ansible.com/t/notifier-is-not-working/23511/2 "2017-01-20T00:34:33Z")

</div>

It works as expected, the “copy of httpd” returns OK, not changed, the “install of apache” is changed, but does not have a notify.

A task must have a notify AND return changed status to invoke a handler.

---

<div class="post-metadata">

**Author:** ![jithendra\_myla](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@jithendra\_myla](https://forum.ansible.com/u/jithendra_myla)\
**Post date:** [January 24, 2017, 3:38pm UTC](https://forum.ansible.com/t/notifier-is-not-working/23511/3 "2017-01-24T15:38:41Z")

</div>

Thank you Brain
