Skip to main content

Red Hat subscriptions made manifest.

Project description

Manifester

Red Hat subscriptions made manifest.

Description

Manifester is a tool that uses the Red Hat Subscription Management (RHSM) API to dynamically create and populate subscription allocations and to export subscription manifests for use by Red Hat Satellite and other Red Hat products.

Installation

Clone this repository:

git clone https://github.com/SatelliteQE/manifester

Copy and rename the manifester_settings.yaml.example file to manifester_settings.yaml.

An offline token is required to generate an offline token the temporary access tokens used for authenticating to the RHSM API. Either use an existing offline token for an RHSM account or generate one using the instructions in the article Getting started with Red Hat APIs. Add the offline token to manifester_settings.yaml.

From the base directory of the local clone of the manifest repository, install the project to a local Python environment:

pip install .

Configuration

The manifester_settings.yaml file is used to configure manifester via DynaConf.

Multiple types of manifests can be configured in the manifest_category section of manifester_settings.yaml. These types can be differentiated based on the Satellite version of the subscription allocation, the names and quantities of the subscriptions to be added to the manifest, and whether Simple Content Access is enabled on the manifest.

The value of the name setting for each subscription in a manifest must exactly match the name of a subscription available in the account which was used to generate the offline token. One method for determining the subscription names available in an account is to register a system to RHSM and then run subscription manager list --available on that system. A planned future feature of Manifester is a CLI command that will return a list of available subscriptions.

CLI Usage

Currently, the manifester CLI supports three subcommands: get-manifest, delete, and inventory.

The get-manifest subcommand is used to generate a manifest that is saved to the ./manifests directory. Two options are supported for this command. --manifest-category is required, and the value passed to it must be defined as a manifest category in the manifester_settings.yaml configuration file. The --allocation-name option is optional and can be used to specify the name of the subscription allocation in RHSM, which will subsequently form part of the generated manifest's filename. If novalue is supplied for --allocation_name, a string of 10 random alphabetic characters will be joined to the value of the username_prefix setting in manifester_settings.yaml. A third option, --requester, is intended for future integration with Manifester's unit tests but is not currently supported. Example usage:

$ manifester get-manifest --manifest-category <manifest category name> --allocation-name <allocation name>

The inventory subcommand is used to display the contents of the local inventory file, the location of which is specified by the inventory_path setting in manifester_settings.yaml. Executing manifester inventory without options will write a a table to standard output that contains the name of each subscription allocation created by the user and an inventory index number for each allocation. Passing the --details option will print additional details about the allocation returned by the RHSM API. Passing the --sync option will update the inventory from the RHSM API before printing the inventory. NOTE: The inventory is generated based on the subscription allocations in the RHSM account with names beginning with the username_prefix defined in manifester_settings.yaml. Maintaining a unique and consistent username_prefix (such as the user's RHSM account username) is therefore crucial to accurate inventory management. Example usage and output:

$ manifester inventory
[I 240320 14:52:02 commands:78] Displaying local inventory data
--------------------------------------
| Index | Allocation Name            |
--------------------------------------
| 0     | user-mBIojPMF              |
--------------------------------------
$ manifester inventory --details
[I 240320 14:52:42 commands:86] Displaying detailed local inventory data
0:
    entitlementQuantity: 4
    name: user-mBIojPMF
    simpleContentAccess: enabled
    type: Satellite
    url: https://api.access.redhat.com/management/v1/allocations/2ea75142-8ea4-46db-87e3-1feab8613000
    uuid: 2ef73132-83a4-473b-97e3-1feab8623000
    version: 6.14

The delete subcommand will delete subscription allocations in the inventory from RHSM and, optionally, the local manifest file associated with those allocations. The delete subcommand will accept either a list of inventory index numbers or a list of subscription allocation names. Alternatively, the --all option will delete all subscription allocations in the inventory. Passing the --remove-manifest-file option will cause the CLI to delete the manifest files of any deleted subscription allocations from the local file system in addition to deleting the subscription allocation in RHSM. Example usage:

$ manifester delete 0 1 2
$ manifester delete user-mBIojPMF
$ manifester delete --all

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manifester-0.2.5.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

manifester-0.2.5-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file manifester-0.2.5.tar.gz.

File metadata

  • Download URL: manifester-0.2.5.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for manifester-0.2.5.tar.gz
Algorithm Hash digest
SHA256 5a84b502e8cddd91245872e7a0a3e7e6c7078955c35a1e0078eb901c86830ca2
MD5 5598c7fe2f0f58392c8b963c67615f78
BLAKE2b-256 090b08e42ea95e1e66ce2b1acef0edf2b16e8f2c0666193dc94575b74f509dd0

See more details on using hashes here.

File details

Details for the file manifester-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: manifester-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for manifester-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 aa246c05eaeb9e0f354ae6e8f9afb68c29d01c3d9a5e09640a3cd8e3e74c68dd
MD5 149aff8c9e7594b933e1caba1e875334
BLAKE2b-256 e412403bb385e66fe85180854a309d88aa1fa4eea3667fd9d48ff2138dcc1fac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page