Chapter 10. Hammer cheat sheet
Hammer is a command-line tool provided with Red Hat Satellite 6. You can use Hammer to configure and manage a Satellite Server by using either CLI commands or shell script automation. Run hammer full-help on Satellite to view the complete Hammer CLI help.
10.1. General information Copy linkLink copied to clipboard!
Review essential information for using Hammer CLI in Red Hat Satellite. There are certain options that apply to all commands, such as authentication and getting help.
- Authentication in examples
-
This cheat sheet assumes saved credentials in
~/.hammer/cli_config.yml. For more information, see Chapter 3, Hammer authentication. --help- Displays Hammer commands and options. You can append it after a subcommand to get more information.
- organization-specific
The command requires you to specify an organization. You can append
--organization My_Organizationto the command or set a default organization:hammer defaults add \ --param-name organization_id \ --param-value org_ID- location-specific
The command requires you to specify a location. You can append
--location My_Locationto the command or set a default location:hammer defaults add \ --param-name location_id \ --param-value loc_ID
10.2. Organizations, locations, and repositories Copy linkLink copied to clipboard!
You can manage organizations, locations, and repositories in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| Create an organization:
List organizations:
|
|
| See the options for organization |
|
| Upload a subscription manifest:
|
|
| Enable a repository:
|
|
| Synchronize a repository:
Create a custom repository:
Upload content to a custom repository:
|
10.3. Content life cycles Copy linkLink copied to clipboard!
You can manage content views in lifecycle environments in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| Create a life cycle environment:
List life cycle environments:
|
|
| Create a content view:
Add repositories to a content view:
Add Puppet modules to a content view:
Publishing a content view:
Promoting a content view:
Incremental update of a content view:
|
10.4. Provisioning environments Copy linkLink copied to clipboard!
You can prepare provisioning infrastructure in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| Create a domain:
|
| Add a subnet:
| |
|
| Create a compute resource:
|
|
| Add an installation medium:
|
|
| Add a partition table:
|
|
| Add a provisioning template:
|
|
| Add an operating system:
|
10.5. Activation keys Copy linkLink copied to clipboard!
You can create activation keys and add subscriptions in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| Create an activation key:
Add a subscription to the activation key:
|
10.6. Users and permissions Copy linkLink copied to clipboard!
You can manage users, user groups, roles, and filters in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
| Create a user:
Add a role to a user:
| |
|
| Create a user group:
Add a role to a user group:
|
|
| Create a role:
|
|
| Create a filter and add it to a role:
|
10.7. Errata Copy linkLink copied to clipboard!
You can manage security updates and patches in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| List errata:
Find erratum by CVE:
Inspect erratum:
|
|
| List errata applicable to a host:
Apply errata to a host:
|
10.8. Hosts Copy linkLink copied to clipboard!
You can manage hosts, host groups, and remote job execution in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
| Create a host group:
Add an activation key to a host group:
| |
| Create a host (inheriting parameters from a host group):
Remove the host from host group:
| |
|
| Add a job template for remote execution:
|
|
| Start a remote job:
Monitor the remote job:
|
10.9. Tasks Copy linkLink copied to clipboard!
You can list tasks and monitor their progress in Red Hat Satellite by using Hammer CLI commands.
| Subcommand | Description and tasks |
|---|---|
|
| List all tasks:
Monitor progress of a running task:
|