Chapter 2. Hammer cheat sheet 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. 2.1. General information Subcommand Description 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: loc The setting is location-specific, append --location loc_name , or set default location with: Note: This cheat sheet assumes saved credentials in ~/.hammer/cli_config.yml . For more information, see Section 1.2, "Authentication" . 2.2. Organizations, locations, and repositories Subcommand Description and tasks organization Create an organization: List organizations: location See the options for organization subscription org Upload a subscription manifest: repository-set org Enable a repository: repository org Synchronize a repository: Create a custom repository: Upload content to a custom repository: 2.3. Content life cycles Subcommand Description and tasks lifecycle-environment org Create a life cycle environment: List life cycle environments: content-view org 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: 2.4. Provisioning environments Subcommand Description and tasks domain Create a domain: subnet org loc Add a subnet: compute-resource org loc Create a compute resource: medium Add an installation medium: partition-table Add a partition table: template Add a provisioning template: os Add an operating system: 2.5. Activation keys Subcommand Description and tasks activation-key org Create an activation key: Add a subscription to the activation key: 2.6. Users and permissions Subcommand Description and tasks user org Create a user: Add a role to a user: user-group Create a user group: Add a role to a user group: role Create a role: filter Create a filter and add it to a role: 2.7. Errata Subcommand Description and tasks erratum List errata: Find erratum by CVE: Inspect erratum: host List errata applicable to a host: Apply errata to a host: 2.8. Hosts Subcommand Description and tasks hostgroup org loc Create a host group: Add an activation key to a host group: host org loc Create a host (inheriting parameters from a host group): Remove the host from host group: job-template Add a job template for remote execution: job-invocation Invoke a remote job: Monitor the remote job: 2.9. Tasks Subcommand Description and tasks task List all tasks:

Commands:
hammer defaults add --param-name organization_id --param-value org_ID
hammer defaults add --param-name location_id --param-value loc_ID
hammer organization create --name org_name
hammer organization list
hammer subscription upload --file path
hammer repository-set enable --product prod_name --basearch base_arch --releasever rel_v --name repo_name
hammer repository synchronize --product prod_name --name repo_name
hammer repository create --product prod_name --content-type cont_type --publish-via-http true --url repo_url --name repo_name
hammer repository upload-content --product prod_name --id repo_id --path path_to_dir
hammer lifecycle-environment create --name env_name --description env_desc --prior prior_env_name
hammer lifecycle-environment list
hammer content-view create --name cv_n --repository-ids repo_ID1,... --description cv_description
hammer content-view add-repository --name cv_n --repository-id repo_ID
hammer content-view puppet-module add --content-view cv_n --name module_name
hammer content-view publish --id cv_ID
hammer content-view version promote --content-view cv_n --to-lifecycle-environment env_name
hammer content-view version incremental-update --content-view-version-id cv_ID --packages pkg_n1,... --lifecycle-environment-ids env_ID1,
hammer domain create --name domain_name
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
hammer compute-resource create --name cr_name --organization-ids org_ID1,... --location-ids loc_ID1,... --provider provider_name
hammer medium create --name med_name --path path_to_medium
hammer partition-table create --name tab_name --path path_to_file --os-family os_family
hammer template create --name tmp_name --file path_to_template
hammer os create --name os_name --version version_num
hammer activation-key create --name ak_name --content-view cv_n --lifecycle-environment lc_name
hammer activation-key add-subscription --id ak_ID --subscription-id sub_ID
hammer user create --login user_name --mail user_mail --auth-source-id 1 --organization-ids org_ID1,org_ID2,
hammer user add-role --id user_id --role role_name
hammer user-group create --name ug_name
hammer user-group add-role --id ug_id --role role_name
hammer role create --name role_name
hammer filter create --role role_name --permission-ids perm_ID1,perm_ID2,
hammer erratum list
hammer erratum list --cve CVE
hammer erratum info --id err_ID
hammer host errata list --host host_name
hammer host errata apply --host host_name --errata-ids err_ID1,err_ID2,
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,
hammer hostgroup set-parameter --hostgroup "hg_name" --name "kt_activation_keys" --value key_name
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
hammer host update --name host_name --hostgroup NIL
hammer job-template create --file path --name template_name --provider-type SSH --job-category category_name
hammer job-invocation create --job-template template_name --inputs key1= value,... --search-query query
hammer job-invocation output --id job_id --host host_name
hammer task list Monitor progress of a running task: hammer task progress --id task_ID