-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy.yaml
201 lines (196 loc) · 6.26 KB
/
deploy.yaml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
#
# Deploy playbook for baremetal Undercloud
#
# Wait for Undercloud to be provisioned via Beaker/Foreman
- hosts: undercloud
gather_facts: false
remote_user: root
vars:
wait_for_ready: true
vars_files:
- vars/data.yaml
- vars/main.yaml
- vars/main.local.yaml
tasks:
- name: Check if lab_hardware set to supported labs
fail:
msg: Did not select lab ({{lab_hardware}}) from supported labs - {{labs_supported}}
when: lab_hardware not in labs_supported
# 30 minute timeout (Incase large machine or foreman rebuild is longer than usual)
- name: Wait for Machine Ready (Incase machine is rebuilding)
local_action:
module: wait_for
host: "{{inventory_hostname}}"
port: 22
delay: 15
timeout: 1800
when: wait_for_ready
# Depending on hardware rebuild, we may not have the ssh key exchanged
- name: Setup root authorized key
authorized_key:
user: root
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
# Pre-deployment tooling may lay down vlans to test network before hand
# Lets remove this to avoid confusion when debugging or vlan conflicts
- name: Clean Validation vlans
shell: |
for interface in $(ip -o link show | awk '{print $2}' | grep "@" | awk '{split($0,interface,"@"); print interface[1]}')
do
ifdown ${interface}
rm /etc/sysconfig/network-scripts/ifcfg-${interface}
done
# Tasks as root
- hosts: undercloud
gather_facts: true
vars_files:
- vars/data.yaml
- vars/main.yaml
- vars/main.local.yaml
remote_user: root
pre_tasks:
- name: Get timestamp
command: "date -u +%Y%m%d-%H%M%S"
delegate_to: localhost
register: current_ts
- name: Set remote log directory
set_fact:
log_dir: /home/stack/mccloud/log/{{current_ts.stdout}}
- name: Set local Artifact Directory
set_fact:
artifact_dir: artifacts/{{version}}-deploy{{deploy_scenario}}-{{current_ts.stdout}}
- name: Ensure artifact directory exists
file:
path: "{{artifact_dir}}"
state: directory
delegate_to: localhost
roles:
- role: 000-undercloud-repos
- role: 001-undercloud-tools
- role: 002-undercloud-update-reboot
- role: 003-undercloud-setup-stack-user
- role: 004-undercloud-install-tripleo
- role: 005-undercloud-setup-hostname
- role: 006-undercloud-private-external-vlan
# Tasks as stack user
- hosts: undercloud
gather_facts: false
vars_files:
- vars/data.yaml
- vars/main.yaml
- vars/main.local.yaml
remote_user: stack
roles:
- role: 007-undercloud-install
- role: 008-undercloud-setup-dns
- role: 009-undercloud-templates-files
- role: 010-browbeat-setup
when: deploy_browbeat
- role: 011-browbeat-deploy-undercloud-collectd
when:
- deploy_browbeat
- deploy_undercloud_collectd
- role: 012-undercloud-import-nodes
- role: 013-undercloud-bulkintrospect-overcloud-nodes
when:
- introspection_enabled
- bulk_introspection
- role: 013-undercloud-introspectionscript-overcloud-nodes
when:
- introspection_enabled
- not bulk_introspection
- role: 014-undercloud-setup-container-registry
when: version >= 12
- role: 015-undercloud-deploy-workarounds
# Overcloud Ready for Deployment now:
- role: 016-overcloud-deploy
when: deploy_overcloud
is_redeploy: false
- role: 017-browbeat-generate-overcloud-hosts
when: deploy_browbeat
- role: 018-browbeat-deploy-overcloud-collectd
when:
- deploy_browbeat
- deploy_overcloud_collectd
- role: 019-overcloud-disable-admin-quota
when: disable_quota
- role: 020-overcloud-create-keypair
when: create_keypair
- role: 021-overcloud-create-flavors
when: create_flavors
- role: 022-overcloud-upload-images
when: upload_guest_images
- role: 023-overcloud-create-security-group
when: create_security_group
- role: 024-overcloud-create-networks
when: create_networks
- role: 025-undercloud-route-external-traffic
when: route_external_traffic_from_undercloud
- role: 026-browbeat-workload-guests-config
when:
- create_networks
- deploy_browbeat
- browbeat_workload_guests
- role: 027-browbeat-install
when: deploy_browbeat
- role: 028-browbeat-deploy-grafana-dashboards
when:
- deploy_browbeat
- deploy_grafana_dashboards
- role: 029-browbeat-shaker-image-build
when:
- deploy_browbeat
- create_networks
- browbeat_shaker_build
- role: 030-browbeat-adjust-nova-allocation-ratios
when:
- deploy_browbeat
- ana_enabled
- role: 031-browbeat-collect-metadata
when:
- deploy_browbeat
- browbeat_collect_metadata
- role: 032-browbeat-install-microcode
when:
- deploy_browbeat
- update_microcode
- role: 033-browbeat-adjust-security
when:
- deploy_browbeat
- as_enabled
- role: 050-cloud-ready
when:
- deploy_browbeat
- browbeat_run
# Only on when microcode has been upodated as that initiates a reboot
- role: 051-cinder-remount-loopback
when:
- deploy_browbeat
- deploy_scenario|int not in deploy_scenarios_with_ceph
- update_microcode
- role: 100-browbeat-run
when:
- deploy_browbeat
- browbeat_run
post_tasks:
- name: "Deployed with {{total_node_failure_count}} failures"
debug:
msg: "Deployed with {{total_node_failure_count}} failures"
when: total_node_failure_count|int > 0
# Bugs/Thoughts
# * Improve organization of different hardware configs
# * Handle heterogeneous hardware types
# * Capture Memory usage?
# * Auto install: sysstat, strace
# * Hypervisor install for microcloud hardware (Remove beaker dependency)
# Speed Ups Ideas:
# * Concurrent collectd installs (across node types)
# * Browbeat workload vms built beforehand
# * Shaker workload vms built beforehand
# * Microcode pre-installed
# Healthcheck
# * Get Token
# * Add Network
# * Boot Instance
# * Ping Instance
# * Delete Instance, Network