Transition Guide
Transitioning from Satellite 5 to Satellite 6
Abstract
Chapter 1. Introduction to Red Hat Satellite
1.1. Red Hat Satellite 5
The popular functionality of Satellite 5 includes the ability to provision a large number of systems using kickstart files and activation keys to install and configure systems to a predictable state. This provisioning process associates systems to designated organizations, software and configuration channels, as well as placing systems in predefined system groups. The Satellite 5 provisioning functionality enables administrators to provision thousands of systems in a consistent manner.
Satellite 5 is recognized as a solid platform for managing software and configuration files for a large number of systems. It is also well known for the simplicity and consistency of the provisioning process. The Satellite 5 systems management platform is also well known for delivering the correct versions and updated versions of content to the correct systems in a very structured manner. Administrators can manage the Satellite and systems management processes through the Satellite webUI and also through the Satellite API interfaces.
1.2. Red Hat Satellite 6
Chapter 2. Comparing Satellite 5 and Satellite 6
Table 2.1. Comparison of Satellite 5 and Satellite 6 Concepts
|
Concept
Description
|
Satellite 5
|
Satellite 6
| |
|---|---|---|---|
|
Open source projects
A single project approach versus a modular approach.
|
Spacewalk
|
Foreman, Katello, and Puppet
| |
|
Subscription types
Pool- or channel-based versus certificate-based. Subscription management has improved over the years from a pool- or channel-based approach to a more specific certificate-based approach. Certificate-based subscription management provides better overall control of subscriptions of those consuming clients.
|
Entitlements
|
Subscriptions
| |
|
Subscription methods (or Satellite subscription consumption).
The way that Satellite is enabled to synchronize and distribute Red Hat content. Certificates are activated during installation; manifests are uploaded after installation.
|
Certificate file
|
Manifest file
| |
|
Organization management
Both Satellite 5 and 6 have a concept of multiple organizations, but Satellite 6 also includes functionality to include the context of the location.
|
Organizations
|
Organizations and Locations
| |
|
Software and configuration content
Distributed through channels versus distributed through content views published and promoted through environments. In Satellite 6 a content view contains a chosen set of software repositories and configuration modules that are published and promoted to an environment. Client systems consume its software and configurations through its environment associations.
|
Software Channels
|
Products and repositories
| |
|
Configuration
| |
Configuration Channels
|
Puppet Repositories
|
|
Proxy services
| |
Red Hat Satellite Proxy Server
|
Red Hat Satellite Capsule Server
|
|
Command-line tools
|
Various CLI tools
|
Hammer
| |
|
Virtualization and cloud providers
|
KVM and Xen
|
Openstack, Red Hat Enterprise Virtualization, KVM, VMware, EC2
| |
|
Database support
|
Embedded PostgreSQL, managed PostgreSQL, external PostgreSQL, Oracle Database 10g Release 2 or 11g (Standard or Enterprise Edition)
|
Embedded PostgreSQL for 6.0.
| |
2.1. System Architectures

Figure 2.1. Red Hat Satellite 5 System Architecture
- Web UI
- The Web UI runs through an Apache web server and provides the main entry point for Satellite operations.
- Front-end API
- The Front-end API provides the ability to interact with Satellite 5 through an XML-RPC API. This allows system administrators to write scripts to perform repetitive tasks, or develop third-party applications around Satellite. The Front-end API exposes most of the Web UI functionality using XML-RPC.
- Back-end API
- The back end provides a set of APIs that the different client utilities (
rhn_register,yum) connect to. These are not documented and are used solely by the client utilities. - Taskomatic
- Taskomatic is generally a separate service within Red Hat Satellite 5 that runs various asynchronous jobs, such as cleaning up the sessions table, or sending email notifications for new errata. The majority of these jobs run periodically, and you can adjust the frequency with which they occur.
- Search Server
- Satellite contains a standalone search server that runs as a daemon that allows you to quickly find a system, package, or errata, as opposed to paging through hundreds of items in a list. It uses Apache's Lucene search engine library, which provides more relevant search results and a richer query language.

Figure 2.2. Red Hat Satellite 6 System Architecture
- Foreman
- Foreman is an open source application used for provisioning and life cycle management of physical and virtual systems. Foreman automatically configures these systems using various methods, including kickstart and Puppet modules. Foreman also provides historical data for reporting, auditing, and troubleshooting.
- Katello
- Katello is a subscription and repository management application. It provides a means to subscribe to Red Hat repositories and download content. You can create and manage different versions of this content and apply them to specific systems within user-defined stages of the application life cycle.
- Candlepin
- Candlepin is a service within Katello that handles subscription management.
- Pulp
- Pulp is a service within Katello that handles repository and content management.
- Hammer
- Hammer is a CLI tool that provides command line and shell equivalents of most Web UI functions.
- REST API
- Red Hat Satellite 6 includes a RESTful API service that allows system administrators and developers to write custom scripts and third-party applications that interface with Red Hat Satellite.
- Capsule
- Red Hat Satellite Capsule Server acts as a proxy for some of the main Satellite functions including repository storage,
DNS,DHCP, and Puppet Master configuration. Each Satellite Server also contains integrated Capsule Server services.
2.2. Satellite Proxies and Capsules
2.2.1. Satellite 5 Proxies
2.2.2. Satellite 6 Capsules
- Mirror content (Pulp Node). Content can be staged on a Pulp Node before it is used by a host.
- Mirror Puppet content (Puppet Master)
- Integrate with DHCP, DNS, TFTP, and IPA.

Figure 2.3. Comparison of Satellite 5 Proxy and Satellite 6 Capsule Servers
2.3. Organizational Structures

Figure 2.4. Example Topology for Red Hat Satellite 5

Figure 2.5. Example Topology for Red Hat Satellite 6
2.4. Application Life Cycles

Figure 2.6. The Application Life Cycle of Red Hat Satellite 5

Figure 2.7. An Environment Path Containing Four Environments.

