restructuring for easier maintenance

- creating src packages when things can't be installed via
  actual system package
- neovim srcpkg is being worked on now
This commit is contained in:
Matthew Stobbs
2025-01-19 14:10:41 -07:00
parent 985da518b4
commit c62d4e1977
135 changed files with 262 additions and 242 deletions

View File

@@ -0,0 +1,22 @@
---
- name: install rust and cargo
ansible.builtin.include_tasks:
file: "{{ 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 syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + alacritty_deps }}"

View File

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

View File

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

View File

@@ -0,0 +1,11 @@
---
- 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

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

View File

@@ -0,0 +1,9 @@
---
- 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

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

View File

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

10
tasks/pkgs/Debian/fzf.yml Normal file
View File

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

View File

@@ -0,0 +1,15 @@
---
- 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

10
tasks/pkgs/Debian/git.yml Normal file
View File

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

5
tasks/pkgs/Debian/go.yml Normal file
View File

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

View File

@@ -0,0 +1,27 @@
# 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

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

10
tasks/pkgs/Debian/jq.yml Normal file
View File

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

View File

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

View File

@@ -0,0 +1,19 @@
---
- 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
when: ansible_architecture != "aarch64"
set_fact:
syspkgs: "{{ syspkgs + neovide_deps }}"
srcpkgs: "{{ srcpkgs + [ 'Linux/neovide.yml' ] }}"

View File

@@ -0,0 +1,16 @@
---
- name: add build deps
set_fact:
neovim_deps:
- ninja-build
- cmake
- gettext
- curl
- build-essential
- set_fact:
syspkgs: "{{ syspkgs + neovim_deps }}"
- name: append to srcpkgs
set_fact:
srcpkgs: "{{ srcpkgs + ['neovim'] }}"

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
---
- 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 + [ 'nomad' ] }}"

View File

@@ -0,0 +1,16 @@
---
- name: install RedHat dependencies
set_fact:
nushell_pkgdeps:
- cargo
- libxcb
- openssl-devel
- libX11-devel
nushell_altdeps:
- Linux/nushell.yml
- "{{ ansible_os_family }}/carapace.yml"
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + nushell_pkgdeps }}"
srcpkgs: "{{ srcpkgs + nushell_altdeps }}"

View File

@@ -0,0 +1,8 @@
---
- 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 + [ 'packer' ] }}"

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,14 @@
---
- name: set rust_pkgs
set_fact:
rust_pkgs:
- rustc
- cargo
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + rust_pkgs }}"
tags:
- RedHat
- linux
- package

View File

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

View File

@@ -0,0 +1,11 @@
---
# default on Linux is alacritty
# edit config/users.yml:users:<user item>:terminal:os_name:package name
# ie: config/users.yml:users:[name: stobbsm]:terminal:Fedora:konsole
- name: install and configure system terminal emulator
loop: "{{ users }}"
ansible.builtin.include_tasks:
file: "packages/{{ ansible_os_family }}/{{ item.terminal[ansible_distribution] | default('alacritty') }}.yml"
tags:
- package
- Debian

View File

@@ -0,0 +1,8 @@
---
- 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 + [ 'terraform' ] }}"

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
# install hashicorp vault for RedHat
---
- 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 + [ 'vault' ] }}"

View File

@@ -0,0 +1,6 @@
---
- name: install vivaldi debian package
become: true
ansible.builtin.apt:
deb: https://downloads.vivaldi.com/stable/vivaldi-stable_6.7.3329.41-1_amd64.deb
state: present

65
tasks/pkgs/Debian/zfs.yml Normal file
View File

@@ -0,0 +1,65 @@
---
- name: set rpm_dist
ansible.builtin.command: rpm --eval "%{dist}"
register: rpm_dist
tags:
- packages
- RedHat
- config
- name: set zfs repo facts
set_fact:
zfs_repo_base: https://zfsonlinux.org
zfs_gpg_key: https://raw.githubusercontent.com/zfsonlinux/zfsonlinux.github.com/master/zfs-release/RPM-GPG-KEY-openzfs-key2
zfs_gpg_key_fingerprint: 7DC7 299D CF7C 7FD9 CD87 701B A599 FD5E 9DB8 4141
- name: el9+ specific configuration
block:
- name: set el9+ facts
set_fact:
rh_release: epel
zfs_release: 2-3
when:
- ansible_distribution != 'Fedora'
# TODO: figure out a better way to identify EPEL based distros
# TODO: Alma, rocky, centos, rhel
tags:
- packages
- RedHat
- config
- name: Fedora specific configuration
block:
- name: set fedora facts
set_fact:
rh_release: fedora
zfs_release: 2-6
when: ansible_distribution == 'Fedora'
when: ansible_distribution == 'Fedora'
- name: add openzfs gpg_key
ansible.builtin.rpm_key:
key: "{{ zfs_gpg_key }}"
fingerprint: "{{ zfs_gpg_key_fingerprint }}"
state: present
become: true
tags:
- packages
- RedHat
- name: enable openzfs repository
ansible.builtin.dnf:
name: "{{ zfs_repo_base }}{{ rh_release }}/zfs-release-{{ zfs_release }}{{ rpm_dist.stdout }}.noarch.rpm"
state: "{{ install_state }}"
become: true
tags:
- packages
- RedHat
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'zfs' ] }}"
become: true
tags:
- RedHat
- packages

View File

@@ -0,0 +1,4 @@
---
- name: add zig to srcpkgs
ansible.builtin.set_fact:
srcpkgs: "{{ srcpkgs + [ 'zig' ] }}"

View File

@@ -0,0 +1,16 @@
---
- name: Enable copr repo for zoxide
become: true
when: ansible_distribution != "Fedora"
community.general.copr:
name: atim/zoxide
state: enabled
chroot: "{{ coprChroot[ansible_distribution].chroot | default(omit) }}"
- name: append to pkgs
set_fact:
syspkgs: "{{ (syspkgs | default([])) + [ 'zoxide' ] }}"
tags:
- RedHat
- linux
- package

11
tasks/pkgs/Debian/zsh.yml Normal file
View File

@@ -0,0 +1,11 @@
---
- name: Install zsh for Debian based distros
become: true
ansible.builtin.apt:
name: zsh
state: latest
tags:
- Debian
- linux
- package