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,25 @@
---
- 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

@@ -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,7 @@
---
- 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

@@ -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: "pkgs/{{ 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/RedHat/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: "pkgs/{{ ansible_os_family }}/terra_repo.yml"
tags:
- dependency
- package
- terra
- syspkgs
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + [ 'ghostty' ] }}"
tags:
- syspkgs

10
tasks/pkgs/RedHat/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

4
tasks/pkgs/RedHat/go.yml Normal file
View File

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

View File

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

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

10
tasks/pkgs/RedHat/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,18 @@
---
- 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

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

@@ -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,22 @@
---
- name: enable terra repo for fedora >=41
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int >= 41
ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: dnf install -y --nogpgcheck --repofrompath 'terra,https://repos.fyralabs.com/terra$releasever' terra-release
- name: enable terra repo for fedora <41
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int < 41
block:
- ansible.builtin.command:
creates: /etc/yum.repos.d/terra.repo
cmd: dnf config-manager --add-repo https://terra.fyralabs.com/terra.repo
become: true
- ansible.builtin.dnf:
name: terra-release
state: present

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' ] }}"

65
tasks/pkgs/RedHat/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,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