forked from johandahlberg/ansible_spark_openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_spark_cloud_playbook.yml
43 lines (41 loc) · 1.14 KB
/
create_spark_cloud_playbook.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
35
36
37
38
39
40
41
42
43
---
- hosts: localhost
connection: local
vars_files:
- vars/main.yml
tasks:
- name: Create a new spark master instance
os_server:
state: "{{ instance_state }}"
name: spark-master
image: 2a9630d7-2328-4bbd-bbe7-e125c7008558
key_name: "{{ key_name }}"
timeout: 200
flavor: 3
network: "{{ network_internal_name }}"
security_groups: spark,default
floating_ip_pools: "{{ network_external_name }}"
meta:
hostname: spark-master
ansible_host_groups: spark_master
register: spark_master
- name: Create a new spark slaves
os_server:
state: "{{ instance_state }}"
name: "{{ item }}"
image: 2a9630d7-2328-4bbd-bbe7-e125c7008558
key_name: "{{ key_name }}"
timeout: 200
flavor: 3
security_groups: spark,default
floating_ip_pools: "{{ network_external_name }}"
nics:
- net-name: "{{ network_internal_name }}"
meta:
hostname: "{{ item }}"
ansible_host_groups: spark_slaves
register: spark_slaves
with_sequence:
start=1
end="{{ nbr_of_slaves }}"
format=spark-slave%02x