diff --git a/manifests/function/hostgenerator-m3/hosttemplate.yaml b/manifests/function/hostgenerator-m3/hosttemplate.yaml index 278913db7..8a03c16a8 100644 --- a/manifests/function/hostgenerator-m3/hosttemplate.yaml +++ b/manifests/function/hostgenerator-m3/hosttemplate.yaml @@ -36,6 +36,12 @@ template: | {{- $_ := set $host "hardwareProfile" "default" }} {{- end }} {{- $hardwareProfile := index $envAll.hardwareProfiles $host.hardwareProfile }} + {{- if not $hardwareProfile -}} + {{- fail (printf "can't find hardwareProfile %s" $host.hardwareProfile) -}} + {{- end -}} + {{- if not $hardwareProfile.firmware -}} + {{- fail (printf "hardwareProfile %s doesn't have firmware field" $host.hardwareProfile) -}} + {{- end -}} --- apiVersion: metal3.io/v1alpha1 kind: BareMetalHost @@ -53,7 +59,7 @@ template: | bmc: address: {{ $host.bmcAddress }} credentialsName: {{ $hostName }}-bmc-secret - disableCertificateVerification: {{ $host.disableCertificateVerification }} + disableCertificateVerification: {{ default false $host.disableCertificateVerification }} firmware: {{ toYaml $hardwareProfile.firmware | indent 4 }} {{- /* If no raid is defined for a host, simply skip. There is no default setting for raid */ -}} diff --git a/manifests/site/test-site/target/catalogues/hosts.yaml b/manifests/site/test-site/target/catalogues/hosts.yaml index b172134df..e4257c850 100644 --- a/manifests/site/test-site/target/catalogues/hosts.yaml +++ b/manifests/site/test-site/target/catalogues/hosts.yaml @@ -36,7 +36,7 @@ hosts: macAddresses: oam: 52:54:00:9b:27:02 pxe: 52:54:00:b6:ed:02 - hardwareProfile: example # defined in the hardwareprofile-example function + hardwareProfile: default node03: bootMode: legacy macAddress: 52:54:00:b6:ed:23