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.

This commit is contained in:
ilia 2025-08-27 11:34:09 -04:00
parent bafd03fbbc
commit fe5c39f487

View File

@ -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 Mints 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 Mints 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: