// Module included in the following assemblies:
//
// * machine_management/user_provisioned/adding-rhel-compute.adoc
// * machine_management/user_provisioned/more-rhel-compute.adoc
// * post_installation_configuration/node-tasks.adoc

[id="rhel-preparing-node_{context}"]
= Preparing a RHEL compute node

Before you add a Red Hat Enterprise Linux (RHEL) machine to your {product-title}
cluster, you must register each host with Red Hat
Subscription Manager (RHSM), attach an active {product-title} subscription, and
enable the required repositories.

. On each host, register with RHSM:
+
[source,terminal]
----
# subscription-manager register --username=<user_name> --password=<password>
----

. Pull the latest subscription data from RHSM:
+
[source,terminal]
----
# subscription-manager refresh
----

. List the available subscriptions:
+
[source,terminal]
----
# subscription-manager list --available --matches '*OpenShift*'
----

. In the output for the previous command, find the pool ID for an {product-title} subscription and attach it:
+
[source,terminal]
----
# subscription-manager attach --pool=<pool_id>
----

. Disable all yum repositories:
.. Disable all the enabled RHSM repositories:
+
[source,terminal]
----
# subscription-manager repos --disable="*"
----

.. List the remaining yum repositories and note their names under `repo id`, if any:
+
[source,terminal]
----
# yum repolist
----

.. Use `yum-config-manager` to disable the remaining yum repositories:
+
[source,terminal]
----
# yum-config-manager --disable <repo_id>
----
+
Alternatively, disable all repositories:
+
[source,terminal]
----
# yum-config-manager --disable \*
----
+
Note that this might take a few minutes if you have a large number of available repositories

. Enable only the repositories required by {product-title} {product-version}:
+
[source,terminal]
----
# subscription-manager repos \
    --enable="rhel-7-server-rpms" \
    --enable="rhel-7-fast-datapath-rpms" \
    --enable="rhel-7-server-extras-rpms" \
    --enable="rhel-7-server-optional-rpms" \
    --enable="rhel-7-server-ose-4.6-rpms"
----

. Stop and disable firewalld on the host:
+
[source,terminal]
----
# systemctl disable --now firewalld.service
----
+
[NOTE]
====
You must not enable firewalld later. If you do, you cannot access {product-title} logs on the worker.
====
