# Ansible.builtin.dnf parameter defaults for all tasks (for install\_weak\_deps)

**URL:** <https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803>\
**Category:** Get Help\
**Tags:** dnf\
**Created:** [January 24, 2025, 8:08am UTC](https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803 "2025-01-24T08:08:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cloos/32/7297_2.png) [@cloos](https://forum.ansible.com/u/cloos)\
**Post date:** [January 24, 2025, 8:08am UTC](https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803/1 "2025-01-24T08:08:53Z")

</div>

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](https://github.com/ansible/ansible/blob/e6adddcaf8d4cf46185a90be89a574ba01cc6b84/lib/ansible/modules/dnf.py#L610)

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](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html#runtime-yml), but this is `ansible.builtin`, which is not a real collection.

---

<div class="post-metadata">

**Author:** ![mkrizek](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mkrizek/32/2055_2.png) [@mkrizek](https://forum.ansible.com/u/mkrizek)\
**Post date:** [January 24, 2025, 8:20am UTC](https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803/2 "2025-01-24T08:20:52Z")

</div>

> 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](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html)

---

<div class="post-metadata">

**Author:** ![cloos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cloos/32/7297_2.png) [@cloos](https://forum.ansible.com/u/cloos)\
**Post date:** [January 24, 2025, 9:00am UTC](https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803/4 "2025-01-24T09:00:24Z")

</div>

Thanks, I totally missed that I can here also use modules and not only actions\_groups.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 23, 2025, 9:00am UTC](https://forum.ansible.com/t/ansible-builtin-dnf-parameter-defaults-for-all-tasks-for-install-weak-deps/39803/5 "2025-02-23T09:00:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