Figure 2.8. Creating New Versions of a Content View
Chapter 3. Transitioning from Satellite 5 to 6
- Satisfy requirements: this phase consists of ensuring that all transition prerequisites are satisfied. Failure to meet these requirements might result in an incomplete or failed transition.
- Preparation: this phase consists primarily of preparing the Satellite 6 system to receive data from the existing Satellite 5 system.
- Transition: this phase consists of exporting the data from the existing Satellite 5 system, transferring that data to the Satellite 6 system, and then tuning the configuration to suit your deployment.
3.1. The Transitioning Strategy
In a passive transition scenario, the workloads remain on Satellite 5. This strategy is most appropriate if your Satellite deployment is complex and involves significant integration with other applications via APIs or other processes. In this case, Red Hat Satellite 6 is deployed to manage only new workloads and projects, whereas Red Hat Satellite 5 is maintained in order to manage existing workloads until they are retired. Satellite 5 data models may or may not be transitioned to Satellite 6. A passive transition gives administrators the most freedom to reconsider their infrastructure with the least possibility of any disruption to services.
In an active transition scenario, all workloads are moved to Satellite 6. The object of this strategy is to decommission Satellite 5 after translating the Satellite 5 data models to Satellite 6 and registering systems to the new Satellite. All new workloads and projects are targeted for management by Satellite 6. An active transition allows data models to remain somewhat similar and familiar with all workloads appropriately migrated to the new Red Hat Satellite. The originating Satellite 5 is then free to be transitioned into an archived state and shut down.
3.2. Prerequisites and Assumptions
- Ensure you start with a fully-functional, up-to-date Satellite 5.6 server.
- Satellite 6 must be correctly installed and configured on a second machine. This installation must include a manifest that provides access to the same content as the Satellite 5.6 instance, and for the same number of clients.
- The Satellite 6 instance must be synchronized with the desired Red Hat content before you start the transition process. The transition tools are purposely designed not to copy Red Hat content from Satellite 5.6 to Satellite 6.
- The transition tools are designed to work in environments where network security prevents direct connection between the Satellite 5 and Satellite 6 instances. Consequently, the tools were designed to work in isolation, in two stages. The first stage is to export data from Satellite 5.6, and the second stage is to import data into Satellite 6. After the first stage is complete, you can use network tools (for example,
SCP) or physical media to transfer the exported data to the Satellite 6 server. - The export tools run on the Satellite 5.6 system. This allows direct access to the Satellite 5.6 database, repositories, and existing tools such as
spacewalk-report. It is also necessary because some customer sites have networking restrictions that limit access to the Satellite 5.6 instance. - The import tools run on the Satellite 6 system, for similar reasons.
3.3. The Transitioning Workflow
The preparation phase consists of the following steps:
- Install Satellite 6.
- Navigate to the Red Hat Customer Portal and create a manifest for each organization that you are going to import.
- Download those manifests to the Satellite 6 instance.
Important
Rename each manifest according to the organization for which it is intended. That is,ORG_NAME.zip. - Use the
hammer import organizationcommand to import your organizations and their manifests. For example:# hammer import organization --csv-file /tmp/exports/users.csv --upload-manifests-from /root/manifest-dir
After you have completed the steps described in Preparing for Transition, the Satellite 6 instance is ready to accept transition data. This phase consists of the following steps:
- Export the entities (metadata and content) from an installed Satellite 5 system, using tools installed on the Satellite 5 server machine.
- Transfer the exported entities to the Satellite 6 instance, using
SCP, a USB device, or other suitable means. - Import the Satellite 5 entities, using tools installed on the Satellite 6 server machine.
- Tune the Satellite 6 configuration to suit your deployment.
spacewalk-report tool extracts most of the information from the Satellite 5 instance. Several new reports have been added, as well as two new tools that are used as part of the export process:
spacewalk-channel-export: This tool exports channel data and metadata beyond that available at the report level.spacewalk-export: This tool is a wrapper that combines the various export processes into a single tool, and packages the resulting export data into a single data set that can be transferred to the Satellite 6 system.
hammer tool has been extended with a new plug-in. This plug-in is compatible with the Satellite 5 export data format, and accesses the Satellite 6 instance using its public API. The import tools track which Satellite 5 entities have been mapped to which Satellite 6 entities. This means you can run the import tools multiple times without duplicating entities.
3.4. Frequently Asked Questions
- Can I perform an in-place upgrade from Satellite 5 to Satellite 6?
- Which versions of Satellite 5 are supported for the transition?
- Which versions of Red Hat Enterprise Linux will Satellite 5 and Satellite 6 support as client systems?
- What is the quick version of how to transition from Satellite 5 to Satellite 6?
- Will the transition tools work with a disconnected server?
- Will the transition tools transition all data from Satellite 5 to Satellite 6?
- Can I run the transition tools and process multiple times?
- Can I use the export tools on my production Satellite 5.6 system?
Note
- Satellite 5.6 supports clients of Red Hat Enterprise Linux versions 4, 5, 6, and 7.
- Satellite 6 supports clients of Red Hat Enterprise Linux versions 5.7 and later, 6.1 and later, and 7.0 and later.
- Satellite 6 does not support clients of version Red Hat Enterprise Linux 4.
- Install Satellite 6, activate with a manifest and synchronize Red Hat content from CDN.
- Review the documentation, learn and understand the basics of the Satellite 6 product, including new concepts, such as environments.
- Back up the new Satellite 6 server, including databases, before using the transition tools.
- As root on Satellite 5.6, run the exporter command-line tool.
- Copy the resulting data onto Satellite 6.
- As root on Satellite 6, run the importer command-line tools.
- Validate and test the resulting Satellite 6 system for a subset of end to end functionality and important use-cases corresponding to the data-types transitioned from Satellite 5.6 to 6.
Note
- Activation-keys that use "Red Hat default"
- Anything history- or audit-related (events, oscap runs, and so on)
- Anything monitoring-related
- Configuration-channel ordering
- Distribution-channel mapping
- Kickstart data (other than snippets)
- Organization entitlement-distribution (users need to create their own manifests)
- Organization-trusts settings
- Snapshots
- Stored package-profiles
- Custom system information, such as key/value pairs, system notes, and system properties in general. The latter is completed when a system registers to Satellite 6 and connects to the created profile.
- User preferences
/var/satellite/redhat/ and being selected for export by the export tool. When exporting custom or cloned channels, the tool searches for non-Red Hat content associated with the channels, to copy into the export archive. Other than some short-term CPU and memory consumption, the tool only performs read-only file system, and SQL queries on the database to gather data, write the resulting data to files on disk, and create a tar archive of the data.
3.5. Preparing for the Transition
- A fully-functional Satellite 5.6 instance exists.
- Satellite 6 has been correctly installed on a new machine.
- Direct connectivity between the Satellite 5 and Satellite 6 instances cannot be guaranteed.
- The Satellite 6 instance contains a manifest that enables access to the same content that the Satellite 5 instance accesses, for the same number of client machines.
- The Satellite 6 instance has already synchronized the desired Red Hat content. The transition tools make every attempt not to copy Red Hat content from Satellite 5 to Satellite 6.
- The export tools execute on the Satellite 5 system. This is necessary to allow direct access to the Satellite 5 database, repositories, and existing tools such as
spacewalk-report. - The import tools execute on the Satellite 6 system, for similar reasons.
- The result of importing Satellite 5 data is not a perfectly-configured Satellite 6 instance. The goal is to alleviate as much set-up as reasonably possible, given the differences in data-models and functionality between Satellite 5 and 6.
3.5.1. Preparing the Satellite 5 Server for Transition
Install the latest spacewalk-reports and spacewalk-utils packages from the Satellite 5.6 channel.
# yum install spacewalk-reports spacewalk-utils
- activation-keys
- channels
- config-files-latest
- kickstart-scripts
- repositories
- system-profiles
spacewalk-report command to confirm the addition of these new reports.
/usr/bin/spacewalk-export and /usr/bin/spacewalk-export-channels.
Note
spacewalk-export tools. You can also use these reports for general, day-to-day reporting.
Ensure your Satellite 5 server is subscribed to the RHN Tools channel. This channel provides the latest updates to the subscription-manager and python-rhsm packages, which are required to install the subscription-manager-migration command.
# yum install subscription-manager python-rhsm
3.5.2. Preparing the Satellite 6 Server for Transition
yum install rubygem-hammer_cli_import to install it from the Satellite 6 repositories.
# hammer import --help
Usage:
hammer import [OPTIONS] SUBCOMMAND [ARG] ...3.6. Exporting Entities from Satellite 5
spacewalk-export command as a wrapper. This wrapper command calls the following commands to export Satellite 5.6 entities:
- spacewalk-report channels
- Export all custom and cloned channels and repositories for all organizations.
- spacewalk-report activation-keys
- Export activation keys.
- spacewalk-report kickstart-scripts
- Exports kickstart scripts for all organizations.
- spacewalk-report users
- Export organizations and users.
- spacewalk-report system-groups
- Export all system groups for all organizations.
- spacewalk-report config-files-latest
- Export information on configuration channels and the latest configuration file versions.
- spacewalk-report repositories
- Export repositories.
- spacewalk-report system-profiles
- Export information about the systems managed by Satellite 5.
spacewalk-export functionality, including limiting the data exported, using the --where and --like options. However, if the goal is to export as much as possible - or at most limit by organization - the spacewalk-export tool can manage the process for you.
spacewalk-export command also uses the spacewalk-export-channels command to collect information and content for non-Red Hat channels.
3.6.1. Exporting Data from Satellite 5
# spacewalk-export --list-entities INFO: Currently-supported entities include: INFO: channels : Custom/cloned channels and repositories for all organizations INFO: activation-keys : Activation keys INFO: kickstart-scripts : Kickstart scripts for all organizations INFO: users : Users and Organizations INFO: system-groups : System-groups for all organizations INFO: config-files-latest : Latest revision of all configuration files INFO: repositories : Defined repositories INFO: system-profiles : System profiles for all organizations
--entities option to limit the export by entity.
# spacewalk-export --entities users,repositories
--entities option with the channels parameter to export all channel data available on the Satellite 5 instance. Using this format calls both spacewalk-report-channels and spacewalk-export-channels, and consequently exports both Red Hat and non-Red Hat channels.
--org option to limit the export by organization. Use the spacewalk-report users command to retrieve a list of organization IDs.
# spacewalk-export --org=ORG-ID
spacewalk-export command stores all exports in the ~/spacewalk-export-dir/exports file, and packages all export data into the ~/spacewalk-export-dir/spacewalk_export.tar.gz file. You can use the following options on the command line to specify different values:
# spacewalk-export --export-dir=your-export-directory # spacewalk-export --export-package=your-export-package-name
Example 3.1. Example of a Typical Export Session
# spacewalk-export INFO: Processing channels... Processing organization: GLOBAL SUPPORT SERVI RED HAT, INC. * channel: clone-rhel-x86_64-server-5 with: 15778 packages * channel: clone-rhel-x86_64-server-6 with: 12157 packages * channel: clone-rhel-x86_64-server-optional-6 with: 6931 packages . . * channel: epel-puppet-rhel6-server-x86_64 with: 8 packages * channel: puppet-rhel5-server-x86_64 with: 409 packages * channel: puppet-rhel6-server-x86_64 with: 373 packages INFO: Processing system-groups... INFO: Processing activation-keys... INFO: Processing repositories... INFO: Processing users... INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz
3.6.2. Transferring Exports to Satellite 6
/root/spacewalk-export-dir/spacewalk_export.tar.gz file to the Satellite 6 server. If the two servers are connected over the network, you can use scp or a similar tool to transfer the file. Alternatively, use removable media such as a USB device or DVD.
Warning
spacewalk_export.tar.gz file in the /tmp/ directory on your Satellite 6 system. This ensures that the extracted files have suitable permissions for the import process.
Extract the spacewalk_exports.tar.gz archive into the /tmp/ directory on your Satellite 6 server, and use the --directory option with the hammer import commands to specify this directory as the source directory. This creates a /tmp/exports/ directory that contains all the exported data, ready to import and recreate within the Satellite 6 server.
Important
/tmp/ directory.
/tmp/ directory cannot be used, ensure that you use an alternative that provides sufficient space and read access for the apache user and group.
apache user and group has read access to the /tmp/exports/ directory. If necessary, adjust the group and permissions:
# chgrp -R apache /tmp/exports/ # chmod -R 0750 /tmp/exports/
3.7. Importing to Satellite 6
- Import organizations. This includes importing a manifest if one exists.
- Import users.
- Import system groups as host collections.
- Enable and synchronize repositories. This is referred to as repository discovery.
- Import repositories.
- Import custom channels and cloned channels as content views.
- Import activation keys.
- Import kickstart snippets as template snippets.
- Import configuration files to puppet modules.
- Import system profiles as content hosts.
Important
hammer import all --dry-run command to list the available entities and the order in which they should be imported.
Satellite 6 gives you the option of importing entities separately or all together. This section describes these two approaches.
# hammer shell hammer> import organization --csv-file=FILE hammer> import user --csv-file=FILE
/tmp/exports (the result, for example, of unpacking the output of spacewalk-export), you can use the following command to import everything:
# hammer import all --directory=/tmp/exports
3.7.1. Importing Organizations
users.csv file and recreate the Satellite 5.6 organizations listed within it. You can use the hammer import command on the command line or use the hammer interactive shell.
# hammer import organization --csv-file /tmp/exports/users.csv
--upload-manifests-from and --verbose options:
Example 3.2. Example of Interactive Import Session
# hammer shell hammer> import organization --csv-file /tmp/exports/users.csv --upload-manifests-from /root/manifests --verbose Importing from /tmp/exports/users.csv Creating new organization: RED HAT SATELLITE ENGINEERING Uploading manifest /root/manifests/RED_HAT_SATELLITE_ENGINEERING.zip to org-id 5 Waiting for the task [a231d19c-aee7-42b8-9566-07651ac029f4] ...... Organization [1->5] already imported. Organization [1->5] already imported. Organization [1->5] already imported. Organization [1->5] already imported. Creating new organization: SOE-ORG Uploading manifest /root/manifests/SOE-ORG.zip to org-id 6 Waiting for the task [5da6dd16-0bf6-4ad0-924f-a9d5e1802565] ...... Organization [7->6] already imported. Summary Found 5 organizations. Created 2 organizations. Uploaded 2 manifests.
hammer organization list command to list the organizations within Satellite 6.
hammer> organization list ID | NAME | LABEL | DESCRIPTION 1 | ACME_Corporation | ACME_Corporation | ACME_Corporation Organization 5 | QA | QA | Imported 'QA' organization from Red Hat Satellite 5 4 | Sec eng Dept. | Sec_eng_Dept_ | Imported 'Sec eng Dept.' organization from Red Hat Satelli.. 6 | Security | Security | Imported 'Security' organization from Red Hat Satellite 5 hammer>
user.csv file. The Satellite 5 organization IDs are mapped to new Satellite 6 organization IDs. This is illustrated by the "[2->4]" and "[26->7]" entries in Example 3.2, “Example of Interactive Import Session”. Alternatively, you can use the hammer import organization --into-org-id org_id command to reduce all of the Satellite 5 organizations into a single, flat organization within Satellite 6. You can use the hammer organization list command to determine the correct organization ID.
Warning
~/.transition_data directory. This information is critical for any subsequent data imports. Do not modify the data in this directory.
/root/.foreman/history file, and any errors from hammer commands are stored in the /root/.foreman/log/hammer.log file.
hammer import command logs all output to the ~/import.log file. You can use the --logfile option to any hammer import subcommand to specify a different name and location for the log file.
3.7.1.1. Generating and Activating a Manifest
Procedure 3.1. To Activate the Manifest for Satellite 6:
- Log in to the Satellite 6 WebUI as an administrative user.
- Select the required organization from the main menu at the upper left.
- Click →
- On the Actions tab, under Upload New Manifest, click , navigate to and select the manifest file that you downloaded.
- In the Satellite 6 WebUI, click to upload the manifest to the Satellite 6 server.
3.7.2. Importing Users
users.csv file. User passwords cannot be copied from Satellite 5 to Satellite 6; instead, the process generates a new random password for each user that it imports. This information is saved in a CSV file, which as the administrator you can parse and send notifications to each user listed with their new password. You can use the hammer import command on the command line or use the hammer interactive shell.
hammer import user command multiple times, using different input files (CSV files). The import command recognizes user IDs it has already imported, and skips them on subsequent processes.
# hammer import user --csv-file /tmp/exports/users.csv \ --new-passwords /path/to/new/user/passwords.csv
Example 3.3. Example of Interactive Import Session
hammer> import user --csv-file /tmp/exports/users.csv --new-passwords /root/new-user-passwords.csv Creating new user: sat5_admin Creating new user: auser1 Creating new user: auser2
# hammer user list ID | LOGIN | NAME | EMAIL 5 | auser1 | A User1 | auser1@example.com 4 | auser2 | A User2 | auser2@example.com 1 | admin | Admin User | root@sat6.example.com # hammer user list --search sat5_admin ID | LOGIN | NAME | EMAIL 3 | sat5_admin | Hat Red | sat5admin@example.com
# head new-user-passwords.csv mail,login,password sat5admin@example.com,sat5_admin,sat5_admin_svenkmxf auser1@example.com,auser1,auser1_pwfnagdk auser2@example.com,auser2,auser2_rsgywazf
Note
admin user as the initial administrator. It is common for Satellite 5 customers to also create a generic administrative user; consequently, if the import process detects a Satellite 5 admin user, it renames that user to sat5_admin.
You can use the --delete option to delete the entities from the Satellite 6 instance based on information in the specified CSV file. The following example demonstrates the use of this option to delete imported users.
Example 3.4. Deleting Imported Users
$ hammer import user --csv-file /tmp/exports/users.csv --delete --verbose Deleting from /tmp/exports/users.csv Deleting imported user [1->5]. Deleting imported user [8->6]. Deleting imported user [9->7].
3.7.3. Transitioning System Groups to Host Collections
# hammer import host-collection --csv-file /tmp/exports/system-groups.csv Creating new host_collection: dev Creating new host_collection: test Creating new host_collection: prod Creating new host_collection: east Creating new host_collection: west Creating new host_collection: dbs Creating new host_collection: web Creating new host_collection: apps
hammer host-collection list --organization-id ORG-ID to verify that the system groups have been recreated as host collections. Ensure you use the correct organization ID.
3.7.4. Enabling Yum Repositories
satellite-sync command synchronizes Red Hat channels from RHN into Satellite 5. In Satellite 6, everything is a yum repository and you filter the content from that repository that is exposed to the systems being managed by Satellite 6.
- Use the
hammer import repository --synchronizecommand to initiate repository synchronization in the background. - Use the
hammer import repository --synchronize --waitcommand to initiate repository synchronization in the background, but wait for each synchronization to complete before proceeding to the next repository. - Use the
hammer import repositorycommand with neither option and then synchronize the content manually using the WebUI orhammercommands.
The default behavior of the hammer import repository command is to not automatically synchronize content. Many of the following import operations require that synchronization be complete before they can run successfully. Synchronization is a time-consuming task, because it involves retrieving content from external sources into your Satellite 6 server.
hammer import command does not alter organizations that are not part of the overall transition process.
# hammer import repository-enable --synchronize --wait --no-async
repository-enable command is complete, run the following command to process local and custom repositories in a similar fashion.
# hammer import repository --synchronize --wait --no-async
Example 3.5. Example Session of Importing Repositories
# hammer import all --entities repository Import organization with arguments --csv-file /tmp/exports/users.csv Summary No action taken. Import repository with arguments --csv-file /tmp/exports/repositories.csv Summary Created 6 repositories. Created 6 products.
3.7.4.1. Enabling External Yum Repositories
--synchronize option to import and synchronize repositories.
Example 3.6. Importing and Synchronizing non-Red Hat Repositories
# hammer import repository --synchronize --wait --no-async \ --csv-file /tmp/exports/repositories.csv Creating new product: PUPPETLABS.COM Creating new repository: puppet-rhel6-server-x86_64 Sync started! Creating new repository: puppet-deps-rhel6-server-x86_64 Sync started! Creating new repository: puppet-rhel5-server-x86_64 Sync started! Product [1PUPPETLABS.COM->116] already imported. Creating new repository: puppet-deps-rhel5-server-x86_64 Sync started! Creating new product: FEDORAPROJECT.ORG Creating new repository: epel-rhel6-server-x86_64 Sync started!
Navigate to → in the Satellite 6 WebUI to view the resulting products and repositories for your organization. Alternatively, use the following hammer commands:
# hammer organization list ID | NAME | LABEL | DESCRIPTION 1 | ACME_Corporation | ACME_Corporation | ACME_Corporation Organization 3 | GLOBAL SUPPORT SERVI RED HAT, INC. | GLOBAL_SUPPORT_SERVI_RED_HAT__INC_ | Imported 'GLOBAL SUPPORT SERVI RED HAT, INC.' organization from Red ... # hammer product list --organization-id 3 ID | NAME | ORGANIZATION | REPOSITORIES | SYNC STATE 32 | Red Hat Enterprise Linux High Performance Networking for RHEL for IBM POWER -... | GLOBAL SUPPORT SERVI RED HAT, INC. | 0 | not_synced 35 | Red Hat Enterprise Linux 7 High Availability High Touch Beta | GLOBAL SUPPORT SERVI RED HAT, INC. | 0 | not_synced
Important
hammer import repository command is to not automatically synchronize content, but rather only to enable the repositories listed in the repositories.csv file. Red Hat recommends that you use the --synchronize option to schedule a background synchronization of all content before proceeding.
3.7.4.2. Enabling Red Hat Repositories
hammer import command on Satellite 6 provides an option to review your Satellite 5 channels and enable the corresponding repositories in Satellite 6. This section guides you through the process of discovering and enabling the appropriate Red Hat repositories. This command provides the same --wait and --synchronize options for initiating the import of Red Hat content automatically. This needs to be completed before moving to the next step.
--synchronize option to enable and synchronize Red Hat repositories.
Example 3.7. Enabling and Synchronizing Red Hat Repositories
# hammer import repository-enable --csv-file /tmp/exports/channels.csv --synchronize Only repositories available to IMPORTED organizations will be enabled! Organization ACME_Corporation... Organization GLOBAL_SUPPORT_SERVI_RED_HAT__INC_... Enabling /content/dist/rhel/server/5/5Server/x86_64/os/Packages for channel rhel-x86_64-server-5 Sync started! Enabling /content/dist/rhel/server/5/5Server/x86_64/supplementary/os/Packages for channel rhel-x86_64-server-supplementary-5 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/rhn-tools/os/Packages for channel rhn-tools-rhel-x86_64-server-6 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/optional/os/Packages for channel rhel-x86_64-server-optional-6 Sync started! Enabling /content/dist/rhel/server/6/6Server/x86_64/os/Packages for channel rhel-x86_64-server-6 Sync started! Enabling /content/dist/rhel/server/5/5Server/x86_64/rhn-tools/os/Packages for channel rhn-tools-rhel-x86_64-server-5 Sync started!
3.7.5. Transitioning Custom and Cloned Channels to Content Views
--dir option to specify the appropriate export directory.
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv / --dir /tmp/exports/CHANNELS
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --synchronize
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv / --dir /tmp/exports/CHANNELS --synchronize
Example 3.8. Importing Channels to Content Views
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS Creating new product: Local-repositories Creating new local_repository: Local repository for clone-rhel-x86_64-server-5 No such content_view: 101 Repository Local_repository_for_clone-rhel-x86_64-server-5 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for clone-rhel-x86_64-server-6 No such content_view: 102 Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for custom-clone-master-puppet-rhel6-server-x86_64 Repository Local_repository_for_custom-clone-master-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Creating new local_repository: Local repository for epel-puppet-rhel6-server-x86_64 Repository Local_repository_for_epel-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed.
Example 3.9. Synchronizing Imported Channels
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --synchronize Product [1Local-repositories->118] already imported. Local_repository [1117->12] already imported. Sync started! No such content_view: 101 Repository Local_repository_for_clone-rhel-x86_64-server-5 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1113->13] already imported. Sync started! No such content_view: 102 Repository Local_repository_for_clone-rhel-x86_64-server-6 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1115->14] already imported. Sync started! Repository Local_repository_for_custom-clone-master-puppet-rhel6-server-x86_64 is not (fully) synchronized. Retry once synchronization has completed. Product [1Local-repositories->118] already imported. Local_repository [1125->21] already imported. Sync started!
Example 3.10. Combining Import and Synchronization of Channels
# hammer import content-view --csv-file /tmp/exports/CHANNELS/export.csv --dir /tmp/exports/CHANNELS --synchronize Product [1Local-repositories->98] already imported. Local_repository [1117->12] already imported. No such content_view: 101 Creating new content_view: Clone of Red Hat Enterprise Linux (v. 5 for 64-bit x86_64) Product [1Local-repositories->98] already imported. Local_repository [1113->13] already imported. No such content_view: 102 Creating new content_view: Clone of Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) Product [1Local-repositories->98] already imported. Local_repository [1115->14] already imported. No such content_view: 103 Creating new content_view: Clone of RHEL Server Optional (v. 6 64-bit x86_64)
3.7.6. Importing Activation Keys
Example 3.11. Importing Activation Keys into Satellite 6
# hammer import activation-key --csv-file /tmp/exports/activation-keys.csv Activation key usage_limit: unlimited Creating new activation_key: 1-rhel5-puppet Associating activation key [1] with host collections [2] Activation key usage_limit: unlimited Creating new activation_key: 1-rhel6-puppet Associating activation key [2] with host collections [1] Creating new ak_content_view: ak_1 Publishing content view: 15 Associating activation key [1] with content view [15] Updating activation_key with id: 1 Creating new ak_content_view: ak_2 Publishing content view: 16 Associating activation key [2] with content view [16] Updating activation_key with id: 2
hammer activation-key list --organization-id ORG-ID command to verify that the activation keys have been recreated. Ensure you use the correct organization ID.
Example 3.12. Verifying the Import of Activation Keys
# hammer activation-key list --organization-id 3 ID | NAME | CONSUMED | LIFECYCLE ENVIRONMENT | CONTENT VIEW 2 | 1-rhel6-puppet | 0 of Unlimited | | ak_2 1 | 1-rhel5-puppet | 0 of Unlimited | | ak_1
3.7.7. Transitioning Kickstart Profiles
The transition tools extract and export kickstart scripts from kickstart profiles as part of the overall export process on the Satellite 5 server. These scripts are stored in the kickstart-scripts.csv file in the export archive, which is copied to the Satellite 6 server.
When you extract the export archive onto the Satellite 6 server, the hammer import command uses the kickstart-scripts.csv file to create template snippets. These snippets are in the form of %pre and %post scripts that you can use with any new kickstart profiles in Satellite 6.
3.7.8. Transitioning Configuration Channels to Puppet Modules
- Generate Puppet modules for each Satellite 5 configuration channel.
- Map any Satellite 5 macros in the configuration files to whatever Puppet facts are found.
- Build the modules.
- Create a Satellite 6 repository for each configuration channel, and a product to hold those repositories.
- Upload the built Puppet modules into Satellite 6.
Table 3.1. Mapping of Satellite 5 Macros to Satellite 6 (Puppet) Facts
|
Satellite 5 Macro
|
Puppet Fact
|
|---|---|
|
rhn.system.sid
|
None
|
| rhn.system.profile_name | None |
| rhn.system.description | None |
| rhn.system.hostname | FQDN or host name |
| rhn.system.ip_address | ipaddress |
| rhn.system.custom_info(key_name) | None |
| rhn.system.net_interface.ip_address(eth_device) | ipaddress_{NETWORK INTERFACE} |
| rhn.system.net_interface.netmask(eth_device) | netmask_{NETWORK INTERFACE} |
| rhn.system.net_interface.broadcast(eth_device) | None |
| rhn.system.net_interface.hardware_address(eth_device) | macaddress_{NETWORK INTERFACE} |
| rhn.system.net_interface.driver_module(eth_device) | None |
The following example illustrates a simple use case for transitioning configuration channels to Puppet modules.
Example 3.13. Transitioning Configuration Channels and Files to Puppet Modules
# hammer import config-file --csv-file /tmp/exports/config-files-latest.csv Writing converted files Building and uploading puppet modules Summary Created 1 puppet file. Created 1 puppet module.
3.7.9. Transitioning System Profiles to Content Hosts
hammer import all command, or by specifically importing them, using the hammer import all --entities content-host command.
Before you can transition your Satellite 5 systems to Satellite 6, you need to build the required RPM file. The hammer import all command displays instructions on how to do this, tailored to your specific environment, after you have successfully transitioned system profiles to content hosts.
Example 3.14. Example Instructions for Building a System Profile Transition RPM File
To build the system-profile-transition rpm, run: cd /root/rpm-working-dir/SPECS && rpmbuild -ba --define "_topdir /root/rpm-working-dir" system-profile-transition-myhost.example.com-1410140956-0.0.1.spec Then find your system-profile-transition-myhost.example.com-1410140956 package in /root/rpm-working-dir/RPMS/noarch/ directory.
3.7.10. Transitioning Systems
- Ensure that each Satellite 5 client is registered to a new Satellite 6 instance, with as much of the existing Satellite 5 setup maintained as possible.
- Help customers stay in compliance with their Red Hat Enterprise Linux usage. The process removes the Satellite 5 entitlements used by a given system when that system is registered to Satellite 6.
3.7.10.1. Prerequisites
- An existing, up-to-date Satellite 5.6 server. In this example, this system is called "SAT5.6".
- An existing, up-to-date Red Hat Enterprise Linux client systems registered to SAT5.6.
- An existing, up-to-date Satellite 6 server. In this example, this system is called "SAT6".
- Manifests created for each Organization on SAT5.6, downloaded to username@SAT6:/tmp/manifests, and renamed to
ORG_NAME.zip, to match the names of your organizations.
3.7.10.2. Assumptions
- The
hammer import content-hostcommand has completed successfully. - An RPM file containing a mapping between Satellite 5 SIDs and matching Satellite 6 content-host UUIDs has been created.
- The above-mentioned RPM file has been installed on the Satellite 5 server.
- The sat5to6 package and dependencies have been installed on each client system. This package provides the
sat5to6command, which performs the following tasks on the system where it is run:- Queries its Satellite 5 parent for a consumer ID.
- Loads the appropriate PEM files onto the client machine, based on the Satellite 5 channels to which the machine is subscribed.
- Registers the host on which it is run to a specified Satellite 6 server, attaching it to the content host UUID specified by its Satellite 5 parent.
- Manages the "retired" Satellite 5 profile in one of three ways, as specified by the user:
keep: Do nothing. Retain the Satellite 5 profile in its original state.unentitle: Retain the Satellite 5 profile but remove all subscriptions and entitlements (default).purge: Delete the Satellite 5 profile completely.
3.7.10.3. Performing the Transition
- You have successfully used the
spacewalk-exportcommand on your Satellite 5 server to export all required entities. - You have copied the resulting
spacewalk_export.tar.gzfile to the/tmpdirectory on your Satellite 6 server, and extracted it into the same directory. - You have successfully run the
hammer import allcommand on the Satellite 6 server, and followed the resulting instructions to build the required RPM file. - You have the necessary system transition packages installed on the Satellite 5 server. To ensure these packages are installed, run the following command:
# yum install /tmp/system-profile-transition-*.rpm
This process assumes that your client is already subscribed to the appropriate RHN Tools channel. This channel provides access to the sat5to6 RPM file and its dependencies. For each client that is registered to your Satellite 5 server, run the following commands:
- Install the sat5to6 package and its dependencies:
# yum install sat5to6
- Install the Public Certificate for Satellite's Certificate Authority. This also configures
subscription-managerwith the correct URL so that the system can properly register via the Satellite 6.x instance. In this example, $FQDN represents the fully qualified domain name of the Satellite or Satellite Capsule.Important
Ensure you use HTTP and not HTTPS for this installation; the Satellite 6 CA certificate is not yet installed and so HTTPS will fail.# yum install http://$FQDN/pub/katello-ca-consumer-latest.noarch.rpm
- Update the yum and openssl packages.
# yum update yum openssl
- Use the
sat5to6command to register your client to your Satellite 6 instance, and attach it to the content host created for it by the import process.# sat5to6 --registration-state unentitle \ --legacy-user admin --legacy-password password \ --destination-user admin --destination-password changeme
- Enable the RH-Common repository which contains the katello-agent and puppet packages.
# subscription-manager repos --enable=rhel-*-rh-common-rpms
- Install the katello-agent and puppet packages
# yum install katello-agent puppet
- Configure the
goferdandpuppetservices to start on boot.# chkconfig goferd on # chkconfig puppet on
- Configure puppet with the host name of the Satellite or Satellite Capsule that will manage its configuration. In this example, $FQDN represents the fully qualified domain name of the Satellite or Satellite Capsule.
# echo "server=$FQDN" >> /etc/puppet/puppet.conf
- Restart the
goferdandpuppetservices.# service goferd restart # service puppet restart
Note
/etc/rhsm/rhsm.conf file. This enables SSL and also means you do not need to specify the --destination-url parameter as part of the sat5to6 command.
Example 3.15. Example Session of a System Transition
# sat5to6 --registration-state=unentitle --legacy-user=admin --legacy-password=password --destination-user=admin --destination-password=changeme Org: MY ENGINEERING ORG Environment: Library Retrieving existing legacy subscription information... +-----------------------------------------------------+ System is currently subscribed to these legacy channels: +-----------------------------------------------------+ rhel-x86_64-server-6 +-----------------------------------------------------+ Installing product certificates for these legacy channels: +-----------------------------------------------------+ rhel-x86_64-server-6 Product certificates installed successfully to /etc/pki/product. Attempting to register system to destination server... WARNING This system has already been registered with Red Hat using RHN Classic. Your system is being registered again using Red Hat Subscription Management. Red Hat recommends that customers only register once. To learn how to unregister from either service please consult this Knowledge Base Article: https://access.redhat.com/kb/docs/DOC-45563 The system has been registered with ID: ac063466-0abc-1bb3-abc0-33abf6c1dd3a Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Subscribed System 'dhcp1234.example.com' successfully registered.
Chapter 4. Advanced Transitioning
4.1. Transitioning APIs
Important
You can find further API documentation at the following locations on your own Satellite servers:
- Satellite 6: https://satellite6.example.com/apidoc/v2.html
- Satellite 5: https://satellite5.example.com/rpc/api
4.1.1. Example API Scripts
- Systems and hosts in Red Hat Satellite
- Authenticate and request a list of systems (Satellite 5) or hosts (Satellite 6) available to the user who logged in.
- Users and Roles
- Authenticate and request a list of all users visible to the user who logged in.
- Delete the
exampleuser if it exists. - Create a new
exampleuser and ensure that its role is set toAdministrator.
- A Satellite 5 Python script
- A Satellite 6 Python script
- A Satellite 6 Ruby script
- A Satellite 5
spacecmdexample - A Satellite 6
hammerexample
Note
spacecmd command is not a supported feature in Satellite 5.6. It is planned for release and support with Satellite 5.7, and is shown here for the sake of completeness.
4.1.1.1. Listing Systems and Hosts
This example uses a Python script to connect to Satellite 5, authenticate, and retrieve a list of available systems.
#!/usr/bin/python
import xmlrpclib
# Define Satellite location and login details
SATELLITE_URL = "http://localhost/rpc/api"
SATELLITE_LOGIN = "admin"
SATELLITE_PASSWORD = "password"
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
# Authenticate and get session key
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
# Get list of systems available to user
list = client.system.listSystems(key)
for system in list:
print system.get('id')
print system.get('name')
# Logout
client.auth.logout(key)
This example uses a Python script to connect to Satellite 6, authenticate, and retrieve a list of available hosts.
#!/usr/bin/python
import json
import requests
# Define Satellite location and login details
SAT_API = "https://localhost/api/v2/"
USERNAME = "admin"
PASSWORD = "changeme"
SSL_VERIFY = False
def get_json(location):
"""
Performs a GET using the passed URL location
"""
r = requests.get(location, auth=(USERNAME, PASSWORD), verify=SSL_VERIFY)
return r.json()
def main():
# List all hosts available to the user
hosts = get_json(SAT_API + "hosts/")
# Pretty Print the returned JSON of Hosts
print json.dumps(hosts, sort_keys=True, indent=4)
if __name__ == "__main__":
main()
This example uses a Ruby script to connect to Satellite 6, authenticate, and retrieve a list of available hosts.
#!/usr/bin/ruby193-ruby
require 'json'
require 'rest-client'
url = 'https://localhost/api/v2/'
$username = 'admin'
$password = 'changeme'
def get_json(location)
response = RestClient::Request.new(
:method => :get,
:url => location,
:user => $username,
:password => $password,
:headers => { :accept => :json,
:content_type => :json }
).execute
results = JSON.parse(response.to_str)
end
hosts = get_json(url+"hosts/")
#puts JSON.pretty_generate(hosts)
puts "Hosts within Satellite are:"
hosts['results'].each do |name|
puts name['name']
end
exit()
Use the following command format to list available systems on Satellite 5:
# spacecmd -u username -p password system_list
# spacecmd -u admin -p password system_list INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin test_02.example.com
Use the following command format to list available hosts on Satellite 6:
# hammer host list
# hammer host list [Foreman] password for admin: ---|-----------------|-------------------|------------|--------------|------------------ ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC ---|-----------------|-------------------|------------|--------------|------------------ 1 | test.example.com | RHEL Server 6.5 | | 10.34.34.235 | e4:1f:13:6b:ed:0c
4.1.1.2. Deleting and Creating Users
This example uses a Python script to connect to and authenticate against a Satellite 5 server. It then goes on to search for a specific user (example), to delete that user if it exists, and then recreate it with Administrator privileges.
#!/usr/bin/python
import xmlrpclib
# Define Satellite location and login details
SATELLITE_URL = "http://localhost/rpc/api"
SATELLITE_LOGIN = "admin"
SATELLITE_PASSWORD = "password"
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
# Authenticate and get session key
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
# Get list of users
list = client.user.list_users(key)
print "Existing users in Satellite:"
for user in list:
print user.get('login')
# Look for user example and if found, delete the user
for user in list:
if user.get('login') == 'example':
deleteuser = client.user.delete(key, 'example')
if deleteuser == 1:
print "User example deleted"
# Create a user called example
createuser = client.user.create(key, 'example', 'password', 'Example', 'User', "root@localhost")
if createuser == 1:
print "User example created"
# Admin Org Admin role to the example user
adminrole = client.user.addRole(key, 'example', 'org_admin')
if adminrole == 1:
print "Made example an Org Admin"
# Logout
client.auth.logout(key)
This example performs the same task as the previous example. That is, it uses a Python script to connect to and authenticate against a Satellite 6 server, search for a specific user, delete that user if it exists, and then recreate it with Administrator privileges.
#!/usr/bin/python
import json
import requests
# Define Satellite location and login details
SAT_API = "https://localhost/api/v2/"
POST_HEADERS = {'content-type': 'application/json'}
USERNAME = "admin"
PASSWORD = "changeme"
SSL_VERIFY = False
def get_json(location):
"""
Performs a GET using the passed URL location
"""
r = requests.get(location, auth=(USERNAME, PASSWORD), verify=SSL_VERIFY)
return r.json()
def post_json(location, json_data):
"""
Performs a POST and passes the data to the URL location
"""
result = requests.post(
location,
data=json_data,
auth=(USERNAME, PASSWORD),
verify=SSL_VERIFY,
headers=POST_HEADERS)
return result.json()
def delete_json(location):
"""
Performs a DELETE and passes the id to the URL location
"""
result = requests.delete(
location,
auth=(USERNAME, PASSWORD),
verify=SSL_VERIFY)
return result.json()
def main():
# List all users within the Satellite
users = get_json(SAT_API + "users/")
#print json.dumps(users, indent=4)
print "Users known are:"
for login in users['results']:
print login['login']
# Look for user example and if found, delete the user
for delete in users['results']:
if delete['login'] == 'example':
id = delete ['id']
id = str(id)
delete = delete_json(SAT_API + "/users/" + id)
#print json.dumps(delete, indent=4)
print "User example deleted"
# Create a user called example as admin role
createuser = post_json(SAT_API + "/users/", json.dumps({ "mail": "root@localhost", "firstname": "Example", "lastname": "User", "login": "example", "password": "redhat", "admin": 'true', "auth_source_id": 1 }))
#print json.dumps(createuser, indent=4)
print "Admin user example created"
if __name__ == "__main__":
main()
This example uses Ruby to perform the same task as the previous examples.
#!/usr/bin/ruby193-ruby
require 'json'
require 'rest-client'
url = 'https://localhost/api/v2/'
$username = 'admin'
$password = 'changeme'
def get_json(location)
response = RestClient::Request.new(
:method => :get,
:url => location,
:user => $username,
:password => $password,
:headers => { :accept => :json,
:content_type => :json }
).execute
results = JSON.parse(response.to_str)
end
def post_json(location, json_data)
response = RestClient::Request.new(
:method => :post,
:url => location,
:user => $username,
:password => $password,
:headers => { :accept => :json,
:content_type => :json},
:payload => json_data
).execute
results = JSON.parse(response.to_str)
end
def delete_json(location)
response = RestClient::Request.new(
:method => :delete,
:url => location,
:user => $username,
:password => $password,
:headers => { :accept => :json,
:content_type => :json }
).execute
results = JSON.parse(response.to_str)
end
# List all users within the Satellite
users = get_json(url+"users/")
#puts JSON.pretty_generate(users)
puts "Users known are:"
users['results'].each do |name|
puts name['login']
end
# Look for user example and if found, delete the user
users['results'].each do |name|
if name['login'] == 'example'
id = name['id']
delete = delete_json(url+"users/"+id.to_s)
#puts JSON.pretty_generate(delete)
puts "User example deleted"
end
end
# Create a user called example as admin role
data = JSON.generate({ :mail => "root@localhost", :firstname => "Example", :lastname => "User", :login => "example", :password => "password", :admin => 'true', :auth_source_id => 1})
createuser = post_json(url+"users/", data)
#puts JSON.pretty_generate(createuser)
puts "Admin user example created"
exit()
This example uses the spacecmd command to perform the same task as the previous examples. Use the following command format:
# spacecmd -u admin -p password user_list # spacecmd -u admin -p password user_delete example # spacecmd -u admin -p password user_create # spacecmd -u admin -p password user_addrole example org_admin
# spacecmd -u admin -p password user_list INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin admin example # spacecmd -u admin -p password user_delete example INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin Delete this user [y/N]: y # spacecmd -u admin -p password user_list INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin admin # spacecmd -u admin -p password user_create INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin Username: example First Name: Example Last Name: User Email: root@localhost PAM Authentication [y/N]: n Password: Repeat Password: # spacecmd -u admin -p password user_list INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin admin example # spacecmd -u admin -p password user_addrole example org_admin INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin # spacecmd -u admin -p password user_details example INFO: Spacewalk Username: admin INFO: Connected to https://localhost/rpc/api as admin Username: example First Name: Example Last Name: User Email Address: root@localhost Organization: MY ORG Last Login: Created: 8/19/14 8:42:52 AM EDT Enabled: True Roles ----- activation_key_admin channel_admin config_admin monitoring_admin org_admin system_group_admin
This example uses the hammer command to perform the same task as the previous examples. Use the following command format:
# hammer shell > user list > user delete --id 4 --login example > user create --admin true --firstname Example --lastname User --login example --mail root@localhost --password redhat --auth-source-id 1
# hammer shell [Foreman] password for admin: Welcome to the hammer interactive shell Type 'help' for usage information hammer> user list ---|---------|--------------|--------------- ID | LOGIN | NAME | EMAIL ---|---------|--------------|--------------- 4 | example | Example User | root@localhost 3 | admin | Admin User | root@localhost ---|---------|--------------|--------------- hammer> user delete --id 4 --login example User deleted hammer> user list ---|-------|------------|--------------- ID | LOGIN | NAME | EMAIL ---|-------|------------|--------------- 3 | admin | Admin User | root@localhost ---|-------|------------|--------------- hammer> user create --admin true --firstname Example --lastname User --login example --mail root@localhost --password redhat --auth-source-id 1 User created hammer> user list ---|----------|--------------|--------------- ID | LOGIN | NAME | EMAIL ---|----------|--------------|--------------- 3 | admin | Admin User | root@localhost 5 | example | Example User | root@localhost ---|----------|--------------|--------------- hammer>
4.1.2. Satellite 6 API Tips
If you have already logged in to the Satellite 6 WebUI, you can see the default results of GET requests at /api/v2/<API-NAME>/. For example:
- https://satellite6.example.com/api/v2/users/
- https://satellite6.example.com/api/v2/users/3
You can use the curl command to interact with the Satellite 6 API. For example:
Example 4.1. Example GET Requests
# SATUSER=admin # SATPASS='changeme' # SATURL="https://localhost" # curl -k -u $SATUSER:$SATPASS -X GET -H 'Accept: application/json' $SATURL/api/v2/organizations | json_reformat # curl -k -u $SATUSER:$SATPASS -X GET -H 'Accept: application/json' $SATURL/api/v2/hosts | json_reformat # curl -k -u $SATUSER:$SATPASS -X GET -H 'Accept: application/json' $SATURL/api/v2/users | json_reformat # curl -k -u $SATUSER:$SATPASS -X GET -H 'Accept: application/json' $SATURL/api/v2/users/3 | json_reformat
Example 4.2. Example DELETE Request
# curl -k -u $SATUSER:$SATPASS -X DELETE -H 'Accept: application/json' $SATURL/api/v2/users/9 | json_reformat
Example 4.3. Example POST Request
example, passing the true flag to enable administrator privileges for the user.
# curl -k -u $SATUSER:$SATPASS -X POST -d '{ "mail": "root@localhost", "firstname": "Example", "lastname": "User", "login": "example", "password": "redhat", "admin": 'true', "auth_source_id": 1 }' -H 'Accept: application/json' -H 'Content-Type: application/json' $SATURL/api/v2/users | json_reformatExample 4.4. Example PUT Request
example user with known ID "10" to example@localhost.
# curl -k -u $SATUSER:$SATPASS -X PUT -d '{ "id": 10, "mail": "example@localhost" }' -H 'Accept: application/json' -H 'Content-Type: application/json' $SATURL/api/v2/users/10 | json_reformatAppendix A. Glossary of Terms
- Activation Key
- A registration token used in a Kickstart file to control actions at registration. These are similar to Activation Keys in Red Hat Satellite 5, but provide a subset of features because Puppet controls package and configuration management after registration.
- Application Life Cycle Environment
- An Application Life Cycle Environment represents a step, or stage, in a promotion path through the Software Development Life Cycle (SDLC). Promotion paths are also known as development paths. Content such as packages and Puppet modules move through life cycle environments by publishing and promoting Content Views. All Content Views have versions, which means you can promote a specific version through a typical promotion path; for example, from development to test to production. Channel cloning implements this concept in Red Hat Satellite 5.
- Attach
- The process of associating a Subscription to a Host that provides access to RPM content.
- Capsule
- A Capsule is an additional server that can be used in a Red Hat Satellite 6 deployment to facilitate content federation and distribution in addition to other localized services (Puppet Master,
DHCP,DNS,TFTP, and more). - Compute Profile
- Compute Profiles specify default attributes for new virtual machines on a compute resource.
- Compute Resource
- A Compute Resource is virtual or cloud infrastructure, which Red Hat Satellite 6 uses for deployment of hosts and systems. Examples include Red Hat Enterprise Virtualization Manager, OpenStack, EC2, and VMWare.
- Content
- Content includes software packages (RPM files) and Puppet modules. These are synchronized into the Library and then promoted into Life Cycle Environments using Content Views so that they can be consumed by Hosts.
- Content Delivery Network (CDN)
- The Content Delivery Network (CDN) is the mechanism used to deliver Red Hat content in a geographically co-located fashion. For example, content that is synchronized by a Satellite in Europe pulls content from a source in Europe.
- Content View
- A Content View is a definition of content that combines products, packages, and Puppet modules with capabilities for intelligent filtering and creating snapshots. Content Views are a refinement of the combination of channels and cloning from Red Hat Satellite 5.
- External Node Classifier
- An External Node Classifier is a Puppet construct that provides additional data for a Puppet Master to use when configuring Hosts. Red Hat Satellite 6 acts as an External Node Classifier to Puppet Masters in a Satellite deployment.
- Facter
- Facter is a program that provides information (facts) about the system on which it is run; for example, Facter can report total memory, operating system version, architecture, and more. Puppet modules enable specific configurations based on host data gathered by Facter.
- Hammer
- Hammer is a command line tool for Red Hat Satellite 6. Use Hammer to manage Red Hat Satellite 6 as a standard CLI, for scripts, and also through an interactive shell.
- Hiera
- Hiera is a key/value look-up tool for configuration data which allows keeping site-specific data out of puppet manifests.
- Host
- A Host refers to any system, either physical or virtual, that Red Hat Satellite 6 manages.
- Host Collection
- A Host Collection is equivalent to a Satellite 5 System Group, that is, a user defined group of one or more Hosts.
- Host Group
- A Host Group is a template for building a Host. This includes the content view (which defines the available RPM files and Puppet modules) and the Puppet classes to apply (which ultimately determines the software and configuration).
- Location
- A Location is collection of default settings that represent a physical place. These can be nested so that you can set up an hierarchical collection of locations. For example, you can set up defaults for "Middle East", which are refined by "Tel Aviv", which are further refined by "Data Center East", and then finally by "Rack 22".
- Library
- The Library contains every version, including the latest synchronized version, of the software that the user will ever deploy. For an Information Technology Infrastructure Library (ITIL) [1] organization or department, this is the Definitive Media Library [2] (previously named the Definitive Software Library).
- Manifest
- A Manifest transfers subscriptions from the Customer Portal to Red Hat Satellite 6. This is similar in function to certificates used with Red Hat Satellite 5.For more information about certificates and subscription types, see:
- Organization
- An Organization is an isolated collection of systems, content, and other functionality within a Satellite 6 deployment.
- Permission
- The ability to perform an action.
- Product
- A collection of content repositories. Products can be Red Hat products or newly-created products made up of software and configuration content.
- Promote
- The act of moving a content view comprised of software and configuration content from one Application Life Cycle Environment to another, such as moving from development to QA to production.
- Provisioning Template
- A Provisioning Template is a user-defined template for Kickstart files, snippets, and other provisioning actions. In Satellite 6 they provide similar functionality to Kickstart Profiles and cobbler Snippets in Red Hat Satellite 5.
- Pulp Node
- A Pulp Node is a Capsule Server component that mirrors content. This is similar to the Red Hat Satellite 5 Proxy. The main difference is that content can be staged on the Pulp Node before it is used by a Host.
- Puppet Agent
- The Puppet Agent is an agent that runs on a Host and applies configuration changes to that Host.
- Puppet Master
- A Puppet Master is a Capsule Server component that provides Puppet manifests to Hosts for execution by the Puppet Agent.
- Repository
- A Repository provides storage for a collection of content. For example, a YUM repository or a Puppet repository.
- Role
- A Role specifies a collection of permissions that are applied to a set of resources, such as Hosts.
- Smart Proxy
- A Smart Proxy is a Capsule Server component that can integrate with external services, such as
DNSorDHCP. - Smart Variable
- A Smart Variable is a configuration value that controls how a Puppet Class behaves. This can be set on a Host, a Host Group, an Organization, or a Location.
- Standard Operating Environment (SOE)
- A Standard Operating Environment (SOE) is a controlled version of the operating system on which applications are deployed.
- Subscription
- Subscriptions are the means by which you receive content and service from Red Hat.
- Synchronizing
- Synchronizing refers to mirroring content from external resources into the Red Hat Satellite 6 Library.
- Synchronization Plans
- Synchronization Plans provide scheduled execution of content synchronization.
- User Group
- A User Group is a collection of roles which can be assigned to a collection of users. This is similar to a Role in Red Hat Satellite 5.
- User
- A user is anyone registered to use Red Hat Satellite. Authentication and authorization is possible through built-in logic, through external LDAP resources, or with Kerberos.
Appendix B. Revision History
| Revision History | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Revision 2-02 | Fri 21 Nov 2014 | ||||||||
| |||||||||
| Revision 2-01 | Wed 12 Nov 2014 | ||||||||
| |||||||||
| Revision 1-0 | Wed 10 Sep 2014 | ||||||||
| |||||||||
| Revision 0-07 | Tue 9 Sep 2014 | ||||||||
| |||||||||
| Revision 0-06 | Fri 5 Sep 2014 | ||||||||
| |||||||||
| Revision 0-05 | Fri 29 Aug 2014 | ||||||||
| |||||||||
| Revision 0-04 | Fri 8 Aug 2014 | ||||||||
| |||||||||
| Revision 0-03 | Wed 9 Jul 2014 | ||||||||
| |||||||||
| Revision 0-02 | Tue 1 Jul 2014 | ||||||||
| |||||||||
| Revision 0-01 | Wed 25 Jun 2014 | ||||||||
| |||||||||
