# ansible equivalent of puppet defined type

**URL:** <https://forum.ansible.com/t/ansible-equivalent-of-puppet-defined-type/27903>\
**Category:** Ansible Project\
**Created:** [June 28, 2018, 9:14pm UTC](https://forum.ansible.com/t/ansible-equivalent-of-puppet-defined-type/27903 "2018-06-28T21:14:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzagrabe](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mzagrabe](https://forum.ansible.com/u/mzagrabe)\
**Post date:** [June 28, 2018, 9:14pm UTC](https://forum.ansible.com/t/ansible-equivalent-of-puppet-defined-type/27903/1 "2018-06-28T21:14:34Z")

</div>

Greetings,

I’m just getting started with Ansible - it’s nice. I’m familiar with Puppet (versions 2 and 3) and know my way around their lingo and paradigms.

I’ve seen loops in Ansible and I believe they might be able to help solve my problem.

Here is my problem:

I want to install some files and execute a command multiple times (hence, the loop mentioned earlier.)

I’d like to “bundle” or “group” the file installations and command execution into a “package” or “module” and just iterate over that collection of plays.

What is a good way of implementing this?

Thanks for any help!

-m

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [June 29, 2018, 1:12am UTC](https://forum.ansible.com/t/ansible-equivalent-of-puppet-defined-type/27903/2 "2018-06-29T01:12:16Z")

</div>

‘roles’ in Ansible would be the closest equivalent to a module, i.e. reusable actions in puppet. You could also repeated include a role inside a loop to have it execute with different inputs. Puppet ‘roles’ carry over more into host groups. This is usually how I’ve been explained things to (ex)puppet users.
