-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenstack_control-plane.yml
82 lines (70 loc) · 2.57 KB
/
openstack_control-plane.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
- name: HEAT stack generator
hosts: localhost
become: false
tasks:
- name: Variables
tags: always
block:
- set_fact:
node_name: lb
when: node_name is not defined
- name: HEAT stack - floating IP
tags: always
block:
- name: HEAT template (file) - floating IP
template: src="{{ heat_stack_ip.src }}" dest="{{ heat_stack_ip.dest }}"
- name: HEAT template (API call) - floating IP
register: heat_ip_output
os_stack:
name: "{{ heat_stack_ip.name }}"
state: present
template: "{{ heat_stack_ip.dest }}"
wait: yes
parameters: "{{ heat_stack_ip.parameters }}"
- set_fact:
bastion_ip_ids: "{{ heat_ip_output.stack.outputs | json_query(query) }}"
vars:
query: "[?description=='Administration'].output_value"
- name: HEAT stack - backbone
tags: always
block:
- name: HEAT template (file) - backbone
template: src="{{ heat_stack_backbone.src }}" dest="{{ heat_stack_backbone.dest }}"
- name: HEAT template (API call) - backbone
register: heat_backbone_output
os_stack:
name: "{{ heat_stack_backbone.name }}"
state: present
template: "{{ heat_stack_backbone.dest }}"
wait: yes
parameters: "{{ heat_stack_backbone.parameters }}"
- name: Get public router's ID
with_items: "{{ heat_backbone_output['stack']['outputs'] }}"
when: item.output_key == "publication_router_id"
set_fact:
pub_router_id: "{{ item.output_value }}"
- name: HEAT stack - control plane
tags: nomad
block:
- name: HEAT template (file) - control plane
template: src="{{ heat_stack_controlplane.src }}" dest="{{ heat_stack_controlplane.dest }}"
- name: HEAT template (API call) - control plane
register: heat_controlplane_output
os_stack:
name: "{{ heat_stack_controlplane.name }}"
state: present
template: "{{ heat_stack_controlplane.dest }}"
wait: yes
parameters: "{{ heat_stack_controlplane.parameters }}"
- name: Inventory
tags: always
block:
- name: Get servers' facts
os_server_facts: server=*
- name: Inventory
template:
src: templates/hosts.ini.j2
dest: "{{ hosts_ini_path }}"
- name: SSH configuration
template: src=ssh.cfg.j2 dest="{{ ssh_cfg_path }}"