refactor: add zsync and Zen browser tasks, update default applications and configurations
Some checks failed
Nix Format Check / check-format (push) Failing after 1m6s

This commit is contained in:
2025-03-03 14:49:15 +01:00
parent a47b6ea2f2
commit c8944e8ed6
16 changed files with 267 additions and 211 deletions

View File

@@ -0,0 +1,60 @@
- name: Ensure snapd is installed
ansible.builtin.package:
name: snapd
state: present
become: true
- name: Ensure snapd service is enabled and started
ansible.builtin.systemd:
name: snapd
state: started
enabled: true
become: true
- name: Get list of installed Snaps
ansible.builtin.command: snap list
register: installed_snaps
changed_when: false
- name: Define protected system snaps
ansible.builtin.set_fact:
system_snaps:
- snapd
- core
- core18
- core20
- core22
- bare
- gtk-common-themes
- gnome-3-28-1804
- gnome-3-34-1804
- gnome-3-38-2004
- name: Define desired Snaps
ansible.builtin.set_fact:
desired_snaps:
- name: bitwarden
classic: false
- name: bw
classic: false
- name: Install desired Snap packages
ansible.builtin.command: "snap install {{ item.name }} {{ '--classic' if item.classic else '' }}"
loop: "{{ desired_snaps }}"
become: true
register: snap_install
changed_when: "'already installed' not in snap_install.stderr"
failed_when:
- snap_install.rc != 0
- "'already installed' not in snap_install.stderr"
- name: Remove undesired Snap packages
ansible.builtin.command: "snap remove {{ item }}"
become: true
loop: "{{ installed_snaps.stdout_lines[1:] | map('split', ' ') | map('first') | difference(desired_snaps | map(attribute='name')) | difference(system_snaps) }}"
register: snap_remove
changed_when: snap_remove.rc == 0
failed_when:
- snap_remove.rc != 0
- "'not installed' not in snap_remove.stderr"
- "'cannot remove' not in snap_remove.stderr"