forked from hortonworks/ansible-hortonworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_openstack_nodes.yml
34 lines (32 loc) · 1.08 KB
/
build_openstack_nodes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- set_fact: outer_loop="{{ item }}"
- name: Create {{ outer_loop.host_group }} node(s)
os_server:
name: "{{ cluster_name }}-{{ outer_loop.host_group }}{{ (outer_loop.count > 1) | ternary(local_loop,'') }}{{ cloud_config.name_suffix|default('') }}"
image: "{{ outer_loop.image }}"
flavor: "{{ outer_loop.flavor }}"
key_name: "{{ cloud_config.ssh.keyname }}"
availability_zone: "{{ cloud_config.zone }}"
state: present
wait: true
timeout: 900
validate_certs: false
meta:
Cluster: "{{ cluster_name }}"
Role: "{{ outer_loop.host_group }}"
Group: "{{ cluster_name }}-{{ outer_loop.host_group }}"
loop_control:
loop_var: local_loop
with_sequence: count="{{ outer_loop.count }}" format=-%02x
async: 1000
poll: 0
register: current_nodes_async
- name: Wait for {{ outer_loop.host_group }} node(s) to be built
async_status:
jid: "{{ local_loop.ansible_job_id }}"
loop_control:
loop_var: local_loop
with_items: "{{ current_nodes_async.results }}"
register: current_nodes
until: current_nodes.finished
retries: 120