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
Log in to the Satellite Server web UI, https://satellite.lab.example.com, as admin with redhat as the password.
In the upper-left corner of the web page, set the organization to Operations.
Set the location to Any Location.
Create the OpsServers host collection.
Click → and then click .
Enter OpsServers in the field.
Verify that the checkbox is selected.
Enter Operations server systems in the field, and then click .
Add a registered host to the OpsServers host collection.
Click the tab and then click the tab.
Select the servera.lab.example.com checkbox, and then click .
Click the tab to verify that servera.lab.example.com is listed as a member of the OpsServers host collection.
Using the hammer command, verify that the OpsServers host collection is created and that servera.lab.example.com belongs to the host collection.
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 ~]#
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
---|------------|-------|--------------------------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
---|------------------------Install the redis package by using the OpsServers host collection.
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.
In the Satellite web UI, click → and click .
Click .
In the text box, enter redis and click .
Wait until the web page refreshes.
Verify the installation succeeded.
In the terminal, return to the workstation system as the student user.
[root@satellite ~]#exitlogout [student@satellite ~]$exitlogout [student@workstation ~]$
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 ~]#
Verify that the redis package is installed.
[root@servera ~]# redis-cli --version
redis-cli 6.2.6Return to the workstation system as the student user.
[root@servera ~]#exitlogout [student@servera ~]$exitlogout [student@workstation ~]$