이 콘텐츠는 선택한 언어로 제공되지 않습니다.
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 링크 복사링크가 클립보드에 복사되었습니다!
Before you start reading the Hammer cheat sheet, familiarize yourself with the following information.
- 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
hammer defaults add \ --param-name organization_id \ --param-value org_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
hammer defaults add \ --param-name location_id \ --param-value loc_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Organizations, locations, and repositories 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| Create an organization: hammer organization create \ --name org_name
List organizations: hammer organization list
|
|
| See the options for organization |
|
| Upload a subscription manifest: hammer subscription upload \ --file path
|
|
| Enable a repository: hammer repository-set enable \ --product prod_name \ --basearch base_arch \ --releasever rel_v \ --name repo_name
|
|
| Synchronize a repository: hammer repository synchronize \ --product prod_name \ --name repo_name
Create a custom repository: Upload content to a custom repository: hammer repository upload-content \ --product prod_name \ --id repo_id \ --path path_to_dir
|
10.3. Content life cycles 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| Create a life cycle environment: hammer lifecycle-environment create \ --name env_name --description env_desc --prior prior_env_name
List life cycle environments: hammer lifecycle-environment list
|
|
| Create a content view: hammer content-view create \ --name cv_n \ --repository-ids repo_ID1,... \ --description cv_description
Add repositories to a content view: hammer content-view add-repository \ --name cv_n \ --repository-id repo_ID
Add Puppet modules to a content view: hammer content-view puppet-module add \ --content-view cv_n \ --name module_name
Publishing a content view: hammer content-view publish \ --id cv_ID
Promoting a content view: hammer content-view version promote \ --content-view cv_n \ --to-lifecycle-environment env_name
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,...
|
10.4. Provisioning environments 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| Create a domain: hammer domain create \ --name domain_name
|
| Add a subnet: | |
|
| Create a compute resource: hammer compute-resource create \ --name cr_name \ --organization-ids org_ID1,... \ --location-ids loc_ID1,... \ --provider provider_name
|
|
| Add an installation medium: hammer medium create \ --name med_name \ --path path_to_medium
|
|
| Add a partition table: hammer partition-table create \ --name tab_name \ --path path_to_file \ --os-family os_family
|
|
| Add a provisioning template: hammer template create \ --name tmp_name \ --file path_to_template
|
|
| Add an operating system: hammer os create \ --name os_name \ --version version_num
|
10.5. Activation keys 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| Create an activation key: hammer activation-key create \ --name ak_name \ --content-view cv_n \ --lifecycle-environment lc_name
Add a subscription to the activation key: hammer activation-key add-subscription \ --id ak_ID \ --subscription-id sub_ID
|
10.6. Users and permissions 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
| Create a user: hammer user create \ --login user_name \ --mail user_mail \ --auth-source-id 1 \ --organization-ids org_ID1,org_ID2,...
Add a role to a user: hammer user add-role \ --id user_id \ --role role_name
| |
|
| Create a user group: hammer user-group create \ --name ug_name
Add a role to a user group: hammer user-group add-role \ --id ug_id \ --role role_name
|
|
| Create a role: hammer role create \ --name role_name
|
|
| Create a filter and add it to a role: hammer filter create \ --role role_name \ --permission-ids perm_ID1,perm_ID2,...
|
10.7. Errata 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| List errata: hammer erratum list
Find erratum by CVE: hammer erratum list --cve CVE
Inspect erratum: hammer erratum info --id err_ID
|
|
| List errata applicable to a host: hammer host errata list \ --host host_name
Apply errata to a host: hammer host errata apply \ --host host_name \ --errata-ids err_ID1,err_ID2,...
|
10.8. Hosts 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
| Create a host group: Add an activation key to a host group: hammer hostgroup set-parameter \ --hostgroup "hg_name" \ --name "kt_activation_keys" \ --value key_name
| |
| Create a host (inheriting parameters from a host group): Remove the host from host group: hammer host update --name host_name --hostgroup NIL
| |
|
| Add a job template for remote execution: hammer job-template create \ --file path \ --name template_name \ --provider-type SSH \ --job-category category_name
|
|
| Start a remote job: hammer job-invocation create \ --job-template template_name \ --inputs key1=value,... \ --search-query query
Monitor the remote job: hammer job-invocation output \ --id job_id --host host_name
|
10.9. Tasks 링크 복사링크가 클립보드에 복사되었습니다!
| Subcommand | Description and tasks |
|---|---|
|
| List all tasks: hammer task list Monitor progress of a running task: hammer task progress \ --id task_ID
|