Use > Software management > Managing software packages > Deploying RPM packages > Automatically updating RPMs in a software policy

Automatically updating RPMs in a software policy

With SA, you can set up a software policy to automatically update the version and/or release of its enclosed RPMs. In policies that contain RPMs, the Auto-Update Policy setting is available for each RPM, with two automatic-update options: Release Only and Version or Release.

The selection of one of these options will determine whether the RPM listed in the policy will be automatically updated for newer versions of an RPM, or just for newer releases of an RPM. In addition to specifying this setting, for the policy update to occur, the newer RPM must also be placed in the same folder as the RPM that is specified in the software policy.

Choosing an auto-update policy option

If you enable one of these automatic update options in the software policy, and then save the policy, the policy will be instantaneously updated when a newer RPM is moved to the folder.

  • This update only occurs if the newer RPM is added to the folder after the auto-update option is enabled.
  • The policy will reflect the most recent version or release of the RPMs in the specified folder, respective of the setting:
    • If the Version or Release option is selected, the automatic policy update occurs when either a newer version or release of the RPM is added to the specified folder. Use this option if you want to update the policy for any RPM update, even new versions of the same release.
    • If the Release only option is selected, the automatic policy update occurs only when a newer release of the RPM is added to the specified folder.
    • The important distinction in the Release only option is that the policy will only recognize the new RPM as an update if the RPM is a new release; not merely a new version of the same release. When this option is selected, adding a newer version of an RMP to the specified folder will not update the policy.
    • Use this option if you only want to update the policy for major RPM releases and you do not want to update the policy for the minor release versions.
    • If the None option is selected, RPMs will not be automatically updated. This is the default setting.

    SA will update the RPM in this policy only if the newer release or version is placed in the same folder as the RPM specified in the software policy.

    The Auto-Update Policy setting applies only to this RPM in this Policy. It does not apply to this RPM in other policies, nor does it apply to other RPMs in this policy.

Updating the RPM folder

When one of the Auto-Update Policy options is enabled, the RPM in the software policy will be automatically updated the next time a newer RPM is placed in the same folder as the older RPM that is already specified in the policy. An RPM can be placed in the specified folder in a few different ways:

  • A new RPM unit can be created in the specified folder using the SA Client import action or an import script (rhn_import, CBT).
  • An existing RPM can be moved into the specified folder using either the SA Client or the SA API

Regardless of the method used to place the newer RPM file in the specified folder, the software policy that references that RPM in that directory will be automatically updated based on this setting in the software policy.

Automatic RPM update requirements

An RPM within a software policy is automatically updated if both of the following conditions are met:

  • The Auto-Update Policy setting for the RPM in the software policy must be set to Release Only or Version or Release.
  • The newer RPM must be placed in the same folder as the older RPM that is already specified in the software policy.
    • If the Release option is selected, the newer RPM must be a new release, not just a version update, in order for the software policy to get updated.
    • If the Version or Release option is selected, the newer RPM can be a new release or even just a newer version of the same release.

Reminders

  • Updating the software policy with a newer RPM does not—by itself—install or upgrade the server. The server upgrade is performed only during remediation.
  • To upgrade the RPMs on a managed server, the server must have a software policy attached that contains the updated RPM, and then the server must be remediated.

Specifying the Auto-Update Policy setting for an RPM in a software policy

  1. In a software policy containing RPMs, navigate to Policy Items and select one of the RPMs. The content pane will display installation and upgrade options for this RPM.

    Note the folder location of the RPM.
  2. In the Auto-Update Policy setting, select either Release Only or Version or Release.
  3. Click File > Save to save the policy.
  4. Place a newer RPM into the same folder as the RPM specified in the software policy.

    The RPM can be placed into the folder via any supported method—by importing, moving or copying the file into the folder using the SA Client, a script, or a command line action.
  5. The software policy will automatically be updated to reference the newer RPM according to the specified setting.

    This process will update the software policy contents so that it reflects the newer RPMs. This process does not upgrade the servers. To upgrade the servers, you must remediate the servers with the software policy attached.
  6. The next time a server is remediated with this updated policy attached, it will upgrade the server to the newer RPM version or release.

See Setting installation and update options for a RPM for information on additional options. See Upgrade options for an RPM for an explanation of how these options interact.