-
Notifications
You must be signed in to change notification settings - Fork 25
/
install-opsman.yml
263 lines (251 loc) · 7.98 KB
/
install-opsman.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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
---
resource_types:
# A custom Concourse Resource type for detecting Semver-based config
# Ref: https://github.com/brightzheng100/semver-config-concourse-resource
- name: semver-config
type: docker-image
source:
repository: itstarting/semver-config-concourse-resource
tag: 1.1.0
resources:
- name: platform-automation-tasks
type: s3
source:
endpoint: ((s3.endpoint))
region_name: ((s3.region_name))
access_key_id: ((s3.access_key_id))
secret_access_key: ((s3.secret_access_key))
bucket: ((s3.buckets.platform_automation))
regexp: .*tasks-(.*).zip
- name: platform-automation-image
type: s3
source:
endpoint: ((s3.endpoint))
region_name: ((s3.region_name))
access_key_id: ((s3.access_key_id))
secret_access_key: ((s3.secret_access_key))
bucket: ((s3.buckets.platform_automation))
regexp: .*image-(.*).tgz
- name: installation
type: s3
source:
endpoint: ((s3.endpoint))
region_name: ((s3.region_name))
access_key_id: ((s3.access_key_id))
secret_access_key: ((s3.secret_access_key))
bucket: ((s3.buckets.foundation))
regexp: installation-after-(.*).zip
- name: product-config-opsman
type: semver-config
source:
driver: git
uri: ((git.configuration.uri))
branch: master
private_key: ((git.private_key))
username: ((git.user.username))
password: ((git.user.password))
config_file: ((foundation))/products.yml
config_path: products.opsman
version_path: products.opsman.product-version
version_pattern: "m.n.p"
- name: configuration
type: git
source:
private_key: ((git.private_key))
username: ((git.user.username))
password: ((git.user.password))
uri: ((git.configuration.uri))
branch: master
# reusable stuff
credhub-interpolate: &credhub-interpolate
image: platform-automation-image
file: platform-automation-tasks/tasks/credhub-interpolate.yml
input_mapping:
files: configuration
params:
CREDHUB_SERVER: ((credhub.server))
CREDHUB_CA_CERT: ((credhub.ca_cert))
CREDHUB_CLIENT: ((credhub.client))
CREDHUB_SECRET: ((credhub.secret))
PREFIX: /concourse/((foundation))
INTERPOLATION_PATHS: ((credhub.interpolate_folders))
jobs:
# 1. create-opsman-and-configure-auth
- name: create-opsman-and-configure-auth
serial: true
plan:
- in_parallel:
- get: product-config-opsman
trigger: true
- get: platform-automation-image
params: {unpack: true}
- get: platform-automation-tasks
params: {unpack: true}
- get: configuration
- task: credhub-interpolate
<<: *credhub-interpolate
- task: download-product
image: platform-automation-image
file: platform-automation-tasks/tasks/download-product.yml
input_mapping:
config: product-config-opsman
vars: interpolated-files
params:
CONFIG_FILE: semver-config.yaml
VARS_FILES: vars/((foundation))/config/global.yml
- task: create-vm
image: platform-automation-image
file: platform-automation-tasks/tasks/create-vm.yml
input_mapping:
image: downloaded-product
state: configuration
config: configuration
vars: interpolated-files
params:
OPSMAN_CONFIG_FILE: ((foundation))/products/ops-manager.yml
VARS_FILES: vars/((foundation))/vars/ops-manager-vars.yml
STATE_FILE: ((foundation))/state/state.yml
on_success:
do:
- task: make-commit
image: platform-automation-image
file: platform-automation-tasks/tasks/make-git-commit.yml
input_mapping:
repository: configuration
file-source: generated-state
output_mapping:
repository-commit: configuration-commit
params:
FILE_SOURCE_PATH: state.yml
FILE_DESTINATION_PATH: ((foundation))/state/state.yml
GIT_AUTHOR_EMAIL: ((git.user.email))
GIT_AUTHOR_NAME: ((git.user.username))
COMMIT_MESSAGE: "Add or update state file: state.yml"
- put: configuration
params:
repository: configuration-commit
merge: true
- task: configure-authentication
image: platform-automation-image
file: platform-automation-tasks/tasks/configure-authentication.yml
attempts: 10
input_mapping:
env: interpolated-files
config: interpolated-files
params:
ENV_FILE: ((foundation))/env/env.yml
AUTH_CONFIG_FILE: ((foundation))/config/auth.yml
# 2. generate-director-config
- name: generate-director-config
serial: true
plan:
- in_parallel:
- get: product-config-opsman
trigger: true
passed: [create-opsman-and-configure-auth]
- get: platform-automation-image
params: {unpack: true}
- get: platform-automation-tasks
params: {unpack: true}
- get: configuration
- task: credhub-interpolate
<<: *credhub-interpolate
- task: staged-director-config
image: platform-automation-image
file: platform-automation-tasks/tasks/staged-director-config.yml
input_mapping:
env: interpolated-files
params:
ENV_FILE: ((foundation))/env/env.yml
on_success: &make-config-commit
do:
- task: make-commit
image: platform-automation-image
file: platform-automation-tasks/tasks/make-git-commit.yml
input_mapping:
repository: configuration
file-source: generated-config
output_mapping:
repository-commit: configuration-commit
params:
FILE_SOURCE_PATH: director.yml
FILE_DESTINATION_PATH: ((foundation))/generated-config/director.yml
GIT_AUTHOR_EMAIL: ((git.user.email))
GIT_AUTHOR_NAME: ((git.user.username))
COMMIT_MESSAGE: "Add or update product config: director.yml"
- put: configuration
params:
repository: configuration-commit
merge: true
# 3. configure-director
- name: configure-director
serial: true
plan:
- in_parallel:
- get: product-config-opsman
passed: [create-opsman-and-configure-auth]
- get: platform-automation-image
params: {unpack: true}
- get: platform-automation-tasks
params: {unpack: true}
- get: configuration
- task: credhub-interpolate
<<: *credhub-interpolate
- task: configure-director
image: platform-automation-image
file: platform-automation-tasks/tasks/configure-director.yml
input_mapping:
config: configuration
env: interpolated-files
vars: interpolated-files
params:
ENV_FILE: ((foundation))/env/env.yml
DIRECTOR_CONFIG_FILE: ((foundation))/products/director.yml
VARS_FILES: vars/((foundation))/vars/director-vars.yml
# 4. apply-director-changes
- name: apply-director-changes
serial: true
plan:
- in_parallel:
- get: product-config-opsman
passed: [configure-director]
- get: platform-automation-image
params: {unpack: true}
- get: platform-automation-tasks
params: {unpack: true}
- get: configuration
- task: credhub-interpolate
<<: *credhub-interpolate
- task: apply-director-changes
image: platform-automation-image
file: platform-automation-tasks/tasks/apply-director-changes.yml
input_mapping:
env: interpolated-files
params:
ENV_FILE: ((foundation))/env/env.yml
# 5. export-installation
- name: export-installation
serial: true
plan:
- in_parallel:
- get: product-config-opsman
passed: [apply-director-changes]
trigger: true
- get: platform-automation-image
params: {unpack: true}
- get: platform-automation-tasks
params: {unpack: true}
- get: configuration
- task: credhub-interpolate
<<: *credhub-interpolate
- task: export-installation
image: platform-automation-image
file: platform-automation-tasks/tasks/export-installation.yml
input_mapping:
env: interpolated-files
params:
ENV_FILE: ((foundation))/env/env.yml
INSTALLATION_FILE: installation-after-ops-manager.zip
- put: installation
params:
file: installation/installation-after-ops-manager.zip