이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 15. Managing packages


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

15.1. Enabling and disabling repositories on hosts

Use this procedure to enable and disable repositories on hosts for Satellite.

Procedure

  1. In the Satellite web UI, navigate to Hosts > All Hosts,
  2. Select the host name.
  3. Click the Content tab.
  4. Click the Repository Sets tab.
  5. 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 and select the host you want to install packages on.
  2. On the Content tab, select the Packages tab.
  3. On the vertical ellipsis icon next to the upgrade button, click Install Packages.
  4. In the Install packages window, select the package or packages that you want to install on the host.
  5. Click Install.

By default, the packages are installed using remote execution. For more information about running remote execution jobs, see Configuring and Setting up Remote Jobs in Managing hosts.

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. Click the name of the host you want to modify.
  3. Click the Content tab, then click the Packages tab.
  4. Select Upgradable from the Status list.
  5. Select upgrade version from the dropdown menu in Upgradable to column where applicable.
  6. Select the packages you want to upgrade.
  7. Click Upgrade. You get a REX job notification once the remote execution job is complete.

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. Click the name of the host you want to modify.
  3. Click the Content tab, then click the Packages tab.
  4. Click the vertical ellipsis for the package you want to remove and select Remove. You get a REX job notification once the remote execution job is complete.

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

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.