此内容没有您所选择的语言版本。

Hammer Cheat Sheet


Red Hat Satellite 6.6

Hammer CLI Cheat Sheet for Red Hat Satellite

Red Hat Satellite Documentation Team

Abstract

This document contains Hammer CLI commands for Red Hat Satellite 6.6.

Chapter 1. Introduction

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 by using either CLI commands or shell script automation. The following cheat sheet provides a condensed overview of essential Hammer commands.

For more information about Hammer, see the Red Hat Hammer CLI Guide.

Chapter 2. General Information

Expand
Table 2.1. General Information
SubcommandDescription and tasks

--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
Copy to Clipboard Toggle word wrap

loc

The setting is location-specific, append --location loc_name, or set default location with:

hammer defaults add \
--param-name location_id \
--param-value loc_ID
Copy to Clipboard Toggle word wrap

Note: This cheat sheet assumes saved credentials in ~/.hammer/cli_config.yml. For more information, see Authentication in the Red Hat Hammer CLI Guide.

Chapter 3. Organizations, Locations, and Repositories

Expand
Table 3.1. Organizations, Locations, and Repositories
SubcommandDescription and tasks

organization

Create an organization:

hammer organization create \
--name org_name
Copy to Clipboard Toggle word wrap

List organizations:

hammer organization list
Copy to Clipboard Toggle word wrap

location

See the options for organization

subscription
org

Upload a subscription manifest:

hammer subscription upload \
--file path
Copy to Clipboard Toggle word wrap

repository-set
org

Enable a repository:

hammer repository-set enable \
--product prod_name \
--basearch base_arch \
--releasever rel_v \
--name repo_name
Copy to Clipboard Toggle word wrap

repository
org

Synchronize a repository:

hammer repository synchronize \
--product prod_name \
--name repo_name
Copy to Clipboard Toggle word wrap

Create a custom repository:

hammer repository create \
--product prod_name \
--content-type cont_type \
--publish-via-http true \
--url repo_url \
--name repo_name
Copy to Clipboard Toggle word wrap

Upload content to a custom repository:

hammer repository upload-content \
--product prod_name \
--id repo_id \
--path path_to_dir
Copy to Clipboard Toggle word wrap

Chapter 4. Content Life Cycles

Expand
Table 4.1. Content Life Cycles
SubcommandDescription and tasks

lifecycle-environment
org

Create a life cycle environment:

hammer lifecycle-environment create \
--name env_name
--description env_desc
--prior prior_env_name
Copy to Clipboard Toggle word wrap

List life cycle environments:

hammer lifecycle-environment list
Copy to Clipboard Toggle word wrap

content-view
org

Create a content view:

hammer content-view create \
--name cv_n \
--repository-ids repo_ID1,... \
--description cv_description
Copy to Clipboard Toggle word wrap

Add repositories to a content view:

hammer content-view add-repository \
--name cv_n \
--repository-id repo_ID
Copy to Clipboard Toggle word wrap

Add Puppet modules to a content view:

hammer content-view puppet-module add \
--content-view cv_n \
--name module_name
Copy to Clipboard Toggle word wrap

Publishing a content view:

hammer content-view publish \
--id cv_ID
Copy to Clipboard Toggle word wrap

Promoting a content view:

hammer content-view version promote \
--content-view cv_n \
--to-lifecycle-environment env_name
Copy to Clipboard Toggle word wrap

Incremental update of a content view:

hammer content-view version incremental-update \
--content-view-version-id cv_ID \
--packages pkg_n1,... \
--lifecycle-environment-ids env_ID1,...
Copy to Clipboard Toggle word wrap

Chapter 5. Provisioning Environments

Expand
Table 5.1. Provisioning Environments
SubcommandDescription and tasks

domain

Create a domain:

hammer domain create \
--name domain_name
Copy to Clipboard Toggle word wrap

subnet
org
loc

Add a subnet:

hammer 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
Copy to Clipboard Toggle word wrap

compute-resource
org
loc

Create a compute resource:

hammer compute-resource create \
--name cr_name \
--organization-ids org_ID1,... \
--location-ids loc_ID1,... \
--provider provider_name
Copy to Clipboard Toggle word wrap

medium

Add an installation medium:

