From fe5c39f487987e1a7cd6904d125f504d58e07ad4 Mon Sep 17 00:00:00 2001 From: ilia Date: Wed, 27 Aug 2025 11:34:09 -0400 Subject: [PATCH] Refactor dev-playbook.yml to enhance package management for Ubuntu and Mint. Added tasks to enable the 'universe' repository, remove Mint's nosnap.pref, and streamline Brave browser installation with updated APT key handling. Included snapd installation and ensured compatibility across Debian family systems. --- dev-playbook.yml | 59 +++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/dev-playbook.yml b/dev-playbook.yml index 847fd3b..a76fa9a 100644 --- a/dev-playbook.yml +++ b/dev-playbook.yml @@ -15,59 +15,76 @@ apt: update_cache: yes - - name: Enable 'universe' repo on Ubuntu (needed for snapd) + - name: Enable 'universe' repo (Ubuntu and Mint only) command: add-apt-repository universe - when: ansible_facts['os_family'] == "Debian" + when: ansible_facts['distribution'] in ["Ubuntu", "Linux Mint"] changed_when: false ignore_errors: true + - name: Remove Mint’s nosnap.pref block (Mint only) + file: + path: /etc/apt/preferences.d/nosnap.pref + state: absent + when: ansible_facts['distribution'] == "Linux Mint" + - name: Install Redshift apt: name: redshift state: present - - name: Add Brave's APT key - apt_key: + # Modern Brave repo/key installation for all + - name: Download Brave APT key + get_url: url: https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - state: present + dest: /usr/share/keyrings/brave-browser-archive-keyring.gpg + mode: '0644' - - name: Add Brave repo + - name: Add Brave repo (all Debian family) apt_repository: - repo: 'deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main' + repo: "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" filename: brave-browser state: present + - name: Update apt cache after repo add + apt: + update_cache: yes + - name: Install Brave browser apt: name: brave-browser state: present - - name: Remove Mint’s nosnap.pref block - file: - path: /etc/apt/preferences.d/nosnap.pref - state: absent - - - name: Update apt cache - apt: - update_cache: yes + # Snap daemon install across all Debian family systems - name: Install Snap daemon apt: name: snapd state: present + when: ansible_facts['os_family'] == "Debian" + + # Ensure snapd is running on Debian (optional, improves reliability) + - name: Enable snapd socket on Debian + systemd: + name: snapd.socket + enabled: true + state: started + when: ansible_facts['distribution'] == "Debian" - name: Force Ansible to reload facts setup: - - name: Install Cursor - community.general.snap: - name: cursor - state: present - - - name: Install VSCode + # Install IDE and other snaps everywhere Snap is available + - name: Install VSCode IDE (Snap, all distros) community.general.snap: name: code classic: true state: present + when: ansible_facts['os_family'] == "Debian" + + - name: Install Cursor (Snap, all distros) + community.general.snap: + name: cursor + state: present + when: ansible_facts['os_family'] == "Debian" - name: Install LibreOffice apt: