# Are roles analogous to modules/cookbooks in Puppet/Chef?

**URL:** <https://forum.ansible.com/t/are-roles-analogous-to-modules-cookbooks-in-puppet-chef/18712>\
**Category:** Ansible Project\
**Created:** [July 8, 2015, 4:39pm UTC](https://forum.ansible.com/t/are-roles-analogous-to-modules-cookbooks-in-puppet-chef/18712 "2015-07-08T16:39:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquin\_Menchaca](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Joaquin\_Menchaca](https://forum.ansible.com/u/Joaquin_Menchaca)\
**Post date:** [July 8, 2015, 4:39pm UTC](https://forum.ansible.com/t/are-roles-analogous-to-modules-cookbooks-in-puppet-chef/18712/1 "2015-07-08T16:39:20Z")

</div>

I was wondering how to organize configuration code into segments, such as nginx, mysql, redis, java, and so on. In Puppet they have modules, and Chef there are cookbooks with recipees. Some of the code I looked at, it seems like roles fulfills this function, or are there other way that is recommended for this?

- Joaquin

---

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [July 8, 2015, 4:49pm UTC](https://forum.ansible.com/t/are-roles-analogous-to-modules-cookbooks-in-puppet-chef/18712/2 "2015-07-08T16:49:40Z")

</div>

Hello Joaquin,

Yep, you’re on the right track there. This might help you…

[http://probably.co.uk/ansible-for-puppet-users.html](http://probably.co.uk/ansible-for-puppet-users.html)

---

<div class="post-metadata">

**Author:** ![Joaquin\_Menchaca](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Joaquin\_Menchaca](https://forum.ansible.com/u/Joaquin_Menchaca)\
**Post date:** [July 10, 2015, 4:00am UTC](https://forum.ansible.com/t/are-roles-analogous-to-modules-cookbooks-in-puppet-chef/18712/3 "2015-07-10T04:00:29Z")

</div>

Thank you Mark. This is exactly what I needed. I have been hunting with Google for a long time for a site like this. 🙂
