Bookmark this page

Guided Exercise: Automate with Activation Keys

Register a system with Satellite Server and configure it for management with Satellite Server by using an activation key.

Outcomes

  • Create an activation key.

  • Unregister and clean a previously registered host.

  • Use an activation key to register a host.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

This command prepares your environment and ensures that all required resources are available.

[student@workstation ~]$ lab start clients-automate

Instructions

  1. Log in to the Satellite Server web UI, https://satellite.lab.example.com, as the admin user with redhat as the password.

  2. In the upper-left corner of the web page, set the organization to Operations. Set the location to Any Location.

  3. Create an activation key for registering clients to the Operations organization.

    1. Click ContentActivation Keys, and then click Create Activation Key.

    2. Enter OperationsServers in the Name field.

    3. Select the Unlimited Hosts checkbox.

    4. Select the Development environment.

    5. Select the OperationsServerBase content view, and then click Save.

  4. Set the release version for the content host.

    1. On the OperationsServers page, click the Details tab.

    2. In the Activation Key Content section, select 9 from the Release Version list, and then click Save.

  5. Assign the OpsServers host collection to the activation key.

    1. On the OperationsServers page, click the Host Collections tab. Click the Add tab.

    2. Select the OpsServers checkbox, and then click Add Selected.

  6. Prepare the product content by enabling the RHEL 9 repositories and disabling the RHEL 8 repositories.

    Note

    Hosts that are registered to the Operations organization use Simple Content Access subscription management. Activation keys for SCA-enabled organizations do not need to specify subscriptions to attach to the host during registration.

    1. On the OperationsServers page, click the Repository Sets tab. View the Status column for each of the listed repositories.

      Verify that the following RHEL 9 repositories are already enabled.

      • Red Hat Enterprise Linux 9 x86_64 - AppStream (RPMs)

      • Red Hat Enterprise Linux 9 x86_64 - BaseOS (RPMs)

    2. Enable the following additional RHEL 9 repository. Select the checkbox for the repository, and then select Override to Enabled from the Select Action list.

      • Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)

    3. Disable the following RHEL 8 repositories. Select the checkboxes for both repositories, and then select Override to Disabled from the Select Action list.

      • Red Hat Enterprise Linux 8 x86_64 - AppStream (RPMs)

      • Red Hat Enterprise Linux 8 x86_64 - BaseOS (RPMs)

  7. Prepare the serverc system for registration to Satellite Server with the OperationsServers activation key. The serverc system is currently registered to the Marketing organization. You are reassigning the serverc system to the Operations organization.

    1. On workstation, log in to the serverc system as the student user and switch to the root user.

      [student@workstation ~]$ ssh student@serverc
      [student@serverc ~]$ sudo -i
      [sudo] password for student: student
      [root@serverc ~]#
    2. View the current subscription UUID for the serverc system as a content host in the Marketing organization. The entitlement mode indicates legacy per-client subscription management.

      [root@serverc ~]# cat /var/lib/rhsm/cache/content_access_mode.json | python -m \
      json.tool
      {
          "0d8eef75-9ba3-420c-b344-8ae0a78a9770": "entitlement"
      }
    3. Remove the Satellite Server registration and entitlements from the serverc system.

      [root@serverc ~]# dnf clean all
      Updating Subscription Management repositories.
      16 files removed
      [root@serverc ~]# rm -rf /var/cache/dnf/
      [root@serverc ~]# subscription-manager remove --all
      2 local certificates have been deleted.
      2 subscriptions removed at the server.
      [root@serverc ~]# subscription-manager unregister
      Unregistering from: satellite.lab.example.com:443/rhsm
      System has been unregistered.
      [root@serverc ~]# subscription-manager clean
      All local data removed
  8. In the web UI, assign the existing serverc host resource to the Operations organization. By migrating the host, the serverc host resource can keep its activity history.

    1. In the upper-left corner of the web page, set the organization to Marketing. Set the location to Any Location.

    2. Click HostsAll Hosts. Select the checkbox for the serverc.lab.example.com host, and then select Assign Organization from the Select Action list.

    3. Select Operations in the Select Organization list. Select Fix Organization on Mismatch, and then click Submit. The page refreshes and notifies you that the current organization does not have any visible hosts.

  9. On the serverc system, register the host to Satellite Server by using the OperationsServer activation key.

    1. Verify that the latest consumer RPM, katello-ca-consumer-latest.noarch.rpm, is installed.

      [root@serverc ~]# dnf localinstall \
      http://satellite.lab.example.com/pub/katello-ca-consumer-latest.noarch.rpm
      Updating Subscription Management repositories.
      Unable to read consumer identity
      
      This system is not registered with an entitlement server. You can use subscription-manager to register.
      
      katello-ca-consumer-latest.noarch.rpm                                                                                       2.2 MB/s | 9.9 kB     00:00
      Package katello-ca-consumer-satellite.lab.example.com-1.0-1.noarch is already installed.
      Dependencies resolved.
      Nothing to do.
      Complete!
    2. Register the system to the Operations organization by using the OperationsServer activation key.

      [root@serverc ~]# subscription-manager register \
      --org Operations \
      --activationkey OperationsServers
      The system has been registered with ID: 3244ed9d-ce23-4a2a-a39d-112324d84b3c
      The registered system name is: serverc.lab.example.com
    3. View the changed subscription UUID for the serverc system as a content host in the Operations organization. The org_environment mode indicates that Simple Content Access is enabled.

      [root@serverc ~]# cat /var/lib/rhsm/cache/content_access_mode.json | python -m \
      json.tool
      {
          "3244ed9d-ce23-4a2a-a39d-112324d84b3c": "org_environment"
      }
    4. Install the Katello agent on the content host.

      [root@serverc ~]# dnf install katello-agent
      Updating Subscription Management repositories.
      ...output omitted...
      Is this ok [y/N]: y
      ...output omitted...
      Complete!
    5. Return to the workstation system as the student user.

      [root@serverc ~]# exit
      logout
      [student@serverc ~]$ exit
      logout
      Connection to serverc closed.
      [student@workstation ~]$
  10. In the web UI, verify that the serverc host is in the Operations organization with the new subscription UUID.

    1. In the upper-left corner of the web page, set the organization to Operations. Set the location to Any Location.

    2. Click HostsContent Hosts. Click the serverc.lab.example.com link.

    3. On the Details tab, verify that the Subscription UUID matches the UUID that you queried from the serverc system. In the Content Host Content section, verify that the Release Version is 9. In the Subscriptions section, verify that the Subscription Status is Simple Content Access.

    4. On the Host Collections tab, verify that the system is a member of the OpsServers host collection.

    5. On the Repository Sets tab, verify that the Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs) repository is enabled.

Finish

On the workstation machine, change to the student user home directory and use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish clients-automate

Revision: rh403-6.11-3ad886e