apiVersion: v1
data:
  password: {{ password|string|base64 }}
  username: {{ user|string|base64 }}
kind: Secret
metadata:
  name: {{ name }}
  namespace: {{ namespace }}-{{ cluster }}
type: Opaque
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
  name: {{ name }}
  namespace: {{ namespace }}-{{ cluster }}
  labels:
    infraenvs.agent-install.openshift.io: {{ cluster }}
  annotations:
    inspect.metal3.io: disabled
    bmac.agent-install.openshift.io/hostname: {{ name }}
    bmac.agent-install.openshift.io/role: worker
spec:
  bmc:
    disableCertificateVerification: True
    {% if 'redfish' in url or 'idrac' in url %}
    address: {{ url  }}
    {% elif model in ['hp', 'hpe', 'supermicro'] %}
    address: redfish-virtualmedia://{{ url }}/redfish/v1/Systems/1
    {% else %}
    address: idrac-virtualmedia://{{ url }}/redfish/v1/Systems/System.Embedded.1
    {% endif %}
    credentialsName: {{ name }}
  bootMACAddress: {{ mac }}
  hardwareProfile: unknown
  online: true
  automatedCleaningMode: disabled
  bootMode: {{ 'legacy' if not uefi|default(True) else 'UEFI' }}
---

