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: apt:
update_cache: yes 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 command: add-apt-repository universe
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['distribution'] in ["Ubuntu", "Linux Mint"]
changed_when: false changed_when: false
ignore_errors: true 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 - name: Install Redshift
apt: apt:
name: redshift name: redshift
state: present state: present
- name: Add Brave's APT key # Modern Brave repo/key installation for all
apt_key: - name: Download Brave APT key
get_url:
url: https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg 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: 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 filename: brave-browser
state: present state: present
- name: Update apt cache after repo add
apt:
update_cache: yes
- name: Install Brave browser - name: Install Brave browser
apt: apt:
name: brave-browser name: brave-browser
state: present 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 - name: Install Snap daemon
apt: apt:
name: snapd name: snapd
state: present 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 - name: Force Ansible to reload facts
setup: setup:
- name: Install Cursor # Install IDE and other snaps everywhere Snap is available
community.general.snap: - name: Install VSCode IDE (Snap, all distros)
name: cursor
state: present
- name: Install VSCode
community.general.snap: community.general.snap:
name: code name: code
classic: true classic: true
state: present 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 - name: Install LibreOffice
apt: apt: