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.3.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

manifester-0.2.3-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manifester-0.2.3.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for manifester-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0a709245e2d1acc6636c81d77c7ed1219b2df87c6ad332ff1cd22c88b3863ef7
MD5 149169c508ff2399c50a4819940b21ec
BLAKE2b-256 b6cd28df2ae50f4e46f5bf7f88e448a894112edc593a7d29a25972e7ee0d819c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: manifester-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for manifester-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1cfad9e6fc5a017f16c078afbff15da6255017b5e5088005b84e0259d3f91e6d
MD5 d423b6a543695cb730c0d7b609017d39
BLAKE2b-256 65606c911171b3c5261afca14a8ea27f9ea265587fa63694b99a617c62997cf8

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