Run package removal script in playbook

This commit is contained in:
2024-05-06 11:18:56 +02:00
parent 9deaef642f
commit 7763435a63
2 changed files with 10 additions and 1 deletions

View File

@@ -182,6 +182,14 @@
vars: vars:
query: "{{ 'list.*.%s[]'|format(distro) }}" query: "{{ 'list.*.%s[]'|format(distro) }}"
- name: remove unconfigured packages
script:
cmd: ./remove-unconfigured-packages.sh --noconfirm
register: unconfigured_packages_cmd
failed_when: unconfigured_packages_cmd.rc not in (0, 123)
changed_when: unconfigured_packages_cmd.rc == 123
become: true
- name: aur - name: aur
tags: tags:
- aur - aur

View File

@@ -37,6 +37,7 @@ readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
done) done)
if (( "${#packages_to_remove}" > 0 )) ; then if (( "${#packages_to_remove}" > 0 )) ; then
sudo pacman -Rcns "${packages_to_remove[@]}" sudo pacman -Rcns "${packages_to_remove[@]}" "${@}" || exit $?
exit 123
fi fi