community.general.rhsm_repository (8.5.0) — module

Manage RHSM repositories using the subscription-manager command

Authors: Giovanni Sciortino (@giovannisciortino)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage (Enable/Disable) RHSM repositories to the Red Hat Subscription Management entitlement platform using the C(subscription-manager) command.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable a RHSM repository
  community.general.rhsm_repository:
    name: rhel-7-server-rpms
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable all RHSM repositories
  community.general.rhsm_repository:
    name: '*'
    state: disabled
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable all repositories starting with rhel-6-server
  community.general.rhsm_repository:
    name: rhel-6-server*
    state: enabled
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable all repositories except rhel-7-server-rpms
  community.general.rhsm_repository:
    name: rhel-7-server-rpms
    purge: true

Inputs

    
name:
    description:
    - The ID of repositories to enable.
    - To operate on several repositories this can accept a comma separated list or a YAML
      list.
    elements: str
    required: true
    type: list

purge:
    default: false
    description:
    - Disable all currently enabled repositories that are not not specified in O(name).
      Only set this to V(true) if passing in a list of repositories to the O(name) field.
      Using this with C(loop) will most likely not have the desired result.
    type: bool

state:
    choices:
    - present
    - enabled
    - absent
    - disabled
    default: enabled
    description:
    - If state is equal to present or disabled, indicates the desired repository state.
    - 'Please note that V(present) and V(absent) are deprecated, and will be

      removed in community.general 10.0.0; please use V(enabled) and

      V(disabled) instead.

      '
    type: str

Outputs

repositories:
  description:
  - The list of RHSM repositories with their states.
  - When this module is used to change the repository states, this list contains the
    updated states after the changes.
  returned: success
  type: list