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.
Problem
Right now, we duplicate the list of installed packages for multiple systems. E.g. both
arch-packages.yml,ubuntu-packages.ymlandmacos-packages.ymldefine lists with similar packages:Desired state
Ideally we should have a
commonvariable that defines a list with the packages that repeat for every system.