# How to maintein particula order via host groups and/or playbook

**URL:** <https://forum.ansible.com/t/how-to-maintein-particula-order-via-host-groups-and-or-playbook/22863>\
**Category:** Ansible Project\
**Created:** [October 23, 2016, 6:27pm UTC](https://forum.ansible.com/t/how-to-maintein-particula-order-via-host-groups-and-or-playbook/22863 "2016-10-23T18:27:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinyzais](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@tinyzais](https://forum.ansible.com/u/tinyzais)\
**Post date:** [October 23, 2016, 6:27pm UTC](https://forum.ansible.com/t/how-to-maintein-particula-order-via-host-groups-and-or-playbook/22863/1 "2016-10-23T18:27:26Z")

</div>

Hello,

I dont know how to implement group ordering in the right way.  
Example:  
Start or Stop application with database.  
When starting: i need to start DB first, then APP itself  
When stopping: i need to do reverse order

Right now i’m using groups inside inventory file, so it’s easy to say that host is doing (groups are used like labels).  
And playbook has strict rules about what hosts it takes (like: -hosts: db).  
But i’m look to appropriate way to create high level playbook so it generick for start/stop/status tasks.

May be i’m trying to do things ‘from behind’, so please help me understand possible ways to handle that.

Thank you in advance.
