From d65003266cb03c3a1e19d6a4c0ed25141aed5f4b Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Wed, 12 Apr 2023 23:50:51 -0700 Subject: [PATCH] Renames and readmes * Add readme for cloud templates * Modify readme for repo in general * Change Rocky-X-OCP to be a base variant --- README.md | 20 +++++++++ Rocky-8-OCP.ks => Rocky-8-OCP-Base.ks | 0 cloud/README.md | 49 +++++++++++++++++++++++ cloud/{rocky-ocp.ks => rocky-ocp-base.ks} | 0 4 files changed, 69 insertions(+) rename Rocky-8-OCP.ks => Rocky-8-OCP-Base.ks (100%) create mode 100644 cloud/README.md rename cloud/{rocky-ocp.ks => rocky-ocp-base.ks} (100%) diff --git a/README.md b/README.md index 4a48a7a..36d08a6 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,26 @@ This branch has Rocky Linux 8 specific kickstarts. These kickstarts vary between cloud images and live images provided in our repositories and mirrors. +## Structure + +In the root of the repository are the general kickstarts in use that any +user can pick up, use, or modify to their liking to make their own Rocky +Linux live images, cloud images, and so on. These kickstarts are generated +by templates that live in the various directories in this repository. + +* `cloud` -> Cloud image templates +* `live` -> Live image templates +* `container` -> Container image templates + +These kickstarts are generated using `ksflatten`. Changes made to the +kickstarts generally match between the templates and the full kickstarts +in the root. + +For SIG/Core's usage, we use the `live` area as a "working" directory, +where we use the split parts in our automation for the images and the +pre-flattened versions are there for the convenience of all users. This +is easier than using the pre-made ones in empanadas. + ## Building Live Images To build live images, you will need to use `livecd-creator` or diff --git a/Rocky-8-OCP.ks b/Rocky-8-OCP-Base.ks similarity index 100% rename from Rocky-8-OCP.ks rename to Rocky-8-OCP-Base.ks diff --git a/cloud/README.md b/cloud/README.md new file mode 100644 index 0000000..351a819 --- /dev/null +++ b/cloud/README.md @@ -0,0 +1,49 @@ +# Cloud Templates + +This directory contains templated versions of the cloud images. This is +extremely useful for us to be able to create more variants or modify +all variants at once if need be. + +The general guidelines/ideas work like this: + +* Start with a basic name, such as `rocky-${provider}-${variant}.ks` +* Optionally create additional kickstarts, such as an additional packages file +* Include the very base as necessary: + + * rocky-cloud-base.ks + * rocky-cloud-parts-base.ks or rocky-cloud-parts-lvm.ks + +* Include other customizations from another kickstart as necessary, such as an additional packages kickstart +* bootloader configuration and then final %post ... %end section + +The most basic example of our most basic generic cloud image goes like this. See comments for details. + +``` +# rocky-genclo-base.ks + +# Imports the absolute base for the cloud images. This is general setup settings. +%include rocky-cloud-base.ks + +# Imports partition scheme and creation for the image. This is non-LVM. +%include rocky-cloud-parts-base.ks + +# Imports base packages that all cloud images are expected to have +%include rocky-cloud-base-packages.ks + +# bootloader information, each cloud will have different settings, so better we put it here. +bootloader --append="console=ttyS0,115200n8 no_timer_check crashkernel=auto net.ifnames=0" --location=mbr --timeout=1 + +# Anything else can go here that isn't fulfilled by custom or base templates. +# This can be repos if needed. + +# the final post section is done here (we've removed all of it for the sake of the example) +%post --erroronfail +. . . +%end +``` + +At the end, you would run run ksflatten, and you now have a customized kickstart. + +``` +ksflatten -c rocky-genclo-base.ks -o Rocky-X-GenericCloud-Base.ks +``` diff --git a/cloud/rocky-ocp.ks b/cloud/rocky-ocp-base.ks similarity index 100% rename from cloud/rocky-ocp.ks rename to cloud/rocky-ocp-base.ks