# test host for group membership

**URL:** <https://forum.ansible.com/t/test-host-for-group-membership/12032>\
**Category:** Ansible Project\
**Created:** [October 26, 2012, 2:39am UTC](https://forum.ansible.com/t/test-host-for-group-membership/12032 "2012-10-26T02:39:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis\_Jacobfeuerbor](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Dennis\_Jacobfeuerbor](https://forum.ansible.com/u/Dennis_Jacobfeuerbor)\
**Post date:** [October 26, 2012, 2:39am UTC](https://forum.ansible.com/t/test-host-for-group-membership/12032/1 "2012-10-26T02:39:04Z")

</div>

Thanks for the pointers!

I think I’ll define two variables managed=0/1 and managed\_suffix=“”/“-managed” in the way Michael described in the second approach so that when I want to use alternative files I can refer to them as e.g. src=resolv${managed\_suffix}.conf and when I only want variations in a template I can use {%if managed %} there.

That should make it easy to differentiate the cases without resorting to only\_if statements.

Regards,  
Dennis
