Sample use cases

Import from RHN only

In order to import content only from RHN, the [RHSM] section should not be present in the configuration file.

Sample RHN configuration file

# main section

[main]

 

package_search_path=

    /Package Repository/OS Media/$opsware_platform

    /Package Repository/All Red Hat Linux/$opsware_platform

    /Migrated/Package Repository/Customer Independent/$opsware_platform

 

# RHN section. Contains options specific to import from RHN that apply to all channel labels

[RHN]

 

# Required options to login to Red Hat Network

rhn_user=USERNAME

rhn_pass=PASSWORD

 

channels: rhel-x86_64-server-5 rhel-x86_64-server-6

 

# HPSA recommendations:

package_path=/RHN/Packages/$channel_name

channel_path=/RHN/Channels/$parent_channel_name/$channel_name Policy

erratum_path=/RHN/Errata/$erratum_type Policies/$erratum_name

errata_path =/RHN/Errata/$parent_channel_name/$channel_name Advisory Roll-Up Policy

 

Provided that this configuration file is available at the default location (/etc/opt/opsware/rhn_import/redhat_import.conf), redhat_import can be run without any command line options to import content for the channels with the following labels as specified by the “channels” option in the above, Sample RHN configuration file.

    rhel-x86_64-server-5
    rhel-x86_64-server-6

Import from RHSM only

In order to import content only from RHSM, the [RHN] section should not be present in the configuration file.

Sample RHSM configuration file

# main section

[main]

 

package_search_path=

    /Package Repository/OS Media/$opsware_platform

    /Package Repository/All Red Hat Linux/$opsware_platform

    /Migrated/Package Repository/Customer Independent/$opsware_platform

 

# RHSM section. Contains options specific to import from CDN that apply to all content labels

[RHSM]

# To sync from Red Hat Network Satellite 6.1 or later:

; satellite_host=HOSTNAME

 

# Specify one or more paths to entitlement certificates. To specify multiple paths,

# place each path on its own line, indenting any additional lines.

certificate_paths=/etc/opt/opsware/rhn_import/8a85f981478d1fa601478e12507f36e8.pem

 

content_labels=rhel-7-server-rpms{7Server-x86_64} rhel-6-server-rpms{6Server-x86_64}

 

# HPSA recommendations:

package_path=/RHSM/Packages/$content_name

content_policy_path=/RHSM/Content/$content_name Policy

erratum_policy_path=/RHSM/Errata/$erratum_type Policies/$erratum_name

errata_policy_path =/RHSM/Errata/$content_name Advisory Roll-Up Policy

Provided that this configuration file is available at the default location, (/etc/opt/opsware/rhn_import/redhat_import.conf), redhat_import can be run without any command line options to import the CDN contents with the following labels:

    rhel-7-server-rpms{7Server-x86_64}
    rhel-6-server-rpms{6Server-x86_64}

RHSM options

This table describes the options presented in the Sample RHSM configuration file:

Option

Description

“satellite_host”

This option defines whether or not to import from Satellite 6. When this option is enabled and a valid hostname is provided, the importer will connect to the Satellite 6 and import from there. If this option is not enabled, then the importer will connect to Red Hat CDN and import content from there.

“certificate_paths”

 

This option defines the path to the entitlement certificate. The certificate must provide entitlement to content you wish to download.

You can download the certificate from the Red Hat Customer Portal after a subscription is attached to a system that is registered with Red Hat Customer Portal.

For more information about the subscription and entitlement certification process, see Entitlement Certificates.

“content_labels”

This option defines the labels of the CDN contents that need to be imported into the SA Library. See Content Labels for more details on the format of the content labels.

 

Import from both RHN and RHSM

In order to import content from both RHN and RHSM, both sections should be present in the configuration file.

Sample RHN and RHSM configuration file

# main section

[main]

 

package_search_path=

    /Package Repository/OS Media/$opsware_platform

    /Package Repository/All Red Hat Linux/$opsware_platform

    /Migrated/Package Repository/Customer Independent/$opsware_platform

 

# RHN section. Contains options specific to import from RHN that apply to all channel labels

[RHN]

rhn_user=USERNAME

rhn_pass=PASSWORD

 

channels: rhel-x86_64-server-6

 

# HPSA recommendations:

package_path=/RHN/Packages/$channel_name

channel_path=/RHN/Channels/$parent_channel_name/$channel_name Policy

erratum_path=/RHN/Errata/$erratum_type Policies/$erratum_name

errata_path =/RHN/Errata/$parent_channel_name/$channel_name Advisory Roll-Up Policy

 

[rhel-x86_64-server-extras-6]

enabled=1

; platform = Red Hat Enterprise Linux Server 6 X86_64

# RHSM section. Contains options specific to import from CDN that apply to all content labels

[RHSM]

# To sync from Red Hat Network Satellite 6.1 or later:

; satellite_host=HOSTNAME

 

# Specify one or more paths to entitlement certificates. To specify multiple paths,

# place each path on its own line, indenting any additional lines.

certificate_paths=/etc/opt/opsware/rhn_import/8a85f981478d1fa601478e12507f36e8.pem

 

content_labels=rhel-7-server-rpms{7Server-x86_64}

 

# HPSA recommendations:

package_path=/RHSM/Packages/$content_name

content_policy_path=/RHSM/Content/$content_name Policy

erratum_policy_path=/RHSM/Errata/$erratum_type Policies/$erratum_name

errata_policy_path =/RHSM/Errata/$content_name Advisory Roll-Up Policy

 

[rhel-7-server-extras-rpms{x86_64}]

enabled=1

platform=Red Hat Enterprise Linux Server 7 X86_64

Provided that this configuration file is available at the default location (/etc/opt/opsware/rhn_import/redhat_import.conf), redhat_import can be run without any command line options to import content for the following RHN channels and RHSM contents:

RHN:

    rhel-x86_64-server-6
    rhel-x86_64-server-extras-6

RHSM:

    rhel-7-server-rpms{7Server-x86_64}
    rhel-7-server-extras-rpms{x86_64}

Some things to note:

  • The RHN channels have a parent-child relationship. In this example “rhel-x86_64-server-extras-6” is a child of “rhel-x86_64-server-6”. By default, child channels are imported under the platform of the parent channel in the SA Library. This is why the “platform” option is commented out under “rhel-x86_64-server-extras-6” section and the import still works fine.
  • The CDN contents do not have any parent-child relationship. As a result of this any content that is not mapped by default to one of the SA-supported platforms needs to have its own content section and define the “platform” option. This is the case for “rhel-7-server-extras-rpms{x86_64}” above. Failure to define the “platform” option for such contents will result in the content label being ignored during import with a warning message being displayed, similar to the following:

Unable to process content label rhel-7-server-extras-rpms{x86_64}. No platform could be associated with this label. This content label will be dropped. If you need to import this content, add the 'platform' option to the configuration file.

Ignoring unknown content label rhel-7-server-extras-rpms{x86_64}