# role + local actions (cloud deployment)

**URL:** <https://forum.ansible.com/t/role-local-actions-cloud-deployment/20384>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [January 29, 2016, 1:36pm UTC](https://forum.ansible.com/t/role-local-actions-cloud-deployment/20384 "2016-01-29T13:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![profhase85](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@profhase85](https://forum.ansible.com/u/profhase85)\
**Post date:** [January 29, 2016, 1:36pm UTC](https://forum.ansible.com/t/role-local-actions-cloud-deployment/20384/1 "2016-01-29T13:36:42Z")

</div>

I want to automate the complete deployment in cloud with ansible. The Role should create a host in cloud before the deployment starts.  
The Problem is: One cannot use `local_action` in roles. How do you manage it?

I 'd like to use something like

`

#myrole/tasks/prepare.yml

- local\_action:  
module: cs\_instance  
name: {{ instance\_name }}  
iso: Linux Debian 7 64-bit  
hypervisor: VMware  
project: Integration  
zone: {{ instance\_zone }}  
service\_offering: 1cpu\_1gb  
disk\_offering: {{ disk\_offer }}  
disk\_size: 20  
networks:
- Server Integration
- Sync Integration
- Storage Integration

#myrole/tasks/main.yml

- include: prepare.yml

- name: create users  
user:  
…

`

```auto

```

And define all the variables in `host_vars` (already before the host is created). Is there any way to do this?
