# Using variables from a notifying task in a handler

**URL:** <https://forum.ansible.com/t/using-variables-from-a-notifying-task-in-a-handler/15493>\
**Category:** Ansible Project\
**Tags:** fedora\
**Created:** [June 18, 2014, 8:08pm UTC](https://forum.ansible.com/t/using-variables-from-a-notifying-task-in-a-handler/15493 "2014-06-18T20:08:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Murray](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Peter\_Murray](https://forum.ansible.com/u/Peter_Murray)\
**Post date:** [June 18, 2014, 8:08pm UTC](https://forum.ansible.com/t/using-variables-from-a-notifying-task-in-a-handler/15493/1 "2014-06-18T20:08:03Z")

</div>

I have a task that iterates over a dictionary of directory names to remove a file:

> - name: Remove conflicting XACML policy
> 
> file: path=/opt/fedora/{{ item.key }}/data/blah.xml
> 
> state=absent
> 
> with\_dict: installs
> 
> notify: Reload XACML

If the file is removed, a handler is required to restart a process to re-read the directory of policies. I’d like to do something like this:

> - name: Reload XACML  
> shell: fedora-reload-policies.sh  
> chdir=/opt/fedora/{{ item.key }}/server/bin

But what I get is an undefined-variable error:

> NOTIFIED: [fedora-sites | Reload XACML] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<10.11.12.16\> ESTABLISH CONNECTION FOR USER: vagrant  
> fatal: [10.11.12.16] =\> One or more undefined variables: ‘item’ is undefined
> 
> FATAL: all hosts have already failed – aborting

Is what I’m trying to do possible?

Peter

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 19, 2014, 9:23pm UTC](https://forum.ansible.com/t/using-variables-from-a-notifying-task-in-a-handler/15493/2 "2014-06-19T21:23:09Z")

</div>

This is unfortunately not possible.