hammer medium create \
--name med_name \
--path path_to_medium
Copy to Clipboard Toggle word wrap

partition-table

Add a partition table:

hammer partition-table create \
--name tab_name \
--path path_to_file \
--os-family os_family
Copy to Clipboard Toggle word wrap

template

Add a provisioning template:

hammer template create \
--name tmp_name \
--file path_to_template
Copy to Clipboard Toggle word wrap

os

Add an operating system:

hammer os create \
--name os_name \
--version version_num
Copy to Clipboard Toggle word wrap

Chapter 6. Activation Keys

Expand
Table 6.1. Activation Keys
SubcommandDescription and tasks

activation-key
org

Create an activation key:

hammer activation-key create \
--name ak_name \
--content-view cv_n \
--lifecycle-environment lc_name
Copy to Clipboard Toggle word wrap

Add a subscription to the activation key:

hammer activation-key add-subscription \
--id ak_ID \
--subscription-id sub_ID
Copy to Clipboard Toggle word wrap

Chapter 7. Users and Permissions

Expand
Table 7.1. Users and Permissions
SubcommandDescription and tasks

user
org

Create a user:

hammer user create \
--login user_name \
--mail user_mail \
--auth-source-id 1 \
--organization-ids org_ID1,org_ID2,...
Copy to Clipboard Toggle word wrap

Add a role to a user:

hammer user add-role \
--id user_id \
--role role_name
Copy to Clipboard Toggle word wrap

user-group

Create a user group:

hammer user-group create \
--name ug_name
Copy to Clipboard Toggle word wrap

Add a role to a user group:

hammer user-group add-role \
--id ug_id \
--role role_name
Copy to Clipboard Toggle word wrap

role

Create a role:

hammer role create \
--name role_name
Copy to Clipboard Toggle word wrap

filter

Create a filter and add it to a role:

hammer filter create \
--role role_name \
--permission-ids perm_ID1,perm_ID2,...
Copy to Clipboard Toggle word wrap

Chapter 8. Errata

Expand
Table 8.1. Errata
SubcommandDescription and tasks

erratum

List errata:

hammer erratum list
Copy to Clipboard Toggle word wrap

Find erratum by CVE:

hammer erratum list --cve CVE
Copy to Clipboard Toggle word wrap

Inspect erratum:

hammer erratum info --id err_ID
Copy to Clipboard Toggle word wrap

host

List errata applicable to a host:

hammer host errata list \
--host host_name
Copy to Clipboard Toggle word wrap

Apply errata to a host:

hammer host errata apply \
--host host_name \
--errata-ids err_ID1,err_ID2,...
Copy to Clipboard Toggle word wrap

Chapter 9. Hosts

Expand
Table 9.1. Hosts
SubcommandDescription and tasks

hostgroup
org
loc

Create a host group:

hammer hostgroup create \
--name hg_name \
--puppet-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,...
Copy to Clipboard Toggle word wrap

Add an activation key to a host group:

hammer hostgroup set-parameter \
--hostgroup "hg_name" \
--name "kt_activation_keys" \
--value key_name
Copy to Clipboard Toggle word wrap

host
org
loc

Create a host (inheriting parameters from a host group):

hammer host create \
--name host_name \
--hostgroup hg_name \
--interface="primary=true, \
mac=mac_addr, ip=ip_addr, \
provision=true" \
--organization-id org_ID \
--location-id loc_ID \
--ask-root-password yes
Copy to Clipboard Toggle word wrap

job-template

Add a job template for remote execution:

hammer job-template create \
--file path \
--name template_name \
--provider-type SSH \
--job-category category_name
Copy to Clipboard Toggle word wrap

job-invocation

Invoke a remote job:

hammer job-invocation create \
--job-template template_name \
--inputs key1=value,... \
--search-query query
Copy to Clipboard Toggle word wrap

Monitor the remote job:

hammer job-invocation output \
--id job_id --host host_name
Copy to Clipboard Toggle word wrap

Chapter 10. Tasks

Expand
Table 10.1. Tasks
SubcommandDescription and tasks

task

List all tasks:

hammer task list
Monitor progress of a running task:
hammer task progress \
--id task_ID
Copy to Clipboard Toggle word wrap

Legal Notice

Copyright © 2019 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat