configuring more packages

This commit is contained in:
Matthew Stobbs
2025-01-22 22:14:49 -07:00
parent 852331a692
commit 6fa5a46701
88 changed files with 388 additions and 492 deletions

View File

@@ -1,8 +1,4 @@
---
- ansible.builtin.include_vars:
file: alacritty.yml
name: _alacritty
- name: build and install alacritty
become: true
ansible.builtin.command:

2
tasks/build/ghostty.yml Normal file
View File

@@ -0,0 +1,2 @@
---

View File

@@ -1,33 +1,36 @@
# Install nerdfonts for each platform
---
- name: set install path for non-system installs
ansible.builtin.set_fact:
nerdfont_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts"
when: not nerdfonts_system_install
- name: set install path for system wide installs
ansible.builtin.set_fact:
nerdfont_install_path: "/usr/local/share/fonts"
when: nerdfonts_system_install
- name: create nerdfonts directories
ansible.builtin.file:
path: "{{ nerdfonts_install_path }}/{{ font.name }}"
state: directory
become: nerdfonts_system_install
loop: "{{ nerdfonts }}"
loop_control:
loop_var: font
register: nerdfont_result
- name: Download and extract nerdfonts
ansible.builtin.unarchive:
creates: "{{ nerdfont_install_path }}/{{ font.name }}/README.md"
src: "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/{{ font.name }}.tar.xz"
dest: "{{ nerdfont_install_path }}/{{ font.name }}"
remote_src: true
when: nerdfont_result is changed
become: nerdfonts_system_install
loop: "{{ nerdfonts }}"
loop_control:
loop_var: font
- name: linux installation
when: ansible_system == 'Linux'
block:
- name: set install path for non-system installs
ansible.builtin.set_fact:
nerdfonts_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts"
when: not _nerdfonts.nerdfonts_system_install
- name: set install path for system wide installs
ansible.builtin.set_fact:
nerdfonts_install_path: "/usr/local/share/fonts"
when: _nerdfonts.nerdfonts_system_install
- name: create nerdfonts directories
ansible.builtin.file:
path: "{{ nerdfonts_install_path }}/{{ font.name }}"
state: directory
become: "{{ _nerdfonts.nerdfonts_system_install }}"
loop: "{{ nerdfonts }}"
loop_control:
loop_var: font
register: nerdfont_result
- name: Download and extract nerdfonts
ansible.builtin.unarchive:
creates: "{{ nerdfonts_install_path }}/{{ font.name }}/README.md"
src: "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/{{ font.name }}.tar.xz"
dest: "{{ nerdfonts_install_path }}/{{ font.name }}"
remote_src: true
when: nerdfont_result is changed
become: nerdfonts_system_install
loop: "{{ _nerdfonts.fonts }}"
loop_control:
loop_var: font

View File

@@ -1,8 +0,0 @@
---
- name: append alacritty to caskpkgs
set_fact:
caskpkgs: "{{ caskpkgs + [ 'alacritty' ] }}"
tags:
- MacOS
- brew
- package

View File

@@ -1,8 +0,0 @@
---
- name: append ansible to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'ansible' ]}}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,8 +0,0 @@
---
- name: append btop to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'btop' ]}}"
tags:
- MacOS
- brew
- package

View File

@@ -1,13 +0,0 @@
---
- ansible.builtin.include_vars:
file: carapace.yml
name: _carapace
- name: append carapace to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'carapace' ] }}"
tags:
- MacOS
- homebrew
- package
- nushell

View File

@@ -1,8 +0,0 @@
---
- name: append cmake to caskpkgs
set_fact:
caskpkgs: "{{ caskpkgs + [ 'homebrew/cask/cmake' ] }}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,8 +0,0 @@
---
- name: append editorconfig to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'editorconfig' ]}}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,9 +0,0 @@
---
- name: append firefox to caskpkgs
set_fact:
caskpkgs: "{{ caskpkgs + [ 'firefox' ] }}"
tags:
- packages
- MacOS
- homebrew
- web

View File

@@ -1,8 +0,0 @@
---
- name: append fzf to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'fzf' ]}}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,9 +0,0 @@
---
- name: append ghostty to caskpkgs
set_fact:
caskpkgs: "{{ caskpkgs + [ 'ghostty' ] }}"
tags:
- MacOS
- brew
- package
- terminal

View File

@@ -1,20 +0,0 @@
---
- name: set git_pkgs
set_fact:
git_pkgs:
- git
- git-delta
- git-extras
- git-lfs
tags:
- MacOS
- homebrew
- package
- name: append git to syspkgs
set_fact:
syspkgs: "{{ syspkgs + git_pkgs }}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,8 +0,0 @@
---
- name: append hugo to syspkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'hugo' ]}}"
tags:
- MacOS
- homebrew
- package

View File

@@ -1,23 +0,0 @@
---
- name: install rust and cargo
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/rust.yml"
tags:
- rust
- dependency
- name: install alacritty dependencies for Debian based distributions
ansible.builtin.set_fact:
alacritty_deps:
- cmake
- pkg-config
- libfreetype6-dev
- libfontconfig1-dev
- libxcb-xfixes0-dev
- libxkbcommon-dev
- python3
- name: add to pkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + alacritty_deps }}"
srcpkgs: "{{ srcpkgs + ['build/alacritty.yml'] }}"

View File

@@ -1,7 +0,0 @@
# Install ansible for current platform
---
- name: append to pkgs
set_fact:
syspkgs: "{{ (syspkgs + [ 'ansible' ] }}"

View File

@@ -1,11 +0,0 @@
---
- name: enable carapace repository
become: true
ansible.builtin.apt_repository:
repo: "deb [trusted=yes] https://apt.fury.io/rsteube/ /"
state: present
update_cache: false
- name: add carapace to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'carapace-bin' ] }}"

View File

@@ -1,9 +0,0 @@
---
- name: ensure hashicorp repo is active
ansible.builtin.include_tasks:
file: "{{ ansible_os_family }}/hashicorp_repo.yml"
- name: append to pkgs
set_fact:
syspkgs: "{{ (syspkgs + [ 'consul' ] }}"

View File

@@ -1,9 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'firefox' ] }}"
tags:
- packages
- RedHat
- web

View File

@@ -1,10 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'fzf' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,15 +0,0 @@
---
- name: ensure dependencies
ansible.builtin.include_tasks:
file: packages/RedHat/terra_repo.yml
tags:
- dependency
- package
- terra
- syspkgs
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'ghostty' ] }}"
tags:
- syspkgs

View File

@@ -1,10 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'git', 'git-delta', 'git-email', 'git-lfs' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,4 +0,0 @@
---
- name: append to pkgs
set_fact:
srcpkgs: "{{ srcpkgs + [ 'build/go.yml' ] }}"

View File

@@ -1,27 +0,0 @@
# install hashicorp vault for Debian/Ubuntu
---
- ansible.builtin.tempfile:
state: directory
prefix: hashicorp.
register: d_hashicorp_tmp
- name: get hashicorp archive gpg key
ansible.built.get_url:
dest: "{{ d_hashicorp_tmp.path }}/gpg"
url: https://apt.releases.hashicorp.com/gpg
- name: install hashicorp archive gpg key
become: true
ansible.builtin.command:
cmd:
- gpg
- --dearmor
- -o
- /usr/share/keyrings/hashicorp-archive-keyring.gpg
- "{{ d_hashicorp_tmp.path }}/gpg"
- name: enable hasicorp repo for debian
ansible.builtin.apt_repository:
repo: "deb [arch={{ ansible_architecture }} signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main"
state: present
update_cache: false

View File

@@ -1,9 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'konsole' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,4 +1,4 @@
---
- name: append to pkgs
- name: append to srcpkgs
set_fact:
srcpkgs: "{{ srcpkgs + [ 'Linux/nerdfonts.yml' ] }}"
srcpkgs: "{{ srcpkgs + [ 'nerdfonts' ] }}"

View File

@@ -1,25 +0,0 @@
---
- name: install rust and cargo
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/rust.yml"
tags:
- rust
- dependency
- name: set alacritty pkg deps
set_fact:
alacritty_deps:
- cmake
- freetype-devel
- fontconfig-devel
- libxcb-devel
- libxkbcommon-devel
- g++
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + alacritty_deps }}"
srcpkgs: "{{ srcpkgs + [ 'build/alacritty.yml' ] }}"
tags:
- syspkgs
- srcpkgs

View File

@@ -1,5 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'btop' ] }}"

View File

@@ -1,11 +0,0 @@
---
- ansible.builtin.include_vars:
file: carapace.yml
name: _carapace
- name: install carapace RPM
become: true
ansible.builtin.dnf:
name: "{{ _ghbase }}/carapace-sh/carapace-bin/releases/download/v{{ _carapace.version }}/carapace-bin_{{ _carapace.version }}_linux_amd64.rpm"
state: "{{ install_state }}"
disable_gpg_check: true

View File

@@ -1,9 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'cmake' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,9 +0,0 @@
---
- name: ensure hashicorp repo is active
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/hashicorp_repo.yml"
- name: append to pkgs
set_fact:
syspkgs: "{{ (syspkgs + [ 'consul' ] }}"

View File

@@ -1,8 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'editorconfig' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,9 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'firefox' ] }}"
tags:
- packages
- RedHat
- web

View File

@@ -1,15 +0,0 @@
---
- name: ensure dependencies
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/terra_repo.yml"
tags:
- dependency
- package
- terra
- syspkgs
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'ghostty' ] }}"
tags:
- syspkgs

View File

@@ -1,10 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'git', 'git-delta', 'git-email', 'git-lfs' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,4 +0,0 @@
---
- name: append to pkgs
set_fact:
srcpkgs: "{{ srcpkgs + [ 'build/go.yml' ] }}"

View File

@@ -1,27 +0,0 @@
# install hashicorp vault for RedHat
---
- name: enable hashicorp repo for fedora >=41
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int >= 41
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: dnf config-manager addrepo --from-repofile=https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
- name: enable hashicorp repo for fedora <41
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int < 41
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
- name: enable hashicorp repo for RHEL like distribution
become: true
when:
- ansible_distribution != 'Fedora'
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

View File

@@ -1,10 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'hugo' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,10 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'jq' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,4 +0,0 @@
---
- name: add to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ (syspkgs | default([])) + ['kitty', 'kitty-shell-integration'] }}"

View File

@@ -1,9 +0,0 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'konsole' ] }}"
tags:
- RedHat
- linux
- package

View File

@@ -1,18 +0,0 @@
---
- name: set neovide pkg dependencies
set_fact:
neovide_deps:
- cargo
- fontconfig-devel
- freetype-devel
- libX11-xcb
- libX11-devel
- libstdc++-static
- libstdc++-devel
- "@Development Tools"
- "@Development Libraries"
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + neovide_deps }}"
srcpkgs: "{{ srcpkgs + [ 'build/neovide.yml' ] }}"

View File

@@ -1,20 +0,0 @@
---
- name: add build deps
set_fact:
neovim_deps:
- ninja-build
- cmake
- gcc
- make
- gettext
- curl
- glibc-gconv-extra
- set_fact:
syspkgs: "{{ syspkgs + neovim_deps }}"
- name: append to srcpkgs
set_fact:
srcpkgs: "{{ srcpkgs + ['neovim'] }}"
tags:
- RedHat
- srcpkg

View File

@@ -1,4 +0,0 @@
---
- name: append to pkgs
set_fact:
srcpkgs: "{{ srcpkgs + [ 'Linux/nerdfonts.yml' ] }}"

31
tasks/pkgs/alacritty.yml Normal file
View File

@@ -0,0 +1,31 @@
---
- ansible.builtin.include_vars:
file: alacritty.yml
name: _alacritty
- name: linux based installation
when: ansible_system == 'Linux'
block:
- name: install rust and cargo
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/rust.yml"
tags:
- rust
- dependency
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + _alacritty[ansible_distribution].build_deps }}"
srcpkgs: "{{ srcpkgs + [ 'build/alacritty.yml' ] }}"
tags:
- syspkgs
- srcpkgs
- name: append alacritty to caskpkgs
set_fact:
caskpkgs: "{{ caskpkgs + [ 'alacritty' ] }}"
when: ansible_system == 'Darwin'
tags:
- MacOS
- brew
- package

26
tasks/pkgs/carapace.yml Normal file
View File

@@ -0,0 +1,26 @@
---
- ansible.builtin.include_vars:
file: carapace.yml
name: _carapace
- name: install carapace RPM
ansible.builtin.yum_repository:
name: Gemfury Private Repo
baseurl: https://yum.fury.io/rsteube/
enabled: true
gpgcheck: false
state: present
when: ansible_os_familiy == 'RedHat'
become: true
- name: enable carapace repository
become: true
ansible.builtin.apt_repository:
repo: "deb [trusted=yes] https://apt.fury.io/rsteube/ /"
state: present
update_cache: false
when: ansible_os_family == 'Debian'
- name: add carapace to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'carapace-bin' ] }}"

13
tasks/pkgs/consul.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- ansible.builtin.include_vars:
file: consul.yml
name: _consul
- name: ensure hashicorp repo is active
ansible.builtin.include_tasks:
file: "pkgs/hashicorp_repo.yml"
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ _consul[ansible_os_family].pkg ] }}"

14
tasks/pkgs/firefox.yml Normal file
View File

@@ -0,0 +1,14 @@
---
- name: append to pkgs
when: ansible_os_family != 'Darwin'
set_fact:
syspkgs: "{{ syspkgs + [ 'firefox' ] }}"
tags:
- packages
- name: append to caskpkgs
when: ansible_os_family == 'Darwin'
set_fact:
caskpkgs: "{{ caskpkgs + [ 'firefox' ] }}"
tags:
- packages

View File

@@ -1,5 +1,4 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'fzf' ] }}"

34
tasks/pkgs/ghostty.yml Normal file
View File

@@ -0,0 +1,34 @@
---
- name: ensure dependencies
when: ansible_distribution == 'Fedora'
block:
- ansible.builtin.include_tasks:
file: "pkgs/terra_repo.yml"
tags:
- dependency
- package
- terra
- syspkgs
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'ghostty' ] }}"
tags:
- syspkgs
- name: no ghostty for this system
when:
- ansible_distribution != 'Fedora'
- ansible_system == 'Linux'
debug:
msg: ghostty cannot be installed this way for your distribution
- name: append ghostty to caskpkgs
when: ansible_distribution == 'MacOSX'
set_fact:
caskpkgs: "{{ caskpkgs + [ 'ghostty' ] }}"
tags:
- MacOS
- brew
- package
- terminal

13
tasks/pkgs/git.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- ansible.builtin.include_vars:
file: git.yml
name: _git
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + _git[ansible_system].pkgs }}"
tags:
- RedHat
- linux
- package

View File

