kewlfft / ansible-aur

Ansible module to manage packages from the AUR
GNU General Public License v3.0
299 stars 47 forks source link

How to automatically confirm removing conflicting package? #81

Open brooksvb opened 5 months ago

brooksvb commented 5 months ago

I have this task:

- name: Install handlr and xdg-utils shim
  become: true
  become_user: ansible
  kewlfft.aur.aur:
    state: present
    name:
      - handlr
      - xdg-utils-handlr   # TODO: How to automatically confirm replacing xdg-utils?

It fails because xdg-utils is already installed and required by various applications. I can't figure out how to have it automatically remove the conflicting package, and I can't just uninstall xdg-utils prior due to it being a dependency for multiple other packages. The only workaround I have is to manually run paru -S xdg-utils-handlr and have it remove the conflicting xdg-utils.

I think this module may need an option to automatically remove conflicting packages. I don't know if the regular pacman or package modules have this option, but I would imagine something like remove_conflicting: true to be an option I could use in this case.