// Module included in the following assemblies:
//
// microshift/microshift-kickstart-prep.adoc

:_mod-docs-content-type: PROCEDURE
[id="microshift-kickstart-rpm-install_{context}"]
= Creating a Kickstart file for a {microshift-short} RPM installation

[role="_abstract"]
You can use the Kickstart file provided with {microshift-short} to provision an RPM-based virtual machine.

.Prerequisites

* You set up the {microshift-short} Kickstart file.
* You know the link:https://console.redhat.com/insights/connector/activation-keys[Activation Keys] and organization ID to activate your Red{nbsp}Hat subscription.
* You have the information needed to set the `BOOTC_IMAGE_URL`, `AUTH_CONFIG`, and `REGISTRY_CONFIG` required variables.

[IMPORTANT]
====
The subscription must include access to the `rhocp-4.x-for-rhel-{op-system-version-major}-$(uname -m)-rpms` and `fast-datapath-for-rhel-{op-system-version-major}-$(uname -m)-rpms` RPM repositories.
====

.Procedure

. Add the following variables to create an RPM Kickstart file:
+
* The `RHSM_ORG` variable contains a Red{nbsp}Hat Subscription Manager organization ID for the subscription registration command in the Kickstart file.
+
[source,terminal]
----
$ export RHSM_ORG="$(cat ~/.rhsm-activation-org)"
----
+
* The `RHSM_KEY` variable contains a Red{nbsp}Hat Subscription Manager activation key for the subscription registration command in the Kickstart file.
+
[source,terminal]
----
$ export RHSM_KEY="$(cat ~/.rhsm-activation-key)"
----
+
* The `MICROSHIFT_VER` variable references the {microshift-short} version to install using the `4.y` format. The latest available `.z` version of the `4.y` version set in this variable is automatically installed.
+
[source,terminal]
----
$ export MICROSHIFT_VER={product-version}
----
+
In this example, the latest `.z` of the minor version that you set is installed.

. Run the following command to create the `kickstart.ks` file to be used during the virtual machine installation:
+
[source,terminal]
----
envsubst < \
    /usr/share/microshift/kickstart/kickstart-rpm.ks.template > \
    "${HOME}/kickstart.ks"
----