@@ -0,0 +1,68 @@
---
- ansible.builtin.include_vars:
file: hashicorp_repo.yml
name: _hashicorp
- name: RedHat repository
when: ansible_os_family == 'RedHat'
block:
- name: enable hashicorp repo for fedora >=41
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int >= 41
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: "dnf config-manager addrepo --from-repofile={{ _hashicorp.Fedora.repo }}"
- name: enable hashicorp repo for fedora <41
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int < 41
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: "dnf config-manager --add-repo {{ _hashicorp.Fedora.repo }}"
- name: enable hashicorp repo for RHEL like distribution
become: true
when:
- ansible_distribution != 'Fedora'
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: "dnf config-manager --add-repo {{ _hashicorp.RedHat.repo }}"
- name: Debian based repository
when: ansible_os_family == 'Debian'
block:
- ansible.builtin.tempfile:
state: directory
prefix: hashicorp.
register: d_hashicorp_tmp
- name: get hashicorp archive gpg key
ansible.built.get_url:
dest: "{{ d_hashicorp_tmp.path }}/gpg"
url: https://apt.releases.hashicorp.com/gpg
- name: install hashicorp archive gpg key
become: true
ansible.builtin.command:
cmd:
- gpg
- --dearmor
- -o
- /usr/share/keyrings/hashicorp-archive-keyring.gpg
- "{{ d_hashicorp_tmp.path }}/gpg"
- name: enable hasicorp repo for debian
ansible.builtin.apt_repository:
repo: "{{ _hashicorp.Debian.repo }}"
state: present
update_cache: false
- name: enable hashicorp homebrew tap
when: ansible_os_family == 'Darwin'
community.general.homebrew_tap:
name: hashicorp/tap
state: present

View File

@@ -1,5 +1,4 @@
---
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'hugo' ] }}"

8
tasks/pkgs/kitty.yml Normal file
View File

@@ -0,0 +1,8 @@
---
- ansible.builtin.include_vars:
file: kitty.yml
name: _kitty
- name: add to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + _kitty[ansible_system].pkgs }}"

15
tasks/pkgs/neovide.yml Normal file
View File

@@ -0,0 +1,15 @@
---
- ansible.builtin.include_vars:
file: neovide.yml
name: _neovide
- name: append to pkgs
when: ansible_system == 'Linux'
set_fact:
syspkgs: "{{ syspkgs + _neovide[ansible_os_family].pkgdeps }}"
srcpkgs: "{{ srcpkgs + [ 'build/neovide.yml' ] }}"
- name: append neovide to caskpkgs
when: ansible_system == 'Darwin'
set_fact:
caskpkgs: "{{ caskpkgs + [ 'neovide' ] }}"

34
tasks/pkgs/neovim.yml Normal file
View File

@@ -0,0 +1,34 @@
---
- ansible.builtin.include_vars:
file: neovim.yml
name: _neovim
- name: linux installation
when: ansible_system == 'Linux'
block:
- name: ensure install dir exists
ansible.builtin.file:
state: directory
path: "{{ _neovim.install_dir }}"
- name: install neovim appimage
ansible.builtin.get_url:
backup: true
url: "{{ _neovim[ansible_system].appimage.dl }}"
dest: "{{ _neovim.install_dir }}/nvim.appimage"
mode: "0755"
owner: root
group: root
checksum: "{{ _neovim[ansible_system].appimage.checksum }}"
- name: link neovim to prefix bin
ansible.builtin.file:
state: link
src: "{{ _neovim.install_dir }}/nvim.appimage }}"
path: "{{ _neovim.install_prefix }}/bin/nvim }}"
- name: append neovim to syspkgs
when: ansible_system == 'Darwin'
set_fact:
syspkgs: "{{ syspkgs + ['neovim'] }}"

17
tasks/pkgs/nerdfonts.yml Normal file
View File

@@ -0,0 +1,17 @@
---
- ansible.builtin.include_vars:
file: nerdfonts.yml
name: _nerdfonts
- name: append to srcpkgs
when: ansible_system == 'Linux'
set_fact:
srcpkgs: "{{ srcpkgs + [ 'nerdfonts' ] }}"
- name: append to caskpkgs
when: ansible_system == 'Darwin'
set_fact:
caskpkgs: "{{ caskpkgs + [ 'font-' + font.brew + '-nerd-font' ] }}"
loop: "{{ _nerfonts.fonts }}"
loop_control:
loop_var: font