# Question about roles, handlers, variables, and scope

**URL:** <https://forum.ansible.com/t/question-about-roles-handlers-variables-and-scope/15396>\
**Category:** Ansible Project\
**Created:** [June 3, 2014, 9:16pm UTC](https://forum.ansible.com/t/question-about-roles-handlers-variables-and-scope/15396 "2014-06-03T21:16:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Fondrie-Teitle](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@Simon\_Fondrie-Teitle](https://forum.ansible.com/u/Simon_Fondrie-Teitle)\
**Post date:** [June 3, 2014, 9:16pm UTC](https://forum.ansible.com/t/question-about-roles-handlers-variables-and-scope/15396/1 "2014-06-03T21:16:01Z")

</div>

Hi all,

In a role I have, I’m including another file in the role, and setting a variable in the include statement. Then from the included file, I’m notifying a handler in that role. Should the handler be able to access the variable in the include? Right now it does not seem to be able to. A simple example of what I’m talking about is here:

[https://gist.github.com/Simonft/5c5f154249cf758157c6](https://gist.github.com/Simonft/5c5f154249cf758157c6)

Thanks,  
Simon

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [June 4, 2014, 2:32pm UTC](https://forum.ansible.com/t/question-about-roles-handlers-variables-and-scope/15396/2 "2014-06-04T14:32:32Z")

</div>

As far as I can tell, variables passed in as params to includes have never been merged into the global list of variables (I’ve gone back to 1.3.0 to test your example). So I would consider this a bug, if you’d like to open a github issue for us so we can keep track of this.

Thanks!

---

<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 6, 2014, 12:30pm UTC](https://forum.ansible.com/t/question-about-roles-handlers-variables-and-scope/15396/3 "2014-06-06T12:30:59Z")

</div>

So it shouldn’t be merged into a global list, but should be valid only for that include.
