# group\_by is a conditional

**URL:** <https://forum.ansible.com/t/group-by-is-a-conditional/12335>\
**Category:** Ansible Project\
**Created:** [February 11, 2013, 8:35am UTC](https://forum.ansible.com/t/group-by-is-a-conditional/12335 "2013-02-11T08:35:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmad\_Khayyat](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Ahmad\_Khayyat](https://forum.ansible.com/u/Ahmad_Khayyat)\
**Post date:** [February 11, 2013, 8:35am UTC](https://forum.ansible.com/t/group-by-is-a-conditional/12335/1 "2013-02-11T08:35:39Z")

</div>

A suggestion for the docs:

Shouldn’t group\_by be discussed as a conditional mechanism?  
It allows conditional actions based on facts.  
Effectively, it’s a coarse-grain conditional construct that applies to an entire play, versus the finer-grain when\_\* conditionals that apply to individual tasks.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 11, 2013, 1:10pm UTC](https://forum.ansible.com/t/group-by-is-a-conditional/12335/2 "2013-02-11T13:10:39Z")

</div>

Conditional in the docs is meant as "do this or don't". I think of  
group\_by a lot more like slicing.

That being said, it's cool, and we should definitely make a pointer to  
it, so it's not just hidden amongst a lot of other (all great, of  
course) modules.
