Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ensure not installed packages #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions playbooks/roles/packages/tasks/productivity.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
---
- name: Productivity
tags: [packages, productivity]
vars:
unwanted_aur_packages:
- slack-desktop
block:
- name: Check presence of unwanted aur packages
shell: pacman -Qm "{{ item }}"
loop: "{{ unwanted_aur_packages }}"
register: aur_packages
ignore_errors: yes

- name: Exit if unwanted aur packages are installed
fail:
msg: "One or more of the unwanted AUR packages are installed: {{ unwanted_aur_packages | join(', ') }}"
when: aur_packages.results | selectattr('rc', 'eq', 0) | list | count > 0
- name: Ensure not installed packages
community.general.pacman:
name:
- slack-desktop
state: absent

- name: Install productivity packages
community.general.pacman:
Expand Down