Skip to content

Avoid repeating list of packages for all systems #1

@lily-gh

Description

@lily-gh

Problem

Right now, we duplicate the list of installed packages for multiple systems. E.g. both arch-packages.yml, ubuntu-packages.yml and macos-packages.yml define lists with similar packages:

# macos-packages.yml
- name: Install packages on macOS
  ansible.builtin.homebrew:
    name: "{{ item }}"
  with_items:
    - bat
    - ffmpeg
    - fzf
    - git
    - gpg
    - eza
    - vim
    - zsh
    - zsh-syntax-highlighting
    - zsh-autosuggestions
    - ansible
    - asdf

# ubuntu-packages.yml
- name: Install packages
  ansible.builtin.apt:
    name: "{{ item }}"
    state: latest
  with_items:
    - curl
    - unzip
    - bat
    - ffmpeg
    - fzf
    - gcc
    - gpg
    - git
    - eza
    - vim
    - zsh
    - xclip
    - wget
  become: true

# arch-packages.yml
- name: Install packages
  community.general.pacman:
    name: "{{ item }}"
    state: latest
  with_items:
    - curl
    - unzip
    - bat
    - ffmpeg
    - fzf
    - gcc
    - git
    - pcre2
    - eza
    - vim
    - zsh
    - xclip
    - wget
  become: true

Desired state

Ideally we should have a common variable that defines a list with the packages that repeat for every system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions