Home > Opsware SAS > How do I keep my Red Hat Linux servers up to date with HP Server Automation

How do I keep my Red Hat Linux servers up to date with HP Server Automation


Technical document information


Title:

How do I keep my Red Hat Linux servers up to date with HP Server Automation


Document ID:

KM740084


Product:

Server Automation


Version:


Updated:

2009-May-18

HP Server Automation(SA) has a feature that allows integration with your Red Hat Network(RHN) account to allow you to import content from RHN into your SA environment.  See the "Importing RPMs from Red Hat Network using rhn_import" (KM538343) Article for more details on using the rhn_import utility to import your RHN subscription content.

The rhn_import utility allows you to automatically create Red Hat Linux Software policies from the imported content. These automatically generated policies contain the RPMs that you need to keep your Red Hat Enterprise Linux(RHEL) servers up to date. This document contains information that may help you decide how to best use this content in your environment.

Solution

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.

  • Policies are used to apply one specific erratum that may be required in your environment.

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

Categories: Opsware SAS Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.
*
Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 3,211 bad guys.

Powered by WP Robot

Stop SOPAPowered by Yahoo! Answers