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
- In the Satellite web UI, navigate to Hosts > All Hosts,
- Select a host.
- On the Content tab, click the Repository sets tab.
- 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
- In the Satellite web UI, navigate to Hosts > All Hosts.
- Select a host.
- On the Content tab, click the Packages tab.
- On the vertical ellipsis icon next to the upgrade button, click Install packages.
- In the Install packages window, select the package or packages that you want to install on the host.
- 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
-
Create the
"job_invocation"
object and place rest of the body inside this object. -
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. -
Create a
"feature"
field of the string type with value"katello_package_install"
. -
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. 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
-
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.
-
-
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. -
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"
. 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
- In the Satellite web UI, navigate to Hosts > All Hosts.
- Select a host.
- On the Content tab, click the Packages tab.
- Select Upgradable from the Status list.
- In the Upgradable to column, select the package version that you want to upgrade to.
- Select the packages you want to upgrade.
- 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
-
Create the
"job_invocation"
object and place rest of the body inside this object. -
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. -
Create a
"feature"
field of the string type with value"katello_package_update"
. -
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. 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
-
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.
-
-
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. -
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"
. 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
- In the Satellite web UI, navigate to Hosts > All Hosts.
- Select a host.
- On the Content tab, click the Packages tab.
- Click the vertical ellipsis for the package you want to remove.
- 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
-
Create the
"job_invocation"
object and place rest of the body inside this object. -
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. -
Create a
"feature"
field of the string type with value"katello_package_remove"
. -
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. 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
-
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.
-
-
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. -
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"
. 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" } }