# using role for deployment across multiple OSs

**URL:** <https://forum.ansible.com/t/using-role-for-deployment-across-multiple-oss/13110>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 12, 2013, 3:38pm UTC](https://forum.ansible.com/t/using-role-for-deployment-across-multiple-oss/13110 "2013-07-12T15:38:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Lucas](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@Michael\_Lucas](https://forum.ansible.com/u/Michael_Lucas)\
**Post date:** [July 12, 2013, 3:38pm UTC](https://forum.ansible.com/t/using-role-for-deployment-across-multiple-oss/13110/1 "2013-07-12T15:38:12Z")

</div>

Hi,

About to write my first role-based playbook, and wanted to verify I  
understand the Ansible Way before getting myself in trouble.

I need to deploy software across multiple operating systems. I want to  
reuse as much as possible, such as config file templates. As a  
specific example: I need to deploy zabbix-agentd across FreeBSD,  
CentOS, and Ubuntu hosts. The template for the zabbix-agentd.conf file  
is identical across all platforms.

It seems that the right way to do this is with roles. Have an  
os-specific role for apt, yum, pkg, and suchforth, and a zabbix-agent  
role that contains the config file template and the "service restart"  
stuff, then to organize the playbook something like this.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 12, 2013, 6:37pm UTC](https://forum.ansible.com/t/using-role-for-deployment-across-multiple-oss/13110/2 "2013-07-12T18:37:37Z")

</div>

You have some slightly off syntax at the top, but that’s basically it.

The group\_by module is very useful for creating dynamic groups based on host OS to if you want.
