forked from kubevirt/common-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-templates.yaml
420 lines (385 loc) · 29.2 KB
/
generate-templates.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
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
---
- connection: local
hosts: 127.0.0.1
gather_facts: no
tasks:
- name: Prepare dist directory
file:
path: "{{ playbook_dir }}/dist/templates"
state: directory
- name: Load RHEL 9 versions
set_fact:
rhel9_labels: "{{ lookup('osinfo', 'distro=rhel') |map(attribute='short_id') |select('match', '^rhel9\\.') |list |sort }}"
- name: Load RHEL 9 image urls
set_fact:
rhel9_image_urls: "{{ rhel9_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ rhel9_labels }}"
- name: Generate RHEL 9 templates
template:
src: rhel9.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: tiny, workload: highperformance, memsize: "1.5Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: highperformance, memsize: "2Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, tablet: False, default: False}
vars:
os: rhel9
icon: rhel
majorrelease: rhel9
oslabels: "{{ rhel9_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: cloud-user
image_urls: "{{ rhel9_image_urls }}"
- name: Load RHEL 8 versions
set_fact:
rhel8_labels: "{{ lookup('osinfo', 'distro=rhel') |map(attribute='short_id') |select('match', '^rhel8\\.') |list |sort }}"
- name: Load RHEL 8 image urls
set_fact:
rhel8_image_urls: "{{ rhel8_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ rhel8_labels }}"
- name: Generate RHEL 8 templates
template:
src: rhel8.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: tiny, workload: highperformance, memsize: "1.5Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: highperformance, memsize: "2Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, tablet: False, default: False}
vars:
os: rhel8
icon: rhel
majorrelease: rhel8
oslabels: "{{ rhel8_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: cloud-user
image_urls: "{{ rhel8_image_urls }}"
- name: Load RHEL 7 versions
set_fact:
rhel7_labels: "{{ lookup('osinfo', 'distro=rhel') |map(attribute='short_id') |select('match', '^rhel7\\.') |list |sort }}"
- name: Load RHEL 7 image urls
set_fact:
rhel7_image_urls: "{{ rhel7_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ rhel7_labels }}"
- name: Generate RHEL 7 templates
template:
src: rhel7.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: tiny, workload: highperformance, memsize: "1Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: highperformance, memsize: "2Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, tablet: False, default: False}
vars:
os: rhel7
icon: rhel
majorrelease: rhel7
oslabels: "{{ rhel7_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: cloud-user
image_urls: "{{ rhel7_image_urls }}"
- name: Load RHEL 6 versions
set_fact:
rhel6_labels: "{{ lookup('osinfo', 'distro=rhel') |map(attribute='short_id') |select('match', '^rhel6\\.') |list |sort }}"
- name: Load RHEL 6 image urls
set_fact:
rhel6_image_urls: "{{ rhel6_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ rhel6_labels }}"
- name: Generate RHEL 6 templates
template:
src: rhel6.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
vars:
os: rhel6
icon: rhel
majorrelease: rhel6
oslabels: "{{ rhel6_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: cloud-user
image_urls: "{{ rhel6_image_urls }}"
- name: Load CentOS Stream 8 containerdisk and image urls
set_fact:
centos8stream_containerdisk_urls: "{{ lookup('osinfo', 'centos-stream8') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
centos8stream_image_urls: "{{ lookup('osinfo', 'centos-stream8') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
- name: Generate CentOS Stream 8 templates
template:
src: centos-stream8.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
vars:
os: centos-stream8
icon: centos
majorrelease: centos-stream8
oslabels:
- centos-stream8
osinfoname: "{{ oslabels[0] }}"
cloudusername: centos
containerdisk_urls: "{{ centos8stream_containerdisk_urls }}"
image_urls: "{{ centos8stream_image_urls }}"
- name: Load CentOS Stream 9 containerdisk and image urls
set_fact:
centos9stream_containerdisk_urls: "{{ lookup('osinfo', 'centos-stream9') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
centos9stream_image_urls: "{{ lookup('osinfo', 'centos-stream9') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
- name: Generate CentOS Stream 9 templates
template:
src: centos-stream9.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1.5Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
vars:
os: centos-stream9
icon: centos
majorrelease: centos-stream9
oslabels:
- centos-stream9
osinfoname: "{{ oslabels[0] }}"
cloudusername: centos
containerdisk_urls: "{{ centos9stream_containerdisk_urls }}"
image_urls: "{{ centos9stream_image_urls }}"
- name: Load CentOS 7 containerdisk and image urls
set_fact:
centos7_containerdisk_urls: "{{ lookup('osinfo', 'centos7.0') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
centos7_image_urls: "{{ lookup('osinfo', 'centos7.0') |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
- name: Generate CentOS 7 templates
template:
src: centos7.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: desktop, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
vars:
os: centos7
icon: centos
majorrelease: centos7
oslabels:
- centos7.0
osinfoname: "{{ oslabels[0] }}"
cloudusername: centos
containerdisk_urls: "{{ centos7_containerdisk_urls }}"
image_urls: "{{ centos7_image_urls }}"
- name: Load CentOS 6 versions
set_fact:
centos6_labels: "{{ lookup('osinfo', 'distro=centos') |map(attribute='short_id') |select('match', '^centos6\\.') |list |sort }}"
- name: Generate CentOS 6 templates
template:
src: centos6.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
vars:
os: centos6
icon: centos
majorrelease: centos6
oslabels: "{{ centos6_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: centos
- name: Load Fedora versions
set_fact:
fedora_labels: "{{ lookup('osinfo', 'distro=fedora') |select('osinfo_active') |map(attribute='short_id') |select('match', '^fedora3[5-9]|^fedora[4-9][0-9]') |list |sort }}"
- name: Load Fedora containerdisk and image urls
set_fact:
fedora_containerdisk_urls: "{{ fedora_containerdisk_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
fedora_image_urls: "{{ fedora_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ fedora_labels }}"
- name: Generate Fedora templates
template:
src: fedora.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: desktop, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: tiny, workload: highperformance, memsize: "1Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: small, workload: highperformance, memsize: "2Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, tablet: False, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, tablet: False, default: False}
vars:
os: fedora
icon: fedora
majorrelease: fedora
oslabels: "{{ fedora_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: fedora
containerdisk_urls: "{{ fedora_containerdisk_urls }}"
image_urls: "{{ fedora_image_urls }}"
- name: Load openSUSE versions
set_fact:
opensuse_labels: "{{ lookup('osinfo', 'distro=opensuse') |select('osinfo_active') |map(attribute='short_id') |list |sort }}"
- name: Load openSUSE image urls
set_fact:
opensuse_image_urls: "{{ opensuse_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ opensuse_labels }}"
- name: Generate openSUSE templates
template:
src: opensuse.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: tiny, workload: server, memsize: "1Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: True}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: False, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: False, default: False}
vars:
os: opensuse
icon: opensuse
majorrelease: opensuse
oslabels: "{{ opensuse_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: opensuse
image_urls: "{{ opensuse_image_urls }}"
- name: Load Ubuntu versions
set_fact:
ubuntu_labels: "{{ lookup('osinfo', 'distro=ubuntu') |select('osinfo_active') |map(attribute='short_id') |list |sort }}"
- name: Load Ubuntu containerdisk and image urls
set_fact:
ubuntu_containerdisk_urls: "{{ ubuntu_containerdisk_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
ubuntu_image_urls: "{{ ubuntu_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ ubuntu_labels }}"
- name: Generate Ubuntu templates
template:
src: ubuntu.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/{{ os }}-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: small, workload: desktop, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: small, workload: server, memsize: "2Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: True}
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, tablet: True, default: False}
vars:
os: ubuntu
icon: ubuntu
majorrelease: ubuntu
oslabels: "{{ ubuntu_labels }}"
osinfoname: "{{ oslabels[0] }}"
cloudusername: ubuntu
containerdisk_urls: "{{ ubuntu_containerdisk_urls }}"
image_urls: "{{ ubuntu_image_urls }}"
- name: Generate Windows server 2012 R2 templates
template:
src: windows2k12.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows2k12r2-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win2k12r2
- name: Generate Windows server 2016 templates
template:
src: windows2k16.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows2k16-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win2k16
- name: Generate Windows server 2019 templates
template:
src: windows2k19.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows2k19-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win2k19
- name: Generate Windows 10 templates
template:
src: windows10.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows10-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win10
- name: Generate Windows 11 templates
template:
src: windows11.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows11-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: desktop, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: desktop, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win11
- name: Generate Windows server 2022 templates
template:
src: windows2k22.tpl.yaml
dest: "{{ playbook_dir }}/dist/templates/windows2k22-{{ item.workload }}-{{ item.flavor }}.yaml"
with_items:
- {flavor: medium, workload: server, memsize: "4Gi", cpus: 1, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: True}
- {flavor: medium, workload: highperformance, memsize: "4Gi", cpus: 1, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
- {flavor: large, workload: server, memsize: "8Gi", cpus: 2, iothreads: False, emulatorthread: False, multiqueue: False, tablet: True, default: False}
- {flavor: large, workload: highperformance, memsize: "8Gi", cpus: 2, iothreads: True, emulatorthread: True, multiqueue: True, tablet: True, default: False}
vars:
osinfoname: win2k22