rhn_import creates three types of Software Policies:
Channel Based: A channel-based Software Policy reflects a particular channel. The latest versions of packages which appear in a channel at the time rhn_import is run are imported into Server Automation and then associated with a channel-based Software Policy. Such policies are useful in combination with child channels, where a child channel corresponds to a product. e.g, a policy named "Red Hat Application Server v. 2 (AS v. 4 for i386)" might be created from the channel label "rhel-4-as-i386-rhaps-2". Channel-based Software Policies are also useful to create point-in-time snapshots of a particular channel in order to deploy identical servers even if Red Hat has since modified the channel’s packages.
-
Policies are used to mirror the standard RHN (up2date) methodology.
-
Allows you to keep up-to-date with the current state of packages in RHN
-
Will contain the most recent version of the RPMs based on the last run of the rhn_import tool.
-
These policies provide the most simple methodology for keeping your RHEL servers up-to-date.
-
If all you want to do is keep your server up-to-date, just attach it to this policy.
-
Each time you run RHN Import, the policy will be updated, and you can remediate any servers attached to the policy to bring them up-to-date w/respect to the channel.
Erratum Based: An erratum-based Software Policy reflects a particular erratum. All packages which are associated with the erratum are imported into Server Automation and then associated with the erratum-based Software Policy. Various other details of the erratum are also used to populate the policy’s description. Such policies are useful to ensure servers remain up-to-date.
Errata Roll Up: An errata roll-up Software Policy reflects multiple erratum-based Software Policies. This policy is created as a template. All erratum-based policies (for a particular channel or channels) are associated with an errata roll-up Software Policy. Such policies are useful to ensure servers remain up-to-date by allowing servers to be easily associated with all available errata.
-
Policies, will contain every single rpm that has been released in the specified Red Hat release.
-
Good for importing all RPMs into your core.
-
Not often too useful for applying to a managed server because they can a very large number of RPMs which can increase the amount of time needed to remediate your devices.
Example:
Weekly RHN policy creation using the rhn_import channel configurations.
In your environment you would like to create a point-in-time snapshot of the RPM packages each week. This is one way you may be able to accomplish that task. Please run "/opt/opsware/rhn_import/bin/rhn_import –manual" for more details on the options available for customizing rhn_import.
Relevant Config File Content (This is only a portion of the entire configuration file):
Default File Location: /etc/opt/opsware/rhn_import/rhn_import.conf
<snip> …
# If the channels option is not specified, then all SA supported
# top-level (parent) RHN channels are enabled, plus any channels which have
# their own [channel] sections below. An explicit list of channels may be
# given separated by spaces and/or newlines:
; channels:
; LABEL1
; LABEL2
; rhel-i386-as-4-extras
; …
channels: rhel-i386-as-4
# —————————————————————————-
# Options below this point serve as defaults for any channels that do not
# override the options in their own [channel label] section
#
# Opsware recommendations:
package_path=/RHN/Packages/$channel_name
# Channel_Path Configuration for weekly updated RHN Policies
# Comment out the default "channel_path" configuration
;channel_path=/RHN/Channels/$parent_channel_name/$channel_name Policy
# Create a new default "channel_path" configuration
# Keep in mind that your directory (folder) path can be custom to your environment
channel_path=/RHN/Channels/$parent_channel_name/$Y-$m-$d $channel_name Policy
# This will result in your channel policies being created with the date that rhn_import was run
# If you need this to be run on a weekly basis it will need to be added to the root user’s cron jobs
# Keep erratum_path set to default
erratum_path=/RHN/Errata/$erratum_type Policies/$erratum_name
# Comment out unnecessary Roll-Up Policy
;errata_path =/RHN/Errata/$parent_channel_name/$channel_name Advisory Roll-Up Policy
# Leave package_search_path set to default
package_search_path=
/Package Repository/OS Media/$opsware_platform
/Package Repository/All Red Hat Linux/$opsware_platform
/Migrated/Package Repository/Customer Independent/$opsware_platform
<snip> …
Example crontab entry:
You will need to create the appropriate cron entry in order to have your rhn_import run weekly and create weekly RHN policies.
# Add something similar to the following to your root crontab
/opt/opsware/rhn_import/bin/rhn_import –verbose –conf=/etc/opt/opsware/rhn_import/rhn_import.conf >> /var/log/rhn_import.out 2>&1
Resulting Policy Creation:
When you’ve configured your rhn_import.conf as described above you will result in the creation of a new policy with in the HP Server Automation Java Client. Based on this example configuration the following would be created over the period of a few weeks.
Policy Location: (Library -> "By Folder")
- Each policy created will contain the current RPMs per the RHN data on the date that the rhn_import command was run successfully.
- This path and naming convention is easily customized by changing the configuration file variables.
Week #1: /RHN/Channels/Red Hat Enterprise Linux AS (v. 4 for 32-bit x86)/2009-07-12 Red Hat Enterprise Linux AS (v. 4 for 32-bit x86) Policy
Week #2: /RHN/Channels/Red Hat Enterprise Linux AS (v. 4 for 32-bit x86)/2009-07-19 Red Hat Enterprise Linux AS (v. 4 for 32-bit x86) Policy
Week #3: /RHN/Channels/Red Hat Enterprise Linux AS (v. 4 for 32-bit x86)/2009-07-26 Red Hat Enterprise Linux AS (v. 4 for 32-bit x86) Policy