forked from karmab/kcli-ztp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathztp_bmc.yml
55 lines (54 loc) · 1.76 KB
/
ztp_bmc.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
{% if ztp_virtual_nodes %}
{% set extra_nodes = [] %}
{% for num in range(0, ztp_virtual_nodes_number) %}
{% do extra_nodes.append({}) %}
{% endfor %}
{% set ztp_nodes = extra_nodes + ztp_nodes %}
{% endif %}
{% for node in ztp_nodes %}
{% set num = loop.index0 %}
apiVersion: v1
data:
password: {{ bmc_password|string|base64 }}
username: {{ bmc_user|string|base64 }}
kind: Secret
metadata:
name: {{ cluster }}-ztp-bmc-secret-{{ num }}
namespace: {{ ztp_spoke_name }}
type: Opaque
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
name: {{ cluster }}-ztp-node-{{ num }}
namespace: {{ ztp_spoke_name }}
labels:
infraenvs.agent-install.openshift.io: {{ ztp_spoke_name }}
annotations:
inspect.metal3.io: disabled
bmac.agent-install.openshift.io/hostname: {{ cluster }}-ztp-node-{{ num }}
spec:
bmc:
{% if 'redfish_address' in node %}
disableCertificateVerification: True
{% if 'redfish' in node['redfish_address'] or 'idrac' in node['redfish_address'] %}
address: {{ node['redfish_address'] }}
{% elif node['model']|default(model) == 'hpe' %}
address: redfish-virtualmedia://{{ node['redfish_address'] }}/redfish/v1/Systems/1
{% else %}
address: idrac-virtualmedia://{{ node['redfish_address'] }}/redfish/v1/Systems/System.Embedded.1
{% endif %}
{% else %}
address: redfish-virtualmedia+http://IP:8000/redfish/v1/Systems/UUID-{{ num }}
{% endif %}
credentialsName: {{ cluster }}-ztp-bmc-secret-{{ num }}
{% if 'provisioning_mac' in node %}
bootMACAddress: {{ node['provisioning_mac'] }}
{% else %}
bootMACAddress: {{ ztp_virtual_nodes_baremetal_mac_prefix + ":" + "%02.d" | format(num + 1)| string }}
{% endif %}
hardwareProfile: unknown
online: true
automatedCleaningMode: disabled
---
{% endfor %}