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

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

You can use the Kickstart file provided with {microshift-short} to provision a {op-system-ostree}-based virtual machine.

.Prerequisites

* You set up the {microshift-short} Kickstart file.
* You have the information needed to set required and optional variables.

.Procedure

. Add the following required variables to create an {op-system-ostree} Kickstart file:
+
* The `OSTREE_SERVER_URL` variable contains an `rpm-ostree` server URL that is passed to the `ostreesetup` Kickstart command.
+
[source,terminal,subs="+quotes"]
----
$ export OSTREE_SERVER_URL="_<http://my_ostree_server_url>_"
----
+
Replace _<http://my_ostree_server_url>_ with your server URL.
+
* The `OSTREE_COMMIT_REF` variable contains an `rpm-ostree` commit reference that is installed from the server.
+
[source,terminal,subs="+quotes"]
----
$ export OSTREE_COMMIT_REF="_<myostree_commit_reference>_"
----
+
Replace _<myostree_commit_reference>_ with the `rpm-ostree` commit reference.

. Optional. Add the following variable for server authentication:
+
* The `AUTH_CONFIG` contents are copied to `/etc/ostree/auth.json` at the pre-install stage to authenticate access to the `OSTREE_SERVER_URL` server. If no server authentication is required, skip this setting.
+
[source,terminal]
----
$ export AUTH_CONFIG="$(cat ~/.ostree-auth.json)"
----

. Run the following command to create the `kickstart.ks` file to be used during the installation:
+
[source,terminal]
----
envsubst < \
    /usr/share/microshift/kickstart/kickstart-ostree.ks.template > \
    "${HOME}/kickstart.ks"
----
+
[NOTE]
====
The {microshift-short} version specified in the `rpm-ostree` commit is installed. To change the version of {microshift-short}, you must create a new commit.
====
