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:
…
`
And define all the variables in host_vars
(already before the host is created). Is there any way to do this?