// Module included in the following assemblies:
//
// * installing/installing_aws/installing-aws-government-region.adoc
// * installing/installing_aws/installing-aws-secret-region.adoc
// * installing/installing_aws/installing-aws-private.adoc
// * installing/installing_azure/installing-azure-government-region.adoc
// * installing/installing_azure/installing-azure-private.adoc
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-user-infra.adoc
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-default.adoc
// * installing/installing_bare_metal/installing-bare-metal.adoc
// * installing/installing_gcp/installing-gcp-private.adoc
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
// * installing/installing_platform_agnostic/installing-platform-agnostic.adoc
// * installing/installing_vmc/installing-restricted-networks-vmc-user-infra.adoc
// * installing/installing_vmc/installing-vmc-user-infra.adoc
// * installing/installing_vmc/installing-vmc-network-customizations-user-infra.adoc
// * installing/installing_vsphere/installing-restricted-networks-vsphere.adoc
// * installing/installing_vsphere/installing-vsphere.adoc
// * installing/installing_vsphere/installing-vsphere-network-customizations.adoc
// * installing/installing_ibm_z/installing-ibm-z.adoc

ifeval::["{context}" == "installing-azure-government-region"]
:azure-gov:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:ash:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-vsphere"]
:restricted:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-vmc-user-infra"]
:restricted:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-bare-metal"]
:restricted:
endif::[]
ifeval::["{context}" == "installing-aws-china-region"]
:aws-china:
endif::[]
ifeval::["{context}" == "installing-aws-government-region"]
:aws-gov:
endif::[]
ifeval::["{context}" == "installing-aws-secret-region"]
:aws-secret:
endif::[]
ifeval::["{context}" == "installing-aws-private"]
:aws-private:
endif::[]
ifeval::["{context}" == "installing-azure-private"]
:azure-private:
endif::[]
ifeval::["{context}" == "installing-gcp-private"]
:gcp-private:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-default"]
:ash-default:
endif::[]

:_content-type: PROCEDURE
[id="installation-initializing-manual_{context}"]
= Manually creating the installation configuration file

ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,ash-default[]
For user-provisioned installations of {product-title}, you manually generate your installation configuration file.
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,ash-default[]
ifdef::aws-china,aws-gov,aws-secret[]
Installing the cluster requires that you manually generate the installation configuration file.
//Made this update as part of feedback in PR3961. tl;dr Simply state you have to create the config file, instead of creating a number of conditions to explain why.
endif::aws-china,aws-gov,aws-secret[]
ifdef::azure-gov[]
When installing {product-title} on Microsoft Azure into a government region, you
must manually generate your installation configuration file.
endif::azure-gov[]
ifdef::aws-private,azure-private,gcp-private[]
For installations of a private {product-title} cluster that are only accessible from an internal network and are not visible to the internet, you must manually generate your installation configuration file.
endif::aws-private,azure-private,gcp-private[]
ifdef::ash-default[]
When installing {product-title} on Microsoft Azure Stack Hub, you must manually create your installation configuration file.
endif::ash-default[]

.Prerequisites

ifdef::aws-china,aws-secret[]
* You have uploaded a custom RHCOS AMI.
endif::aws-china,aws-secret[]
* You have an SSH public key on your local machine to provide to the installation program. The key will be used for SSH authentication onto your cluster nodes for debugging and disaster recovery.
* You have obtained the {product-title} installation program and the pull secret for your
cluster.
ifdef::restricted[]
* Obtain the `imageContentSources` section from the output of the command to
mirror the repository.
* Obtain the contents of the certificate for your mirror registry.
endif::restricted[]

.Procedure

. Create an installation directory to store your required installation assets in:
+
[source,terminal]
----
$ mkdir <installation_directory>
----
+
[IMPORTANT]
====
You must create a directory. Some installation assets, like bootstrap X.509
certificates have short expiration intervals, so you must not reuse an
installation directory. If you want to reuse individual files from another
cluster installation, you can copy them into your directory. However, the file
names for the installation assets might change between releases. Use caution
when copying installation files from an earlier {product-title} version.
====

. Customize the sample `install-config.yaml` file template that is provided and save
it in the `<installation_directory>`.
+
[NOTE]
====
You must name this configuration file `install-config.yaml`.
====
ifdef::restricted[]
** Unless you use a registry that {op-system} trusts by default, such as
`docker.io`, you must provide the contents of the certificate for your mirror
repository in the `additionalTrustBundle` section. In most cases, you must
provide the certificate for your mirror.
** You must include the `imageContentSources` section from the output of the command to
mirror the repository.
endif::restricted[]
+

ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default[]
[NOTE]
====
For some platform types, you can alternatively run `./openshift-install create install-config --dir <installation_directory>` to generate an `install-config.yaml` file. You can provide details about your cluster configuration at the prompts.
====
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default[]
ifdef::ash[]
+
Make the following modifications for Azure Stack Hub:

.. Set the `replicas` parameter to `0` for the `compute` pool:
+
[source,yaml]
----
compute:
- hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 0 <1>
----
<1> Set to `0`.
+
The compute machines will be provisioned manually later.

.. Update the `platform.azure` section of the `install-config.yaml` file to configure your Azure Stack Hub configuration:
+
[source,yaml]
----
platform:
  azure:
    armEndpoint: <azurestack_arm_endpoint> <1>
    baseDomainResourceGroupName: <resource_group> <2>
    cloudName: AzureStackCloud <3>
    region: <azurestack_region> <4>
----
<1> Specify the Azure Resource Manager endpoint of your Azure Stack Hub environment, like `\https://management.local.azurestack.external`.
<2> Specify the name of the resource group that contains the DNS zone for your base domain.
<3> Specify the Azure Stack Hub environment, which is used to configure the Azure SDK with the appropriate Azure API endpoints.
<4> Specify the name of your Azure Stack Hub region.
endif::ash[]

ifdef::ash-default[]
+
Make the following modifications:

.. Specify the required installation parameters.

.. Update the `platform.azure` section to specify the parameters that are specific to Azure Stack Hub.

.. Optional: Update one or more of the default configuration parameters to customize the installation.
+
For more information about the parameters, see "Installation configuration parameters".
endif::ash-default[]

. Back up the `install-config.yaml` file so that you can use it to install
multiple clusters.
+
[IMPORTANT]
====
The `install-config.yaml` file is consumed during the next step of the
installation process. You must back it up now.
====

ifeval::["{context}" == "installing-azure-government-region"]
:!azure-gov:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-user-infra"]
:!ash:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-vsphere"]
:!restricted:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-vmc-user-infra"]
:!restricted:
endif::[]
ifeval::["{context}" == "installing-restricted-networks-bare-metal"]
:!restricted:
endif::[]
ifeval::["{context}" == "installing-aws-china-region"]
:!aws-china:
endif::[]
ifeval::["{context}" == "installing-aws-government-region"]
:!aws-gov:
endif::[]
ifeval::["{context}" == "installing-aws-secret-region"]
:!aws-secret:
endif::[]
ifeval::["{context}" == "installing-aws-private"]
:!aws-private:
endif::[]
ifeval::["{context}" == "installing-azure-private"]
:!azure-private:
endif::[]
ifeval::["{context}" == "installing-gcp-private"]
:!gcp-private:
endif::[]
ifeval::["{context}" == "installing-azure-stack-hub-default"]
:!ash-default:
endif::[]
