# Need variable that matches certain group-host run

**URL:** <https://forum.ansible.com/t/need-variable-that-matches-certain-group-host-run/26965>\
**Category:** Ansible Project\
**Created:** [March 12, 2018, 11:01am UTC](https://forum.ansible.com/t/need-variable-that-matches-certain-group-host-run/26965 "2018-03-12T11:01:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naftali\_Burnham](https://avatars.discourse-cdn.com/v4/letter/n/a9a28c/32.png) [@Naftali\_Burnham](https://forum.ansible.com/u/Naftali_Burnham)\
**Post date:** [March 12, 2018, 11:01am UTC](https://forum.ansible.com/t/need-variable-that-matches-certain-group-host-run/26965/1 "2018-03-12T11:01:59Z")

</div>

Hi,  
Im not finding exactly what Im trying to do, or maybe Im not getting how to accomplish this. Ive been playing with different ways to do this.

I need so set some different variable in a template.

this is content of j2 file.

`

---

<div class="post-metadata">

**Author:** ![Naftali\_Burnham](https://avatars.discourse-cdn.com/v4/letter/n/a9a28c/32.png) [@Naftali\_Burnham](https://forum.ansible.com/u/Naftali_Burnham)\
**Post date:** [March 13, 2018, 9:10am UTC](https://forum.ansible.com/t/need-variable-that-matches-certain-group-host-run/26965/2 "2018-03-13T09:10:52Z")

</div>

Hi I found my answer …

Because I needed default variable to be attached to a specific host/inventory group during that group run I needed to add them into the inventory file itself… for this case it works perfect.

[P1-CI]  
server01
