# hostvar from group and with\_items (without templating)

**URL:** <https://forum.ansible.com/t/hostvar-from-group-and-with-items-without-templating/12404>\
**Category:** Ansible Project\
**Created:** [February 22, 2013, 1:28pm UTC](https://forum.ansible.com/t/hostvar-from-group-and-with-items-without-templating/12404 "2013-02-22T13:28:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lester\_Wade](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@Lester\_Wade](https://forum.ansible.com/u/Lester_Wade)\
**Post date:** [February 22, 2013, 1:28pm UTC](https://forum.ansible.com/t/hostvar-from-group-and-with-items-without-templating/12404/1 "2013-02-22T13:28:18Z")

</div>

I couldn’t find a clear answer for this one in the docs and I figured I’d investigate before I revert to templating (which in this particular case is my least-preferred option). I’ve been quite lazy so far and not actually tried this yet.

I have a number of host groups in the inventory and I need to run a command on one host which uses inventory information (specifically IP address) from hosts in another group. What’s more, this is across plays in a top-level playbook. I could template this per the documentation examples but I’d like to be able to get something like:

- name: register my systems  
action: command blabla --include $item.ansible\_${interface}.ipv4.address  
with\_items: ${groups.group1}

Is such a thing supposed to work?

Thanks as always 🙂
