role + local actions (cloud deployment)

18 views
Skip to first unread message

ProfHase

unread,
Jan 29, 2016, 8:36:42 AM1/29/16
to Ansible Project
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?
Reply all
Reply to author
Forward
0 new messages