### Example HTTP Path for Installation Media Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/preparing-provisioning-content Use this example path when creating installation media in the Satellite web UI. It supports variables for system architecture and operating system versions. ```shell http://download.example.com/centos/$version/Server/$arch/os/ ``` -------------------------------- ### Get Help for Satellite Installer Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/overview_concepts_and_deployment_considerations/help-resources-for-using-cli-in-satellite Run `satellite-installer --full-help` on your Satellite Server or Capsule Server to get comprehensive help for installing and configuring Satellite plugins. ```bash satellite-installer --full-help ``` -------------------------------- ### Combine Default Templates for Nginx Installation and Start Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_configurations_by_using_ansible_integration/Job_Template_Examples_and_Extensions_ansible This template combines default package and service templates to install and start the nginx service on clients. It specifies parameter values directly. ```erb <%= render_template 'Package Action - Script Default', :action => 'install', :package => 'nginx' %> <%= render_template 'Service Action - Script Default', :action => 'start', :service_name => 'nginx' %> ``` -------------------------------- ### Install cloud-init packages Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/building_cloud_images_provisioning Install the necessary packages for cloud-init functionality, which helps in initializing cloud instances. ```bash # yum install cloud-utils-growpart cloud-init ``` -------------------------------- ### Enable and Start HAProxy Service Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/configuring_capsules_with_a_load_balancer/installing-and-configuring-the-load-balancer Enables the HAProxy service to start automatically on boot and starts the service immediately. ```bash # systemctl enable --now haproxy ``` -------------------------------- ### Start and Enable Grafana and PCP Proxy Services Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/monitoring_satellite_performance/setting-up-the-metrics-monitoring-solution_monitoring Start and enable the Grafana web service and the PCP proxy service to ensure they are running and will start on boot. ```bash # systemctl enable --now pmproxy grafana-server ``` -------------------------------- ### Install Identity Management Client Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/integrating_provisioning_infrastructure_services/configuring-dns-integration Installs the Identity Management client, prompting for necessary configuration details. ```bash # ipa-client-install ``` -------------------------------- ### Install PGBench Utility Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/tuning_performance_of_red_hat_satellite/Configuring_Project_for_Performance_performance-tuning Install the PGBench utility to measure raw PostgreSQL performance. This is a prerequisite for benchmarking database performance. ```bash # dnf install postgresql-contrib ``` -------------------------------- ### Install virt-install and libguestfs-tools Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/provisioning_hosts/index Installs command-line tools for installing virtual machines and utilities for interacting with virtual machine disk images. ```bash # yum install virt-install libguestfs-tools-c ``` -------------------------------- ### List Installation Media Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/hammer_reference/hammer-medium Lists all available installation media. You can filter, sort, and paginate the results. ```APIDOC ## hammer medium list ### Description List all installation media ### Usage ``` # hammer medium list [OPTIONS] ``` ### Options * `--fields LIST` - Show specified fields or predefined field sets only. (See below) * `--location VALUE` - Set the current location context for the request. * `--location-id NUMBER` - Scope by locations. * `--location-title VALUE` - Set the current location context for the request. * `--operatingsystem VALUE` - Operating system title. * `--operatingsystem-id NUMBER` - ID of operating system. * `--order VALUE` - Sort and order by a searchable field, e.g. ` DESC`. * `--organization VALUE` - Set the current organization context for the request. * `--organization-id NUMBER` - Scope by organizations. * `--organization-title VALUE` - Set the current organization context for the request. * `--page NUMBER` - Page number, starting at 1. * `--per-page VALUE` - Number of results per page to return, `all` to return all results. * `--search VALUE` - Filter results. * `-h`, `--help` - Print help ### Predefined field sets ExpandFIELDS| ALL| DEFAULT| THIN ---|---|---|--- Id | x | x | x Name | x | x | x Path | x | x | ### Search and order fields * `family` – string * `id` – integer * `location` – string * `location_id` – integer * `name` – string * `organization` – string * `organization_id` – integer * `path` – string ``` -------------------------------- ### Start and Enable PostgreSQL Service Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/administering_red_hat_satellite/migrating_from_internal_databases_to_external_databases_admin Starts the PostgreSQL service immediately and configures it to start automatically on system boot. ```bash # systemctl enable --now postgresql ``` -------------------------------- ### Install the Satellite Server package Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_connected_network_environment/installing-satellite-server Install the main Satellite Server package using the `dnf install satellite` command after ensuring all system packages are up to date. ```bash # dnf install satellite ``` -------------------------------- ### Filebucket Example Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/installing_satellite_server_in_a_disconnected_network_environment/index An example log entry showing how `foreman-installer` uses Filebucket to back up configuration files before making changes. ```text /Stage[main]/Dhcp/File[/etc/dhcp/dhcpd.conf]: Filebucketed /etc/dhcp/dhcpd.conf to puppet with sum 622d9820b8e764ab124367c68f5fa3a1 ``` -------------------------------- ### List Available Media with Hammer CLI Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/preparing-provisioning-content Use the hammer CLI to list available media, which can help verify the Kickstart tree setup. Replace '_My_Organization_' with your actual organization name. ```bash $ hammer medium list --organization "_My_Organization_" ``` -------------------------------- ### Get Collection Example Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This example shows how to retrieve a collection of objects (e.g., a list of domains) from the Satellite API. ```APIDOC ## GET /api/domains ### Description Retrieves a collection of objects, such as a list of domains, from the Satellite API. ### Method GET ### Endpoint https://_satellite.example.com_/api/domains ### Parameters No specific parameters are detailed for this collection endpoint in the source, but general query parameters for pagination, search, and sort might apply. ### Request Example ```bash curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/domains \ | python3 -m json.tool ``` ### Response #### Success Response (200) - **total** (integer) - The total number of objects available. - **subtotal** (integer) - The number of objects returned with the current query parameters. - **page** (integer) - The current page number. - **per_page** (integer) - The maximum number of objects returned per page. - **search** (null) - The search string used, if any. - **sort** (object) - An object containing sort parameters: - **by** (null) - The field by which the collection is sorted. - **order** (null) - The sort order (ASC or DESC). - **results** (array) - A list of objects matching the query. - Each object in the results array contains fields like `id`, `name`, `fullname`, `dns_id`, `created_at`, and `updated_at`. #### Response Example ```json { "total": 3, "subtotal": 3, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [ { "id": 23, "name": "qa.lab.example.com", "fullname": "QA", "dns_id": 10, "created_at": "2024-08-13T09:02:31Z", "updated_at": "2024-08-13T09:02:31Z" }, { "id": 25, "name": "dev.lab.example.com", "fullname": "DEVEL", "dns_id": 8, "created_at": "2024-08-13T08:32:48Z", "updated_at": "2024-08-14T07:04:03Z" }, { "id": 32, "name": "hr.lab.example.com", "fullname": "HR", "dns_id": 8, "created_at": "2024-08-16T08:32:48Z", "updated_at": "2024-08-16T07:04:03Z" } ] } ``` ``` -------------------------------- ### Get a Single Object Using GET HTTP Method Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/using_the_satellite_rest_api/api-syntax Retrieve a single object by its unique identifier using a GET request. This example fetches a specific domain. ```bash $ curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/domains/23 \ | python3 -m json.tool ``` -------------------------------- ### List Installation Media using Hammer CLI Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/hammer_reference/hammer-medium Use this command to list all available installation media. You can filter, sort, and paginate the results. ```bash # hammer medium [OPTIONS] ``` -------------------------------- ### Manual Puppet Module Installation Output Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/managing_configurations_by_using_puppet_integration/index This is an example of the output you might see after successfully installing a Puppet module from the Puppet Forge. ```text Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ... Notice: Created target directory /etc/puppetlabs/code/environments/production/modules Notice: Downloading from https://forge.puppet.com ... Notice: Installing -- do not interrupt ... /etc/puppetlabs/code/environments/production/modules |-| puppetlabs-ntp (v8.3.0) |-- puppetlabs-stdlib (v4.25.1) [/etc/puppetlabs/code/environments/production/modules] ``` -------------------------------- ### Display Full Satellite Installer Help Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/installing_satellite_server_in_a_connected_network_environment/index Use this command to view all advanced options for the `satellite-installer` utility. This is useful for complex or custom installations. ```bash satellite-installer --scenario satellite --full-help ``` -------------------------------- ### Display satellite-installer help options Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_connected_network_environment/installing-satellite-server Use the `--help` argument with `satellite-installer` to view commonly used options and their default values. For a comprehensive list of advanced options, use `--full-help`. ```bash satellite-installer --scenario satellite --help ``` ```bash satellite-installer --scenario satellite --full-help ``` -------------------------------- ### Get Single Object Example Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This example demonstrates how to retrieve a single object (e.g., a domain) from the Satellite API using its unique identifier. ```APIDOC ## GET /api/domains/:id ### Description Retrieves a single object, such as a domain, from the Satellite API using its unique identifier. ### Method GET ### Endpoint https://_satellite.example.com_/api/domains/:id ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the object to retrieve. ### Request Example ```bash curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/domains/23 \ | python3 -m json.tool ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the object. - **name** (string) - The name of the object. - **fullname** (string) - The full name of the object. - **dns_id** (integer) - The DNS identifier associated with the object. - **created_at** (string) - The timestamp when the object was created. - **updated_at** (string) - The timestamp when the object was last updated. #### Response Example ```json { "id": 23, "name": "qa.lab.example.com", "fullname": "QA", "dns_id": 10, "created_at": "2024-08-13T09:02:31Z", "updated_at": "2024-08-13T09:02:31Z" } ``` ``` -------------------------------- ### Retrieve Data with GET Method Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/using_the_satellite_rest_api/api-syntax Use the GET HTTP method to retrieve data about an existing entry or resource. This example shows how to request the number of registered hosts. ```APIDOC ## GET /api/hosts ### Description Retrieves a list of hosts and their associated information. ### Method GET ### Endpoint https://_satellite.example.com_/api/hosts ### Parameters #### Query Parameters - **search** (string) - Optional - Filter results based on a search term. - **sort_by** (string) - Optional - Field to sort results by. - **order** (string) - Optional - Order of sorting (asc or desc). ### Request Example ```bash curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/hosts \ | python3 -m json.tool ``` ### Response #### Success Response (200) - **total** (integer) - The total number of hosts matching the query. - **subtotal** (integer) - The number of hosts returned in this response. - **page** (integer) - The current page number. - **per_page** (integer) - The maximum number of hosts per page. - **search** (null) - The search term used, if any. - **sort** (object) - Information about the sorting applied. - **by** (null) - The field by which results were sorted. - **order** (null) - The order of sorting. - **results** (array) - A list of host objects (output truncated). #### Response Example ```json { "total": 2, "subtotal": 2, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": _output truncated_ } ``` ``` -------------------------------- ### Set up Containers on Satellite Server Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_disconnected_network_environment/performing-additional-configuration Execute this command to set up containers on your Satellite Server. Ensure prerequisites like skopeo are installed and the Satellite ISO is mounted. ```bash # /media/sat6/setup_containers ``` -------------------------------- ### Install Satellite Server with External PostgreSQL Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/installing_satellite_server_in_a_connected_network_environment/index This command initiates the installation of Satellite Server configured to use an external PostgreSQL server. Additional options may be required depending on your external database setup. ```bash # satellite-installer --scenario satellite \ --foreman-initial-organization "_My_Organization_" \ --foreman-initial-location "_My_Location_" \ --foreman-initial-admin-username _admin_user_name_ \ --foreman-initial-admin-password _admin_password_ \ --foreman-postgresql-install false \ --foreman-postgresql-hosts "external_hostname.example.com" \ --foreman-postgresql-user "foreman" \ --foreman-postgresql-password "foreman_password" ``` -------------------------------- ### Create a User via API Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/using_the_satellite_rest_api/api-requests-in-various-languages This example shows how to create a new user account using a POST request. It includes necessary headers, authentication, and the JSON payload for the new user's details. ```bash $ curl \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --request POST \ --user _My_User_Name_:_My_Password_ \ --data "{\"firstname\":\"_Test Name_\",\"mail\":\"_test@example.com_\",\"login\":\"_test_user_\",\"password\":\"_password123_\",\"auth_source_id\":_1_}" \ https://_satellite.example.com_/api/users \ | python3 -m json.tool ``` -------------------------------- ### Example Output of capsule-certs-generate Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/installing_capsule_server/index This is an example of the `satellite-installer` command that is returned by `capsule-certs-generate`. This command is used to deploy the certificate to your Capsule Server and is unique to each Capsule Server. ```bash _output omitted_ satellite-installer --scenario capsule \ --certs-tar-file "/root/_capsule.example.com_-certs.tar" \ --foreman-proxy-foreman-base-url "https://_satellite.example.com_" \ --foreman-proxy-trusted-hosts "_satellite.example.com_" \ --foreman-proxy-trusted-hosts "_capsule.example.com_" \ --foreman-proxy-oauth-consumer-key "_My_OAuth_Consumer_Key_" \ --foreman-proxy-oauth-consumer-secret "_My_OAuth_Consumer_Secret_" ``` -------------------------------- ### Generate Containerfile Install Command with Satellite API Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_hosts/package-mode-and-image-mode-hosts Generate a Containerfile install command for transient packages on an image mode host by sending a GET request to the Satellite API. Replace `:host_id` with the actual host ID. ```http GET /api/hosts/:host_id/transient_packages/containerfile_install_command ``` -------------------------------- ### Create Symbolic Links and Set Permissions Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/provisioning_hosts/index Manually create symbolic links for boot files and set read permissions for TFTP and HTTPBoot clients. ```bash ln -s grubx64.efi boot.efi ln -s shimx64.efi boot-sb.efi chmod 644 grubx64.efi shimx64.efi ``` -------------------------------- ### Retrieving a list of users Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This example demonstrates how to retrieve a list of Satellite users using a GET request to the /api/users endpoint. ```APIDOC ## GET /api/users ### Description Retrieves a list of Satellite users. The response is paginated and includes metadata. ### Method GET ### Endpoint https://_satellite.example.com_/api/users ### Request Example ```bash curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/users \ | python3 -m json.tool ``` ### Response #### Success Response (200) - **page** (integer) - The current page number of the results. - **per_page** (integer) - The number of results per page. - **results** (array) - A list of user objects. - **search** (any) - Search parameters used (null if not applicable). - **sort** (object) - Sorting parameters used. - **by** (any) - The field to sort by. - **order** (any) - The sort order. - **subtotal** (integer) - The number of results on the current page. - **total** (integer) - The total number of results available. #### Response Example ```json { "page": 1, "per_page": 20, "results": [ { "admin": false, "auth_source_id": 1, "auth_source_name": "Internal", "created_at": "2024-09-21 08:59:22 UTC", "default_location": null, "default_organization": null, "description": "", "effective_admin": false, "firstname": "", "id": 5, "last_login_on": "2024-09-21 09:03:25 UTC", "lastname": "", "locale": null, "locations": [], "login": "test", "mail": "test@example.com", "organizations": [ { "id": 1, "name": "Default Organization" } ], "ssh_keys": [], "timezone": null, "updated_at": "2024-09-21 09:04:45 UTC" } ], "search": null, "sort": { "by": null, "order": null }, "subtotal": 2, "total": 2 } ``` ``` -------------------------------- ### Unmount ISO Images Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_disconnected_network_environment/installing-satellite-server After installation, unmount the ISO images that were used during the setup process. This is a standard post-installation cleanup step. ```bash # umount /media/sat6 # umount /media/rhel ``` -------------------------------- ### Install PostgreSQL Server and Contrib Packages Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/administering_red_hat_satellite/migrating_from_internal_databases_to_external_databases_admin Installs the PostgreSQL server and its associated contrib packages on a new database host. Ensure base OS repositories are enabled and sufficient disk space is available. ```bash # dnf install postgresql-server postgresql-contrib ``` -------------------------------- ### Get information for a specific host using curl Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This example demonstrates how to fetch detailed information for a particular host by its certname. Ensure you replace the placeholder hostname and credentials. ```bash $ curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/v2/hosts/_satellite.example.com_ \ | python3 -m json.tool ``` -------------------------------- ### Run Satellite Installer with Noop Argument Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/installing_satellite_server_in_a_disconnected_network_environment/index Use the `--noop` argument with the `satellite-installer` utility to simulate installation and identify potential changes without making any modifications. This is useful for determining future changes and avoiding overwriting manual configurations. ```bash # satellite-installer --noop ``` -------------------------------- ### Retrieve a List of Users via API Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/using_the_satellite_rest_api/api-requests-in-various-languages This example demonstrates a basic GET request to retrieve a list of users from the Satellite API. The response is piped to `json.tool` for pretty-printing. ```bash $ curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/users \ | python3 -m json.tool ``` -------------------------------- ### Boot Host from Device Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/hammer_reference/hammer-host Boots a host from a specified device. Valid devices include 'disk', 'cdrom', 'pxe', and 'bios'. Context can be set using organization and location parameters. ```bash # hammer host boot --name "myhost.example.com" --device pxe --organization "MyOrg" ``` -------------------------------- ### View Documentation for a Specific Satellite Ansible Module Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_ansible_collection/index To get detailed information about a particular module, including its parameters and usage, use this command. Ensure the Satellite Ansible Collection is installed first. ```bash # ansible-doc redhat.satellite._Module_Name_ ``` -------------------------------- ### Create a Test File in Local Repository Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_content/managing-custom-file-type-content Creates a sample file within the local custom repository directory. This file will be included in the manifest. ```bash # touch /var/lib/pulp/_local_repos_/_my_file_repo_/_test.txt_ ``` -------------------------------- ### List registered hosts using curl Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This example shows how to retrieve a list of all registered hosts on the Satellite Server using a GET request. Replace placeholders with your actual credentials and server hostname. ```bash $ curl \ --request GET \ --user _My_User_Name_:_My_Password_ \ https://_satellite.example.com_/api/v2/hosts \ | python3 -m json.tool ``` -------------------------------- ### Package Management API Operations Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_hosts/managing-packages-in-satellite This section describes how to use the Satellite API to install, upgrade, or remove packages on hosts. It includes an example of the API request body and the curl command for invoking the job. ```APIDOC ## POST /api/job_invocations ### Description This endpoint allows for the invocation of package management jobs on hosts via the Satellite API. You can install, upgrade, or remove packages by specifying the appropriate feature in the job invocation. ### Method POST ### Endpoint /api/job_invocations ### Request Body #### job_invocation (object) - Required Specifies the object which contains the API request details. - **concurrency_control** (object) - Optional - **concurrency_level** (integer) - Limits the number of hosts on which the job is run concurrently. - **feature** (string) - Required - 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. - **inputs** (object) - Required - Specifies the packages on which the action is performed. - **package** (string) - Required - Separate multiple packages with a whitespace. - **scheduling** (object) - Optional - Specifies time boundaries for when to start the package action. - **start_at** (string) - Specifies the start time in ISO 8601 format. - **start_before** (string) - Specifies the time before which the action must start, in ISO 8601 format. - **search_query** (string) - Required - Specifies the search query that selects the hosts on which you want to perform the package action. - **ssh** (object) - Optional - Specifies the credentials of an SSH user. - **effective_user** (string) - The username for SSH authentication. - **effective_user_password** (string) - The password for SSH authentication. - **targeting_type** (string) - Optional - Specifies how the search query should be evaluated. Use `"dynamic_query"` to evaluate the search query when the job runs. Defaults to `"static_query"`. ### Request Example ```json { "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" } } ``` ### Example Usage (curl) ```bash 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 ``` ### Response #### Success Response (200) Returns a JSON object detailing the job invocation status and details. ``` -------------------------------- ### Create Granular Permission Filter with Hammer CLI Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/administering_red_hat_satellite/creating-and-managing-roles Use this command to create a filter that limits permissions to specific resources. This example adds a permission to the 'qa-user' role for content views starting with 'ccv'. ```bash $ hammer filter create \ --permission-ids 91 \ --search "name ~ ccv*" \ --role qa-user ``` -------------------------------- ### Display Satellite Installer Help Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_disconnected_network_environment/installing-satellite-server Use this command to display the most commonly used options and their default values for the satellite-installer utility. ```bash # satellite-installer --scenario satellite --help ``` -------------------------------- ### Example of data collected in a minimal report Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_hosts/monitoring-hosts-by-using-red-hat-lightspeed-in-cloud This JSON structure illustrates the data included in a minimal report when Red Hat Satellite is configured for limited data collection. It excludes hostnames, IP addresses, and installed packages. ```json { "report_slice_id": "de92044d-9d77-4895-83c4-a476f5020519", "hosts": [ { "account": "123456789", "subscription_manager_id": "9fc621b9-08c3-4085-a749-bfed38c3052e", "insights_id": "9fc621b9-08c3-4085-a749-bfed38c3052e", "bios_uuid": "203F234F-58C7-4237-8DDF-A17A2838A66C", "bios_vendor": "SeaBIOS", "bios_version": "1.16.1-1.el9", "arch": "x86_64", "infrastructure_type": "virtual", "system_profile": { "installed_products": [ { "name": "Red Hat Enterprise Linux for x86_64", "id": "479" } ], "cores_per_socket": 1, "system_memory_bytes": 3836579840, "number_of_cpus": 1, "number_of_sockets": 1 }, "cpu_socket(s)": "1" } ] } ``` -------------------------------- ### PXELinux Directory Layout Example Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/boot-loader-management-and-file-structure This example shows the typical directory structure for PXELinux files managed by Red Hat Satellite within the TFTP boot directory. ```shell # tree /var/lib/tftpboot/ /var/lib/tftpboot/ ├── pxelinux.0 ├── ldlinux.c32 ├── menu.c32 ├── chain.c32 └── pxelinux.cfg/ ├── default └── 01-52-54-00-ab-cd-ef ``` -------------------------------- ### Install PostgreSQL Server and Contrib Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/administering_red_hat_satellite/index Installs the PostgreSQL server and its associated contrib packages on a new database server. Ensure base OS repositories are enabled and sufficient disk space is available. ```bash # dnf install postgresql-server postgresql-contrib ``` -------------------------------- ### Run MCP server for Satellite Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_content/Managing_Errata_content-management This command starts the MCP server, enabling AI applications to create remote execution jobs in Satellite for errata installation. Ensure the correct CA bundle path and Satellite URL are provided. ```bash $ podman run --interactive --tty --publish 127.0.0.1:8080:8080 \ --volume _Path_to_My_CA_Bundle_:/app/ca.pem:ro,Z \ registry.redhat.io/satellite/foreman-mcp-server-rhel9:6.18 \ --foreman-url https://_satellite.example.com_ \ --allowed-rex-features katello_errata_install,katello_errata_install_by_search ``` -------------------------------- ### Example File Access via HTTPBoot Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/boot-loader-management-and-file-structure Demonstrates how a specific boot loader file located on the filesystem is accessed through the HTTPBoot service. This clarifies the relationship between the filesystem path and the HTTP URL. ```text http://_capsule.example.com_/httpboot/pxegrub2/grubx64.efi ``` -------------------------------- ### Python Script for Satellite API Requests Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/using_the_satellite_rest_api/api-requests-in-various-languages This script demonstrates how to perform GET and POST requests to the Satellite API for managing organizations and life cycle environments. It includes setup for API endpoints, credentials, and error handling for missing modules. ```Python #!/usr/bin/env python3 import json import sys try: import requests except ImportError: print("Please install the python-requests module.") sys.exit(-1) HOSTNAME = "satellite.example.com" # URL for the API to your Satellite Server FOREMAN_API = f"https://{HOSTNAME}/api/" KATELLO_API = f"https://{HOSTNAME}/katello/api/v2/" POST_HEADERS = {'content-type': 'application/json'} # Default credentials to login to Satellite 6 USERNAME = "admin" PASSWORD = "password" ENVIRONMENTS = ["Development", "Testing", "Production"] def get_json(location): """ Performs a GET by using the passed URL location """ r = requests.get(location, auth=(USERNAME, PASSWORD), verify=SSL_VERIFY) return r.json() def post_json(location, json_data): """ Performs a POST and passes the data to the URL location """ result = requests.post( location, data=json_data, auth=(USERNAME, PASSWORD), verify=SSL_VERIFY, headers=POST_HEADERS ) return result.json() def main(): """ Main routine that creates or re-uses an organization and life cycle environments. If life cycle environments already exist, exit out. """ # Check if our organization already exists org = get_json(f"{FOREMAN_API}/organizations/{ORG_NAME}") # If our organization is not found, create it if org.get('error', None): org_id = post_json( f"{FOREMAN_API}/organizations/", json.dumps({"name": ORG_NAME}) )["id"] print("Creating organization:\t" + ORG_NAME) else: # Our organization exists, so let's grab it org_id = org['id'] print(f"Organization '{ORG_NAME}' exists.") # Now, let's fetch all available life cycle environments for this org... envs = get_json( f"{KATELLO_API}/organizations/{org_id}/environments/" ) # ...and add them to a dictionary, with respective 'Prior' environment prior_env_id = 0 env_list = {} for env in envs['results']: env_list[env['id']] = env['name'] prior_env_id = env['id'] if env['name'] == "Library" else prior_env_id # Exit the script if at least one life cycle environment already exists if all(environment in env_list.values() for environment in ENVIRONMENTS): print("ERROR: One of the Environments is not unique to organization") sys.exit(-1) # Create life cycle environments for environment in ENVIRONMENTS: new_env_id = post_json( f"{KATELLO_API}/organizations/{org_id}/environments/", json.dumps({ "name": environment, "organization_id": org_id, "prior": prior_env_id }) )["id"] print("Creating environment:\t" + environment) prior_env_id = new_env_id if __name__ == "__main__": main() ``` -------------------------------- ### List Available Provisioning Template Kinds Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/hammer_reference/hammer-template Use this command to see all available types of provisioning templates. This helps in understanding the categorization of templates within the system. ```bash # hammer template kinds [OPTIONS] ``` -------------------------------- ### Extract Last Segment of Host IP in Template Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/managing_hosts/Template_Writing_Reference_managing-hosts Use Ruby's string manipulation methods to extract specific parts of host variables within templates. This example shows how to get the last segment of the host's IP address. ```erb <% @host.ip.split('.').last %> ``` -------------------------------- ### Python script for Satellite API interaction Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_rest_api/index This Python script demonstrates how to fetch and display various types of data from the Red Hat Satellite API, including host information, facts, and subscriptions. It includes functions for making authenticated GET requests and parsing JSON responses. Ensure you have the 'requests' and 'json' libraries installed. ```python import requests import json # Configuration - Replace with your actual values USERNAME = "_My_User_Name_" PASSWORD = "_My_Password_" HOSTNAME = "_satellite.example.com_" FOREMAN_API = f"https://{HOSTNAME}/api/v2/" KATELLO_API = f"https://{HOSTNAME}/katello/api/v2/" # SSL verification setting. Set to False to ignore SSL errors, or provide a path to your CA certificate. SSL_VERIFY = False #SSL_VERIFY = "./path/to/CA-certificate.crt" # Put the path to your CA certificate here to allow SSL_VERIFY def get_json(url): # Performs a GET by using the passed URL location r = requests.get(url, auth=(USERNAME, PASSWORD), verify=SSL_VERIFY) return r.json() def get_results(url): jsn = get_json(url) if jsn.get('error'): print("Error: " + jsn['error']['message']) else: if jsn.get('results'): return jsn['results'] elif 'results' not in jsn: return jsn else: print("No results found") return None def display_all_results(url): results = get_results(url) if results: print(json.dumps(results, indent=4, sort_keys=True)) def display_info_for_hosts(url): hosts = get_results(url) if hosts: print(f"{ 'ID':10}{ 'Name':40}{ 'IP':30}{ 'Operating System':30}") for host in hosts: print(f"{str(host['id']):10}{host['name']:40}{str(host['ip']):30}{str(host['operatingsystem_name']):30}") def display_info_for_subs(url): subs = get_results(url) if subs: print(f"{ 'ID':10}{ 'Name':90}{ 'Start Date':30}") for sub in subs: print(f"{str(sub['id']):10}{sub['name']:90}{str(sub['start_date']):30}") def main(): host = HOSTNAME print(f"Displaying all info for host {host} ...") display_all_results(FOREMAN_API + 'hosts/' + host) print(f"Displaying all facts for host {host} ...") display_all_results(FOREMAN_API + f'hosts/{host}/facts') host_pattern = 'example' print(f"Displaying basic info for hosts matching pattern '{host_pattern}'...") display_info_for_hosts(FOREMAN_API + 'hosts?per_page=1&search=name~' + host_pattern) print(f"Displaying basic info for subscriptions") display_info_for_subs(KATELLO_API + 'subscriptions') environment = 'production' print(f"Displaying basic info for hosts in environment {environment}...") display_info_for_hosts(FOREMAN_API + 'hosts?search=environment=' + environment) if __name__ == "__main__": main() ``` -------------------------------- ### Display Full Satellite Installer Help Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_disconnected_network_environment/installing-satellite-server Use this command to display advanced options for the satellite-installer utility. ```bash # satellite-installer --scenario satellite --full-help ``` -------------------------------- ### Enable and Start NFS Server Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/integrating_provisioning_infrastructure_services/configuring-dhcp-integration Enable the NFS server service to start automatically on boot and start it immediately. ```bash # systemctl enable --now nfs-server ``` -------------------------------- ### Basic Kickstart Partition Table Layout Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/provisioning_hosts/preparing-templates-for-provisioning Define a basic disk partitioning scheme for Red Hat Enterprise Linux using Kickstart syntax within a partition table template. This example clears all existing partitions and then uses automatic partitioning. ```kickstart zerombr clearpart --all --initlabel autopart ``` -------------------------------- ### Example satellite-installer Command for Capsule Deployment Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_capsule_server/installing-capsule-server This is an example output of the satellite-installer command that is returned by capsule-certs-generate. It is used to deploy the custom SSL certificate to your Capsule Server. Retain this command for deployment. ```bash satellite-installer --scenario capsule \ --certs-tar-file "/root/_capsule.example.com_-certs.tar" \ --foreman-proxy-foreman-base-url "https://_satellite.example.com_" \ --foreman-proxy-trusted-hosts "_satellite.example.com_" \ --foreman-proxy-trusted-hosts "_capsule.example.com_" \ --foreman-proxy-oauth-consumer-key "_My_OAuth_Consumer_Key_" \ --foreman-proxy-oauth-consumer-secret "_My_OAuth_Consumer_Secret_" ``` -------------------------------- ### Install the Satellite Ansible Collection Package Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html-single/using_the_satellite_ansible_collection/index Install the `ansible-collection-redhat-satellite` package to use the Satellite Ansible modules. This package is installed by default on the Satellite Server but must be installed on other systems from which you intend to execute playbooks. ```bash sudo dnf install -y ansible-collection-redhat-satellite ``` -------------------------------- ### Install Satellite packages Source: https://docs.redhat.com/en/documentation/red_hat_satellite/6.19/html/installing_satellite_server_in_a_disconnected_network_environment/installing-satellite-server Run the installation script located in the mounted Satellite ISO directory to install the Satellite packages. ```bash # ./install_packages ```