Hammer cheat sheet
For Satellite 6.2
Hammer is a command-line tool provided with Red Hat Satellite 6. You can use Hammer to configure and manage a Red Hat Satellite Server through either CLI commands or automation in shell scripts. The following cheat sheet provides a condensed overview of essential Hammer commands. See the This content is not included.Hammer CLI Guide for more information on Hammer.
--help |
Display hammer commands and options, append after a subcommand to get more information |
|---|---|
| org | The setting is organization-specific, append --organization org_name, or set default organization with: hammer defaults add --param-name \
organization_id --param-value org_ID
(Satellite 6.2 only) |
| loc | The setting is location-specific, append --location loc_name, or set default loction with: hammer defaults add --param-name location_id \
--param-value loc_ID
(Satellite 6.2 only) |
| Subcommand | Description and Tasks |
|---|---|
organization |
Create an organization hammer organization create \
--name org_name
List organizations |
location |
See the options for organization |
subscriptionorg |
Upload a subscription manifesthammer subscription upload \
--file path |
repository-setorg |
Enable a repositoryhammer repository-set enable \
--product "prod_name" \
--basearch "base_arch" \
--releasever "rel_v" \
--name "repo_name" |
repositoryorg |
Synchronize a repositoryhammer repository synchronize \
--product "prod_name" \
--name "repo_name"
Create a custom repository Upload content to a custom repository |
| Subcommand | Description and Tasks |
|---|---|
lifecycle-environmentorg |
Create a life cycle environmenthammer lifecycle-environment \
create --name env_name \
--description "env_desc" \
--prior prior_env_name
List life cycle environments |
content-vieworg |
Create a content viewhammer content-view create
Add repositories to a content view Add Puppet modules to a content view Publishing a content view Publishing a content view Incremental update of a content view |
| Subcommand | Description and Tasks |
|---|---|
domain |
Create a domainhammer domain create \
--name domain_name
|
subnetorgloc |
Add a subnethammer subnet create \
--name subnet_name \
--organization-ids org_ID1,... \
--location-ids loc_ID1,... \
--domain-ids dom_ID1,... \
--boot-mode boot_mode \
--network network_address \
--mask netmask --ipam ipam
|
compute-resourceorgloc |
Create a compute resourcehammer compute-resource create \
--name cr_name \
--organization-ids org_ID1,...
--location-ids loc_ID1,... \
--provider provider_name
|
medium |
Add an installation mediumhammer medium create \
--name med_name\
--path path_to_medium
|
partition-table |
Add a partition tablehammer partition-table create \
--name tab_name\
--path path_to_file \
--os-family os_family
|
template |
Add a provisioning templatehammer template create \
--name tmp_name\
--file path_to_template
|
os |
Add an operating systemhammer os create --name os_name\
--version version_num
|
| Subcommand | Description and Tasks |
|---|---|
activation-keyorg |
Create an activation keyhammer activation-key create \
--name ak_name \
--content-view cv_n \
--lifecycle-environment lc_name |
Add a subscription to the activation keyhammer activation-key \
add-subscription --id ak_ID \
--subscription-id sub_ID |
| Subcommand | Description and Tasks |
|---|---|
userorg |
Create a userhammer user create --login user_name \
--mail user_mail --auth-source-id 1 \
--organization-ids org_ID1,org_ID2...
Add a role to a user |
user-group |
Create a user grouphammer user-group create \
--name ug_name
Add a role to a user group |
role |
Create a rolehammer role create --name role_name |
filter |
Create a filter and add it to a rolehammer filter create --name role_name \
--permission-ids perm_ID1,perm_ID2... |
| Subcommand | Description and Tasks |
|---|---|
erratum |
List erratahammer erratum list
Find erratum by CVE Inspect erratum |
host |
List errata applicable to a hosthammer host errata list \
--host host_name
Apply errata to a host |
| Subcommand | Description and Tasks |
|---|---|
docker |
Create a containerhammer docker container create \
--name container_name \
--compute-resource-id cr_ID \
--repository-name repo_name \
--tag tag --command command
Start a container |
| Subcommand | Description and Tasks |
|---|---|
hostgrouporgloc |
Create a host grouphammer hostgroup create \
--name "hg_name" \
--environment "env_name" \
--architecture "arch_name" \
--domain domain_name \
--subnet subnet_name \
--puppet-proxy proxy_name \
--puppet-ca-proxy ca-proxy_name \
--operatingsystem "os_name" \
--partition-table "table_name" \
--medium "medium_name" \
--organization-ids org_ID1... \
--location-ids loc_ID1...
Add an activation key to a host group |
hostorgloc |
Create a host (inheriting parameters from a host group)hammer host create
|
job-template |
Add a job template for remote executionhammer job-template create
|
job-invocation |
Invoke a remote jobhammer job-invocation create
Monitor the remote job |
| Subcommand | Description and Tasks |
|---|---|
task |
List all taskshammer task list
Monitor progress of a running task |