# Ansible roles in ec2 machine creation and Code Deployement

**URL:** <https://forum.ansible.com/t/ansible-roles-in-ec2-machine-creation-and-code-deployement/37016>\
**Category:** Ansible Project\
**Created:** [August 20, 2022, 8:01pm UTC](https://forum.ansible.com/t/ansible-roles-in-ec2-machine-creation-and-code-deployement/37016 "2022-08-20T20:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Jain](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jay\_Jain](https://forum.ansible.com/u/Jay_Jain)\
**Post date:** [August 20, 2022, 8:01pm UTC](https://forum.ansible.com/t/ansible-roles-in-ec2-machine-creation-and-code-deployement/37016/1 "2022-08-20T20:01:58Z")

</div>

I am working on a use case where I am creating ec2 machine and then deploying code on that machine .  
I have monolith playbook for the same (all tasks in same playbook)  
I am looking for a case where I create roles for each tasks example creating ec2 machine would be a role and then installing supervisor to that machine would be another role.  
I just want to know how can I pass the public IP address of newly created machines with help of roles to the task which is going to install supervisor on those machines .
