-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathkcli_plan_infra.yml
90 lines (84 loc) · 2.91 KB
/
kcli_plan_infra.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
{% set virtual_disks = [{'size': disk_size, 'interface': disk_interface}] + extra_disks %}
{% if fake_network %}
{{ baremetal_net }}:
type: network
cidr: {{ baremetal_cidr }}
dhcp: {{ fake_network_dhcp }}
domain: {{ domain }}
{% if (dualstack or dual_force|default(False)) and dualstack_cidr != None %}
dual_cidr: {{ dualstack_cidr }}
{% endif %}
{% endif %}
{% if virtual_hub %}
{% for num in range(0, ctlplanes) %}
{{ cluster }}-ctlplane-{{ num }}:
pool: {{ pool }}
redfish_iso: {{ cluster }}.iso
image:
numcpus: {{ ctlplane_numcpus or numcpus }}
cloudinit: false
start: false
uefi_legacy: {{ 'true' if not uefi|default(False) else 'false' }}
boot_order: {{ extra_disks|length > 0 }}
user: core
memory: {{ ctlplane_memory or memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, num + 1) }}
disks: {{ virtual_disks }}
{% endfor %}
{% endif %}
{% if virtual_hub and workers > 0 %}
{% for num in range(0, workers) %}
{{ cluster }}-worker-{{ num }}:
pool: {{ pool }}
redfish_iso: {{ cluster }}.iso
image:
numcpus: {{ worker_numcpus or numcpus }}
start: false
cloudinit: false
uefi_legacy: true
boot_order: {{ extra_disks|length > 0 }}
user: core
memory: {{ worker_memory or memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, ctlplanes + num + 1) }}
disks: {{ virtual_disks }}
{% endfor %}
{% endif %}
{% set total_number = namespace(value=0) %}
{% for spoke in spokes %}
{% set spoke_name = spoke.name %}
{% set spoke_api_ip = spoke.get('api_ip') %}
{% set spoke_ingress_ip= spoke.get('ingress_ip') %}
{% set spoke_ctlplanes_number = spoke.get('ctlplanes', 1) %}
{% set spoke_workers_number = spoke.get('workers', 0) %}
{% set virtual_nodes_number = spoke.get('virtual_nodes', 0) %}
{% set spoke_uefi = spoke.get('uefi', spoke_uefi) %}
{% set spoke_virtual_nodes_numcpus = spoke.get('virtual_nodes_numcpus', spoke_virtual_nodes_numcpus) %}
{% set spoke_virtual_nodes_memory = spoke.get('virtual_nodes_memory', spoke_virtual_nodes_memory) %}
{% set spoke_virtual_nodes_disk_size = spoke.get('virtual_nodes_disk_size', spoke_virtual_nodes_disk_size) %}
{% set spoke_virtual_nodes_disk_interface = spoke.get('virtual_nodes_disk_interface', spoke_virtual_nodes_disk_interface) %}
{% if virtual_nodes_number > 0 %}
{% for num in range(0, virtual_nodes_number) %}
{{ cluster }}-{{ spoke_name }}-node-{{ num }}:
pool: {{ pool }}
redfish_iso: {{ spoke_name }}.iso
image:
numcpus: {{ spoke_numcpus }}
start: false
cloudinit: false
uefi_legacy: {{ 'false' if uefi|default(False) else spoke_uefi }}
user: core
memory: {{ spoke_memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, ctlplanes + workers + total_number.value + num + 1) }}
disks:
- size: {{ spoke_disk_size }}
interface: {{ spoke_disk_interface }}
{% endfor %}
{% set total_number.value = total_number.value + spoke_virtual_nodes_number %}
{% endif %}
{% endfor %}