diff --git a/agent/06_agent_create_cluster.sh b/agent/06_agent_create_cluster.sh index af5ecf27c..5609563f6 100755 --- a/agent/06_agent_create_cluster.sh +++ b/agent/06_agent_create_cluster.sh @@ -23,9 +23,28 @@ function create_pxe_files() { function create_image() { local asset_dir=${1} local openshift_install=${2} + + if [ "${AGENT_USE_APPLIANCE_MODEL}" == true ]; then + create_factory_image + else + create_automated_image + fi +} + +function create_automated_image() { "${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create image } +function create_factory_image() { + "${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create cluster-manifests + "${openshift_install}" --dir="${asset_dir}" --log-level=debug agent create unconfigured-ignition + oc adm release info --image-for=machine-os-images --insecure=true $OPENSHIFT_RELEASE_IMAGE + base_iso_url=$(oc adm release info --image-for=machine-os-images --insecure=true $OPENSHIFT_RELEASE_IMAGE) + oc image extract --path /coreos/coreos-x86_64.iso:$HOME/.cache/agent/image_cache --confirm $base_iso_url + local agent_iso_abs_path="$(realpath "${OCP_DIR}")" + podman run --privileged --rm -v /run/udev:/run/udev -v "${agent_iso_abs_path}:${agent_iso_abs_path}" -v "$HOME/.cache/agent/image_cache/:$HOME/.cache/agent/image_cache/" quay.io/coreos/coreos-installer:release iso ignition embed -f -i "${agent_iso_abs_path}/unconfigured-agent.ign" -o "${agent_iso_abs_path}/agent.iso" $HOME/.cache/agent/image_cache/coreos-x86_64.iso +} + function attach_agent_iso() { # This is required to allow qemu opening the disk image diff --git a/agent/common.sh b/agent/common.sh index 09458c830..8ab346720 100644 --- a/agent/common.sh +++ b/agent/common.sh @@ -27,3 +27,5 @@ function getReleaseImage() { fi echo ${releaseImage} } + +export AGENT_USE_APPLIANCE_MODEL=${AGENT_USE_APPLIANCE_MODEL:-"false"} \ No newline at end of file diff --git a/config_example.sh b/config_example.sh index e686643a0..072d38490 100755 --- a/config_example.sh +++ b/config_example.sh @@ -693,3 +693,9 @@ set -x # As per https://libvirt.org/formatnetwork.html, the tftp element is not supported for IPv6 addresses, # and can only be specified on a single IPv4 address per network # AGENT_E2E_TEST_BOOT_MODE=PXE + +# Uncomment the following line to deploy the cluster using the appliance model +# The appliance model boots the host using the unconfigured ignition. It then mounts +# the configuration ISO where its contents are copied over to the host. The cluster +# installation is triggered when the /etc/assisted/rendezvous-host.env file is present. +# export AGENT_USE_APPLIANCE_MODEL=false