Bookmark this page

Guided Exercise: Manage Hosts with Host Collections

Create a host collection and assign registered hosts to that host collection.

Outcomes

  • Create a host collection.

  • Add a host to a host collection.

  • Use the hammer utility to display the host and host collection.

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-collections

Instructions

  1. Log in to the Satellite Server web UI, https://satellite.lab.example.com, as admin 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 the OpsServers host collection.

    1. Click HostsHost Collections and then click Create Host Collection.

    2. Enter OpsServers in the Name field.

    3. Verify that the Unlimited Hosts checkbox is selected.

    4. Enter Operations server systems in the Description field, and then click Save.

  4. Add a registered host to the OpsServers host collection.

    1. Click the Hosts tab and then click the Add tab.

    2. Select the servera.lab.example.com checkbox, and then click Add Selected.

    3. Click the List/Remove tab to verify that servera.lab.example.com is listed as a member of the OpsServers host collection.

  5. Using the hammer command, verify that the OpsServers host collection is created and that servera.lab.example.com belongs to the host collection.

    1. Log in to the satellite system as the student user and switch to the root user.

      [student@workstation ~]$ ssh student@satellite
      [student@satellite ~]$ sudo -i
      [sudo] password for student: student
      [root@satellite ~]#
    2. List the host collection in the Operations organization.

      [root@satellite ~]# hammer host-collection list \
      --organization Operations
      ---|------------|-------|--------------------------
      ID | NAME       | LIMIT | DESCRIPTION
      ---|------------|-------|--------------------------
      1  | OpsServers | None  | Operations server systems
      ---|------------|-------|--------------------------
    3. List the hosts from the OpsServers host collection and the Operations organization.

      [root@satellite ~]# hammer host-collection hosts \
      --name OpsServers \
      --organization Operations
      ---|------------------------
      ID | NAME
      ---|------------------------
      2  | servera.lab.example.com
      ---|------------------------
  6. Install the redis package by using the OpsServers host collection.

    Note

    Although installing single packages by using manual methods is not scalable, this example demonstrates an ad hoc use for a host collection. The recommended practice is to use content views to manage package installation.

    1. In the Satellite web UI, click HostsHost Collections and click OpsServers.

    2. Click Package Installation, Removal, and Update.

    3. In the Package Name text box, enter redis and click Install.

    4. Wait until the web page refreshes.

  7. Verify the installation succeeded.

    1. In the terminal, return to the workstation system as the student user.

      [root@satellite ~]# exit
      logout
      [student@satellite ~]$ exit
      logout
      [student@workstation ~]$
    2. Log in to the servera system as the student user, and switch to the root user.

      [student@workstation ~]$ ssh student@servera
      [student@servera ~]$ sudo -i
      [sudo] password for student: student
      [root@servera ~]#
    3. Verify that the redis package is installed.

      [root@servera ~]# redis-cli --version
      redis-cli 6.2.6
    4. Return to the workstation system as the student user.

      [root@servera ~]# exit
      logout
      [student@servera ~]$ exit
      logout
      [student@workstation ~]$

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-collections

Revision: rh403-6.11-3ad886e