This document is intended for folks who want to learn ansible basics and how to install Red hat Openshift on KVM for training purposes or demo.
Playbooks can be found here: https://github.com/elajoie/lab.local
Most of the Ansible is basic and fits well with someone who has just finished the EX294 exam.
In this section you will set up the bastion which is used to stage many network services including PXE booting of KVM nodes. Grab the latest version of RHEL8 (8.2 Beta for this version) and put it on a USB to boot your bastion HW off of. All the HW in my topology is set up on VLAN1 and VLAN2 with the 192.168.1.0/24 network on VLAN1.
-
Install minimal server version and register with RH
-
get the latest RHEL8 boot iso and put it in the files folder in the pxe role
-
update the variables in the defaults folder for this role to match the iso
-
create a .gitignore file with the following
- .gitignore
- inventory
- vault
-
install packages needed on your laptop running the playbooks
- rhel-system-roles
- python3-netaddr
-
create vault file with these variable:
- vault_rhn_username: RHNusername
- vault_rhn_password: neverEndingShadow
- vault_orgid: sevenDigitOrgID
- vault_actkey: keyNameYouCreate
- vault_rootpasswd: changeme
- vault_kvm02_user: redfish (optional)
- vault_kvm02_pass: changeme (optional)
- vault_token_long: "long secret"
- vault_sshkey: "ssh-rsa AAAA"
-
Run 01bastion.yml to setup all the services
-
Once this play is done you should be able to PXE boot your KVM nodes
-
You also have an optional role called redfish if you have redfish support in your KVM nodes to automate the reboot and boot mode setting to PXE via APIs
-
Run 02kvm.yml roles when all the kvm nodes have done rebooting
-
For now just manually start the VMs once they are all off and the OCP install should finish on its own
-
Shut down the bootstrap node #On bastion:
-
export KUBECONFIG=/opt/registry/www/html/ignition/auth/kubeconfig
-
oc get nodes
-
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
-
oc get clusterversion; echo; oc get clusteroperators
-
Do this command untill all the CRSs are approved and you see all your workers. oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs oc adm certificate approve