Ansible.builtin.dnf parameter defaults for all tasks (for install_weak_deps)

We have configured all our hosts in /etc/dnf/dnf.conf to not install weak deps (install_weak_deps=False).

Sadly I learned that the Ansible ansible.builtin.dnf ignores this configuration and set install_weak_deps by default to true: ansible/lib/ansible/modules/dnf.py at e6adddcaf8d4cf46185a90be89a574ba01cc6b84 · ansible/ansible · GitHub

I don’t want to update now every ansible.builtin.dnf task and add install_weak_deps=False.

Is there a way to do this globally which affects then every ansible.builtin.dnf task?

For collections this is possible by action_groups, but this is ansible.builtin, which is not a real collection.

Is there a way to do this globally which affects then every ansible.builtin.dnf task?

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html

1 Like

(post deleted by author)

Thanks, I totally missed that I can here also use modules and not only actions_groups.