Using this task, I want to remove the patch package from my servers.
But after running the task, dkms is also uninstalled. Dkms depends on the patch package.
- name: "Remove now unused patch package"
ansible.builtin.dnf:
name: patch
state: absent
allowerasing: false
The behaviour I would expect is that the task fails, stating a package depends on it, and unless that package is also explicitly mentioned in that task, it wont continue.
Instead it just removes the dkms package too. Why is that?
i tried adding allowerasing = false, even thought that should be enabled by default, and as expected it didnt change anything.
I found a stack overflow post stating similar behaviour even two years ago.
I tried installing patch explicitly, installing dkms explicitly, running the playbook and again both packages are gone.
Anyone can help me out why this happens? Is this intended behaviour, if so, why?
Thanks a lot in advance, I’m just confused why it works like that.
Im running ansible version core 2.18.2, python version 3.12.5