Note
This plugin is part of the community.general collection (version 3.8.1).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.rhsm_repository
.
subscription-manager
command.The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
name list / elements=string / required | The ID of repositories to enable. To operate on several repositories this can accept a comma separated list or a YAML list. | |
purge boolean |
| Disable all currently enabled repositories that are not not specified in name . Only set this to True if passing in a list of repositories to the name field. Using this with loop will most likely not have the desired result. |
state string |
| If state is equal to present or disabled, indicates the desired repository state. |
Note
redhat_subscription
module.- name: Enable a RHSM repository community.general.rhsm_repository: name: rhel-7-server-rpms - name: Disable all RHSM repositories community.general.rhsm_repository: name: '*' state: disabled - name: Enable all repositories starting with rhel-6-server community.general.rhsm_repository: name: rhel-6-server* state: enabled - name: Disable all repositories except rhel-7-server-rpms community.general.rhsm_repository: name: rhel-7-server-rpms purge: True
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
repositories list / elements=string | success | 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. |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/rhsm_repository_module.html