Note
This module is part of the community.general collection (version 10.7.3).
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
dnf config-manager sub-command.The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
name list / elements=string | Repository ID, for example Default: |
state string | Whether the repositories should be Choices:
|
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Can run in |
diff_mode | Support: none | Will return details on what has changed (or possibly needs changing in |
Note
dnf5.See also
Manages packages with the dnf package manager.
Add or remove YUM repositories.
- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
changed_repos list / elements=string | Repositories changed. Returned: success Sample: |
repo_states_post dictionary | Repository states after action taken. Returned: success Sample: |
|
disabled list / elements=string |
Disabled repository IDs. Returned: success |
|
enabled list / elements=string |
Enabled repository IDs. Returned: success |
repo_states_pre dictionary | Repo IDs before action taken. Returned: success Sample: |
|
disabled list / elements=string |
Disabled repository IDs. Returned: success |
|
enabled list / elements=string |
Enabled repository IDs. Returned: success |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/dnf_config_manager_module.html