Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 15. Managing packages


You can use Satellite to install, upgrade, and remove packages and to enable or disable repositories on hosts.

Packages actions use remote execution. For more information about running remote execution jobs, see Configuring and setting up remote jobs in Managing hosts.

15.1. Enabling and disabling repositories on hosts

Use this procedure to enable and disable repositories on hosts.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts,
  2. Select a host.
  3. On the Content tab, click the Repository sets tab.
  4. Click the vertical ellipsis to choose Override to disabled or Override to enabled to disable or enable repositories on hosts.

15.2. Installing packages on a host

Use this procedure to review and install packages on a host using the Satellite web UI. The list of packages available for installation depends on the content view and lifecycle environment assigned to the host.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select a host.
  3. On the Content tab, click the Packages tab.
  4. On the vertical ellipsis 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 Satellite web UI shows a notification for the remote execution job.

Create a body of the API request in the JSON format by following the instructions below.

API procedure

  1. Create the "job_invocation" object and place rest of the body inside this object.
  2. Create the "inputs" object with the "package" field of the string type specifying the packages you want to install. If you are specifying multiple packages, separate them with a whitespace.
  3. Create a "feature" field of the string type with value "katello_package_install".
  4. Create a "search_query" field of the string type and input a search query matching the hosts on which you want to install the packages.
  5. Optional: If you want to install packages as a specific user, create an ssh object with the following fields of the string type:

    • "effective_user" with the name of the ssh user
    • "effective_user_password" with the password of the ssh user if this password is required
  6. Optional: If you want to install packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format:

    • "start_at"- sets the time to install the packages
    • "start_before" - sets the latest time to install the packages. If it is not possible to install the packages by this time, then this action is cancelled.

    If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC.

  7. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value.
  8. Optional: If you want to install packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query".
  9. Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response.

    Example API request:

    curl https://satellite.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 Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to install the packages on the selected hosts.

Example API request body

{
  "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"
  }
}

15.3. Upgrading packages on a host

You can upgrade packages on a host in bulk in the Satellite web UI.

Procedure

  1. In the Satellite web 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 Satellite web UI shows a notification for the remote execution job.

Create a body of the API request in the JSON format by following the instructions below.

API procedure

  1. Create the "job_invocation" object and place rest of the body inside this object.
  2. Create the "inputs" object with the "package" field of the string type specifying the packages you want to update. If you are specifying multiple packages, separate them with a whitespace.
  3. Create a "feature" field of the string type with value "katello_package_update".
  4. Create a "search_query" field of the string type and input a search query matching the hosts on which you want to update the packages.
  5. Optional: If you want to update packages as a specific user, create an ssh object with the following fields of the string type:

    • "effective_user" with the name of the ssh user
    • "effective_user_password" with the password of the ssh user if this password is required
  6. Optional: If you want to update packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format:

    • "start_at"- sets the time to update the packages
    • "start_before" - sets the latest time to update the packages. If it is not possible to update the packages by this time, then this action is cancelled.

    If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC.

  7. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value.
  8. Optional: If you want to update packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query".
  9. Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response.

    Example API request:

    curl https://satellite.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 Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to update the packages on the selected hosts.

Example API request body

{
  "job_invocation" : {
    "concurrency_control" : {
      "concurrency_level" : 100
    },
    "feature" : "katello_package_update",
    "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"
  }
}

15.4. Removing packages from a host

You can remove packages from a host in the Satellite web UI.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts.
  2. Select a host.
  3. On the Content tab, click the Packages tab.
  4. Click the vertical ellipsis for the package you want to remove.
  5. Select Remove. The Satellite web UI shows a notification for the remote execution job.

Create a body of the API request in the JSON format by following the instructions below.

API procedure

  1. Create the "job_invocation" object and place rest of the body inside this object.
  2. Create the "inputs" object with the "package" field of the string type specifying the packages you want to remove. If you are specifying multiple packages, separate them with a whitespace.
  3. Create a "feature" field of the string type with value "katello_package_remove".
  4. Create a "search_query" field of the string type and input a search query matching the hosts on which you want to remove the packages.
  5. Optional: If you want to remove packages as a specific user, create an ssh object with the following fields of the string type:

    • "effective_user" with the name of the ssh user
    • "effective_user_password" with the password of the ssh user if this password is required
  6. Optional: If you want to remove packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format:

    • "start_at"- sets the time to remove the packages
    • "start_before" - sets the latest time to remove the packages. If it is not possible to remove the packages by this time, then this action is cancelled.

    If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC.

  7. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value.
  8. Optional: If you want to remove packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query".
  9. Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response.

    Example API request:

    curl https://satellite.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 Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to remove the packages on the selected hosts.

Example API request body

{
  "job_invocation" : {
    "concurrency_control" : {
      "concurrency_level" : 100
    },
    "feature" : "katello_package_remove",
    "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"
  }
}

Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.