ansible equivalent of puppet defined type

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

‘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.