diff --git a/lib/ansible/modules/packaging/os/dnf.py b/lib/ansible/modules/packaging/os/dnf.py index d49d7a64725..395fcc8a719 100644 --- a/lib/ansible/modules/packaging/os/dnf.py +++ b/lib/ansible/modules/packaging/os/dnf.py @@ -375,7 +375,7 @@ def ensure(module, base, state, names, autoremove): # Install groups. for group in groups: try: - base.group_install(group, dnf.const.GROUP_PACKAGE_TYPES) + base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES) except dnf.exceptions.Error as e: # In dnf 2.0 if all the mandatory packages in a group do # not install, an error is raised. We want to capture @@ -402,7 +402,7 @@ def ensure(module, base, state, names, autoremove): base.group_upgrade(group) except dnf.exceptions.CompsError: # If not already installed, try to install. - base.group_install(group, dnf.const.GROUP_PACKAGE_TYPES) + base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES) except dnf.exceptions.Error as e: failures.append((group, e))