# Accessing variables from within a plugin (callback)

**URL:** <https://forum.ansible.com/t/accessing-variables-from-within-a-plugin-callback/15790>\
**Category:** Ansible Project\
**Created:** [July 28, 2014, 12:17pm UTC](https://forum.ansible.com/t/accessing-variables-from-within-a-plugin-callback/15790 "2014-07-28T12:17:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Schroeder](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Daniel\_Schroeder](https://forum.ansible.com/u/Daniel_Schroeder)\
**Post date:** [July 28, 2014, 12:17pm UTC](https://forum.ansible.com/t/accessing-variables-from-within-a-plugin-callback/15790/1 "2014-07-28T12:17:12Z")

</div>

Hello list,

is there a way how I can access host/group vars from within a callback plugin? Basically I want to modify the Hipchat callback plugin to use a room ID configured via group\_vars (or maybe _register_ed as a var right in the role tasks), as we have hundred of chat rooms and to which room a message will be sent would depend on the role.

Thanks,  
Daniel

---

<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:** [July 28, 2014, 2:12pm UTC](https://forum.ansible.com/t/accessing-variables-from-within-a-plugin-callback/15790/2 "2014-07-28T14:12:47Z")

</div>

Can you please repost this on ansible-devel?

Thanks!

---

<div class="post-metadata">

**Author:** ![Daniel\_Schroeder](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@Daniel\_Schroeder](https://forum.ansible.com/u/Daniel_Schroeder)\
**Post date:** [July 30, 2014, 7:10am UTC](https://forum.ansible.com/t/accessing-variables-from-within-a-plugin-callback/15790/3 "2014-07-30T07:10:58Z")

</div>

Sorry for picking the wrong list. I reposted in ansible-devel now: [https://groups.google.com/forum/#!topic/ansible-devel/oWglrylu1xM](https://groups.google.com/forum/#!topic/ansible-devel/oWglrylu1xM)

Thanks,  
Daniel
