Skip to content

Commit

Permalink
add: wip script
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Dec 13, 2023
1 parent 85ff5e7 commit 99c352a
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions scripts/wip/bare-metal-sno.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash

download_openshift-baremetal-install(){
export VERSION=stable-4.12
export RELEASE_IMAGE=$(curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$VERSION/release.txt | grep 'Pull From: quay.io' | awk -F ' ' '{print $3}')

export cmd=openshift-baremetal-install
export pullsecret_file=./pull-secret.txt
export extract_dir=$(pwd)

oc adm release extract \
--registry-config "${pullsecret_file}" \
--command="${cmd}" \
--to "${extract_dir}" "${RELEASE_IMAGE}"
}


download_openshift_install_bins(){
VERSION=4.12
curl -LOC - https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/4.12/latest/rhcos-4.12.30-x86_64-live.x86_64.iso
curl -LC - https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/coreos-installer/latest/coreos-installer_amd64 -o coreos-installer
chmod +x coreos-installer
}

ocp_install_create_config(){
cat << YAML > install-config.yaml
apiVersion: v1
baseDomain: kow.lab
metadata:
name: ocp
networking:
machineNetwork:
- cidr: 10.0.0.0/24
# networkType: OpenShiftSDN
compute:
- name: worker
replicas: 1
controlPlane:
name: master
replicas: 1
platform:
baremetal: {}
platform:
baremetal:
apiVIP: 10.0.0.155
ingressVIP: 10.0.0.156
bootstrapOSImage: BOOTSTRAPOSIMAGE
provisioningNetwork: Disabled
externalBridge: "baremetal"
hosts:
- name: sno-bm
role: master
bmc:
# address: ipmi://10.0.0.111:623
address: redfish-virtualmedia://10.0.0.111:8888/redfish/v1/Systems/sno-bm
disableCertificateVerification: True
username: admin
password: secure_password
bootMACAddress: 52:54:00:cb:ce:00
rootDeviceHints:
deviceName: "/dev/vda"
# bootMode: legacy
bootMode: UEFI
- name: kvm-00
role: worker
bmc:
# address: ipmi://{{ host.vbmc_ip }}:{{ host.vbmc_port }}
address: redfish-virtualmedia://10.0.0.111:8888/redfish/v1/Systems/kvm-00
disableCertificateVerification: True
username: admin
password: secure_password
bootMACAddress: 52:54:00:cb:cf:00
rootDeviceHints:
deviceName: "/dev/vda"
bootMode: UEFI
pullSecret: '{"auths":{"cloud.openshift.com":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K29jbV9hY2Nlc3NfNDk4NzFhNTVjZDRiNDA4ZTllYjY5ZjMyZDdiMWMwMTI6VEJPWTRPWTBMS1VYRzFRNjg5QUM5T1I2V0RXRkFVTzJWM044NUVXSzAwQjYzU0gwSENCOUoxUzIyRzJQSkFZRA==","email":"clatschk@redhat.com"},"quay.io":{"auth":"b3BlbnNoaWZ0LXJlbGVhc2UtZGV2K29jbV9hY2Nlc3NfNDk4NzFhNTVjZDRiNDA4ZTllYjY5ZjMyZDdiMWMwMTI6VEJPWTRPWTBMS1VYRzFRNjg5QUM5T1I2V0RXRkFVTzJWM044NUVXSzAwQjYzU0gwSENCOUoxUzIyRzJQSkFZRA==","email":"clatschk@redhat.com"},"registry.connect.redhat.com":{"auth":"fHVoYy1wb29sLWY4NjgxZWJmLWRiZDEtNDM1OS04MzM3LTEwODMyY2FiOGJhYzpleUpoYkdjaU9pSlNVelV4TWlKOS5leUp6ZFdJaU9pSmtNVGd3TldVd05qUmtaVEkwTWpNMVlqQmhNVGsxTjJGbVltWXhZMlEyTXlKOS5xS2NRY0ZyTVZpZ3huSFo2dzkwSHhWbjhsSmxaV2o4SnVmck9lc2ZrbGlVcHdXUExSRk9kUXRtSlJ5NVltd0VtZ0oyLUQybVRsbWF4ZnJhNkh6LURzYU1xeEVvMk1SLWRsUXE4VTdnak92azFGWjdybFF4WmFOaDJGUmRUMGFFYlpmTnN0cGFiTVIyX1VCa0tISmJieFUzTkNFX3RIaHlDQ2Y1UlR0YzZicXRvRFZub0o4WXBKMWRuRnlTdmVVNlJIRENVLTR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IaHlDQ2Y1UlR0YzZicXRvRFZub0o4WXBKMWRuRnlTdmVVNlJIRENVLTR5WGprQ25GTkYtQ0dRQllCRkJSYzd4dzJxM1RkUFd3WDQtRDFrM2t5dkJCcEI4bGpjRElqNzRBODJwRmpxOW0wYmxZT1FwQXBTd0pzWlJRUFIwN3NlNkJ5czhkMVZweDBZbGVGTzZNZFdKQ3E2SmdGelJQaTRSbzU2Wjg1YTQ5Q25HX2VCamFIYWxnVEtDRDJrQzRGV3BvNk1mSGdidk5MX3l3VkxmSVI5N2VJa21weEcxOVA0R2luWHZ4R19rMGZvZTNRLWdfbC15WTl5SVNzNTQwdGZpSjM3RU5VOFJmWGtxdGpKN1VBY3pjaUVoN2EwR0xHazNXd3B2V1JoSS1sWEZlVGtKNDVVbjFCUXNZYjlUNUt5NXJGTXVSVy1VdW5URjZTb2pkZml6ZEdKNGhSWXlqSVJGZnRmMGZDeFF3dF9WS2M3VG8tMkR2anJpX0RBVVYwV2xyeDhGT0lOLUFGdXM1MnFERmkzdWJxODJQVzN6UjEzbnA0eTU4N2U4THZ2SDBfZUhSTDdub3p4UG0wYzY1ZWRPZFNRQjdMYWRjVkl3aFZIX1BDNm0xMV9FQUJodG1UVmtkVG9RYlpBZTVWQzR6YmQxZ19ONXZFSERPS09iaW5falZVUnNMS3d2ZlFjQjZtMA==","email":"clatschk@redhat.com"}}}'
sshKey: 'ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAHPqioT3YcaxhWwmu4qHQs8gF/dCdYGe65U29PmJZ7gFIIHC9B+iad2NGqJ9YsUaEJd5E1zugzmmEquDTWMEuIgyQEQDjXrRaCBgTMiM1xd+Hslk6MXSkcpPMCZ4+kPQ10E+kPMmkbLJfKucGYNLPsNOkDhFaLxM+DTKYCA7NEic8dYrg== cory@kowdora'
bootstrapInPlace:
InstallationDisk: <boot-disk>
YAML
}

0 comments on commit 99c352a

Please sign in to comment.