Managing packages in orcharhino

You can use orcharhino to install, upgrade, and remove packages and to enable or disable repositories on hosts. Package actions use remote execution so you can manage software on hosts from a central place.

Enabling and disabling repositories on hosts

You can enable or disable repositories on a host from the orcharhino management UI to control which package sources the host can use. This affects which packages are available for installation or upgrade on the host.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts,

  2. Select a host.

  3. On the Content tab, click the Repository sets tab.

  4. Open the options menu and select Override to disabled or Override to enabled to disable or enable repositories on hosts.

Viewing upgradeable packages by using orcharhino management UI

You can use orcharhino management UI to view upgradeable packages. This can help you identify and prioritize updating hosts.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select your host.

  3. On the Content tab, select the Packages tab.

  4. Select Upgradable from the Status list.

    By default, orcharhino shows all installed packages.

Next steps

Viewing upgradeable packages by using Hammer CLI

You can use Hammer CLI to view upgradeable packages. This can help you identify and prioritize updating hosts.

Procedure
  1. Optional: Get the ID of your host:

    $ hammer host list --fields Id,Name
  2. Get a list of upgradeable packages of your host:

    $ hammer host package list --status upgradable --host-id My_Host_ID
Next steps
  • You can use Hammer CLI to upgrade packages on your host:

    $ hammer job-invocation create --feature katello_package_update --search-query "id = My_Host_ID" --inputs "package=My_Package_Name"

    For more information, see Using Hammer CLI.

Installing packages on a host

You can review and install packages on a host from the orcharhino management UI so that the host has the software it needs. Available packages depend on the content view environments assigned to the host.

Prerequisites
  • The host is assigned to a content view and lifecycle environment.

If you select multiple hosts with different operating systems, you might get unexpected results due to the different return codes of different package managers.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select a host.

  3. On the Content tab, click the Packages tab.

  4. From the options icon next to the upgrade button, click Install packages.

  5. In the Install packages window, select the package or packages that you want to install on the host.

  6. Click Install. The orcharhino management UI shows a notification for the remote execution job.

Upgrading packages on a host

You can upgrade packages on a host in bulk from the orcharhino management UI.

If you select multiple hosts with different operating systems, you might get unexpected results due to the different return codes of different package managers.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select a host.

  3. On the Content tab, click the Packages tab.

  4. Select Upgradable from the Status list.

  5. In the Upgradable to column, select the package version that you want to upgrade to.

  6. Select the packages you want to upgrade.

  7. Click Upgrade. The orcharhino management UI shows a notification for the remote execution job.

Removing packages from a host

You can remove packages from a host from the orcharhino management UI to uninstall software or resolve dependency conflicts.

If you select multiple hosts with different operating systems, you might get unexpected results due to the different return codes of different package managers.

Procedure
  1. In the orcharhino management UI, navigate to Hosts > All Hosts.

  2. Select a host.

  3. On the Content tab, click the Packages tab.

  4. Click the options icon for the package you want to remove.

  5. Select Remove. The orcharhino management UI shows a notification for the remote execution job.

Managing packages on a host by using API

You can install, upgrade, or remove packages on a host by using the orcharhino API for automation, scripts, or integration with other tools.

The example below uses the katello_package_install action to install a package. You can also use package actions katello_package_upgrade to upgrade or katello_package_remove to remove packages.

Procedure
  1. Specify the API request body in the JSON format. For example:

    {
      "job_invocation" : {
        "concurrency_control" : {
          "concurrency_level" : 100
        },
        "feature" : "katello_package_install",
        "inputs" : {
          "package" : "nano vim"
        },
        "scheduling" : {
          "start_at" : "2023-09-21T19:00:00+00:00",
          "start_before" : "2023-09-23T00:00:00+00:00"
        },
        "search_query" : "*",
        "ssh" : {
          "effective_user" : "My_Username",
          "effective_user_password" : "My_Password"
        },
        "targeting_type" : "dynamic_query"
      }
    }

    The example uses the following notable values:

    "job_invocation"

    Specifies the object which contains the API request.

    "concurrency_level"

    Optional. Limits the number of hosts on which the job is run concurrently.

    "feature"

    Specifies the action to be performed. Use "katello_package_install" to install a package, "katello_package_upgrade" to upgrade a package, or "katello_package_remove" to remove a package.

    "package"

    Specifies the packages on which the action is performed. Separate multiple packages with a whitespace.

    "scheduling"

    Optional. Specifies time boundaries for when to start the package action.

    • You can specify one or both boundaries in the ISO 8601 format.

    • The action is canceled if it is not possible to perform the package action by this time.

    • If you omit time, it defaults to 00:00:00.

    • If you omit time zone, it defaults to UTC.

    "search_query"

    Specifies the search query that selects the hosts on which you want to perform the package action.

    "ssh"

    Optional. Specifies the credentials of an SSH user, if you want to perform the package action as that user.

    "dynamic_query"

    Optional. If you supplied the "scheduling" object, you can make the search query be evaluated when the job runs by specifying the "targeting_type/dynamic_query" field.

    • This is useful if you expect the query to produce a different result at the time of the job run.

    • If you omit this field, it defaults to "static_query".

  2. Send a POST request with the created body to the /api/job_invocations endpoint of your orcharhino Server and see a formatted response. For example:

    $ curl https://orcharhino.example.com/api/job_invocations \
    -H "content-type: application/json" \
    -X POST \
    -d @Path_To_My_API_Request_Body \
    -u My_Username:My_Password \
    | python3 -m json.tool
Verification
  • In the orcharhino management UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to perform the package action on the selected hosts.

Best practices for host patching

Follow these guidelines when you patch hosts in orcharhino so errata reporting stays accurate, updates go through supported tools, and bulk patching actions run reliably.

  • Registering hosts to orcharhino requires orcharhino Client for Amazon Linux, which contains the katello-host-tools package and its dependencies. For more information, see Registering hosts by using global registration.

  • Use the orcharhino management UI to install, upgrade, and remove packages from hosts. You can update hosts with job templates using SSH and Ansible.

  • Apply errata on hosts using the orcharhino management UI. When patching packages on hosts using the default package manager, orcharhino receives a list of packages and repositories to recalculate applicable errata and available updates.

  • Modify or replace job templates to add custom steps. This allows you to run commands or execute scripts on hosts.

  • When running bulk actions on hosts, bundle them by major operating system version, especially when upgrading packages.

  • Select via remote execution – customize first to define the time when patches are applied to hosts when performing bulk actions.

  • You cannot apply errata to packages that are not part of the repositories on orcharhino and the assigned content view environments.

  • Modifications to installed packages using rpm or dpkg are sent to orcharhino with the next run of apt, yum, or zypper.

The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0").