community.general.dnf_config_manager module – Enable or disable dnf repositories using config-manager
Note
This module is part of the community.general collection (version 9.5.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
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.dnf_config_manager
.
New in community.general 8.2.0
Synopsis
This module enables or disables repositories using the
dnf config-manager
sub-command.
Requirements
The below requirements are needed on the host that executes this module.
dnf
dnf-plugins-core
Parameters
Parameter |
Comments |
---|---|
Repository ID, for example Default: |
|
Whether the repositories should be Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- ansible.builtin.dnf
Manages packages with the dnf package manager.
- ansible.builtin.yum_repository
Add or remove YUM repositories.
Examples
- name: Ensure the crb repository is enabled
community.general.dnf_config_manager:
name: crb
state: enabled
- name: Ensure the appstream and zfs repositories are disabled
community.general.dnf_config_manager:
name:
- appstream
- zfs
state: disabled
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Repositories changed. Returned: success Sample: |
|
Repository states after action taken. Returned: success Sample: |
|
Disabled repository IDs. Returned: success |
|
Enabled repository IDs. Returned: success |
|
Repo IDs before action taken. Returned: success Sample: |
|
Disabled repository IDs. Returned: success |
|
Enabled repository IDs. Returned: success |