# Deploy multiple copies of an application to a single host

**URL:** <https://forum.ansible.com/t/deploy-multiple-copies-of-an-application-to-a-single-host/20846>\
**Category:** Ansible Project\
**Created:** [March 11, 2016, 8:21pm UTC](https://forum.ansible.com/t/deploy-multiple-copies-of-an-application-to-a-single-host/20846 "2016-03-11T20:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Austin\_Little](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Austin\_Little](https://forum.ansible.com/u/Austin_Little)\
**Post date:** [March 11, 2016, 8:21pm UTC](https://forum.ansible.com/t/deploy-multiple-copies-of-an-application-to-a-single-host/20846/1 "2016-03-11T20:21:41Z")

</div>

Hey all,

I’m coming from the Puppet world and learning (and loving!) more about Ansible. I’m curious how others would go about deploying a variable number of copies of an application to a given host?

In the Puppet world, I’ve solved this by leveraging the create\_resources() function with a dictionary of dictionaries:

host1.yml:

`app_instances: instance1: port: 1234 param: foo optional_param: true instance2: port: 5678 param: bar`

host2.yml:

`app_instances: instance1: port: 9000 param: baz`

Puppet class:

`create_resouces(my_application_class, $app_instances)`

This works by invoking my\_application\_class once for each instance defined in the datastructure. It looks like I can accomplish something akin to this in Ansible by utilizing with\_items/with\_dict and looping over a boiler-plate role N times.

Has anyone successfully accomplished this, am I headed in the right direction? How did you do it?

Thanks!
