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

@@ -1,45 +0,0 @@
---
- name: full homebrew upgrade if enabled
community.general.homebrew:
update_homebrew: true
upgrade_all: true
when: full_upgrade
tags:
- upgrade
- packages
- Darwin
- macOS
- homebrew
- name: full cask upgrade if enabled
community.general.homebrew_cask:
upgrade_all: true
when: full_upgrade
tags:
- upgrade
- packages
- Darwin
- macOS
- homebrew
- homebrew_cask
- name: install homebrew pkgs
community.general.homebrew:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
tags:
- packages
- Darwin
- macOS
- homebrew
- name: install homebrew casks
community.general.homebrew_cask:
name: "{{ (caskpkgs | default([])) | unique }}"
state: "{{ install_state }}"
tags:
- packages
- Darwin
- macOS
- homebrew
- homebrew_cask

View File

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

View File

@@ -1,22 +0,0 @@
---
- name: append to pkgs
when: ansible_distribution == "Fedora"
set_fact:
syspkgs: "{{ syspkgs + [ 'neovim', 'python3-neovim' ] }}"
tags:
- RedHat
- linux
- package
- name: install neovim appimage
when: ansible_distribution != "Fedora"
become: true
ansible.builtin.get_url:
url: https://github.com/neovim/neovim/releases/download/v0.10.0/nvim.appimage
dest: /usr/local/bin/nvim
checksum: sha256:6a021e9465fe3d3375e28c3e94c1c2c4f7d1a5a67e4a78cf52d18d77b1471390
tags:
- RedHat
- linux
- package

View File

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

View File

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

View File

@@ -1,33 +0,0 @@
---
- name: full system upgrade if enabled
ansible.builtin.apt:
name: "*"
state: latest
when: full_upgrade
become: true
tags:
- upgrade
- packages
- asroot
- name: install packages from system package manager
ansible.builtin.dnf:
update_cache: true
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
when: syspkgs|length > 0
become: true
tags:
- packages
- asroot
- os
- name: install packages from outside system package manager
ansible.builtin.include_tasks:
file: "{{ altpkg }}"
loop: "{{ altpkgs }}"
loop_control:
loop_var: altpkg
tags:
- packages
- altinstall

View File

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

View File

@@ -1,22 +0,0 @@
---
- name: append to pkgs
when: ansible_distribution == "Fedora"
set_fact:
syspkgs: "{{ syspkgs + [ 'neovim', 'python3-neovim' ] }}"
tags:
- RedHat
- linux
- package
- name: install neovim appimage
when: ansible_distribution != "Fedora"
become: true
ansible.builtin.get_url:
url: https://github.com/neovim/neovim/releases/download/v0.10.0/nvim.appimage
dest: /usr/local/bin/nvim
checksum: sha256:6a021e9465fe3d3375e28c3e94c1c2c4f7d1a5a67e4a78cf52d18d77b1471390
tags:
- RedHat
- linux
- package

View File

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

View File

@@ -1,33 +0,0 @@
---
- name: full system upgrade if enabled
ansible.builtin.dnf:
name: "*"
state: latest
when: full_upgrade
become: true
tags:
- upgrade
- packages
- asroot
- RedHat
- name: install packages from system package manager
ansible.builtin.dnf:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
when: syspkgs|length > 0
become: true
tags:
- packages
- asroot
- os
- name: install packages from outside system
ansible.builtin.include_tasks:
file: "{{ altpkg }}"
loop: "{{ altpkgs }}"
loop_control:
loop_var: altpkg
tags:
- packages
- altinstall

0
tasks/build/.crates.toml Normal file
View File

View File

View File

@@ -1,4 +1,8 @@
--- ---
- ansible.builtin.include_vars:
file: alacritty.yml
name: _alacritty
- name: build and install alacritty - name: build and install alacritty
become: true become: true
ansible.builtin.command: ansible.builtin.command:
@@ -10,4 +14,4 @@
- --git - --git
- https://github.com/alacritty/alacritty.git - https://github.com/alacritty/alacritty.git
- --tag - --tag
- "v{{ versions.alacritty }}" - "v{{ _alacritty.version }}"

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -1,11 +1,15 @@
--- ---
- ansible.buildin.include_vars:
file: go.yml
name: _go
- name: set go arch - name: set go arch
ansible.builtin.set_fact: ansible.builtin.set_fact:
arch: "{{ _go.archmap[ansible_architecture] }}" arch: "{{ _go.archmap[ansible_architecture] }}"
- name: set go Filename - name: set go Filename
ansible.builtin.set_fact: ansible.builtin.set_fact:
goFilename: "go{{ versions.go }}.linux-{{ arch }}.tar.gz" go_archive: "go{{ _go.version }}.linux-{{ arch }}.tar.gz"
tags: tags:
- dev - dev
- go - go
@@ -20,8 +24,8 @@
- name: download go archive - name: download go archive
become: true become: true
ansible.builtin.get_url: ansible.builtin.get_url:
dest: "{{ d_go_dl_tmp }}/{{ goFilename }}" dest: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
url: "https://go.dev/dl/{{ goFilename }}" url: "https://go.dev/dl/{{ go_archive }}"
checksum: "{{ _go[versions.go].Linux[arch] }}" checksum: "{{ _go[versions.go].Linux[arch] }}"
decompress: false decompress: false
tags: tags:
@@ -38,5 +42,5 @@
become: true become: true
ansible.builtin.unarchive: ansible.builtin.unarchive:
dest: "{{ _go.install_path }}" dest: "{{ _go.install_path }}"
src: "{{ d_go_dl_tmp.path }}/{{ goFilename }}" src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
remote_src: true remote_src: true

View File

@@ -1,8 +1,20 @@
--- ---
- ansible.builtin.include_vars:
file: neovide.yml
name: _neovide
- name: build and install neovide - name: build and install neovide
become: true become: true
ansible.builtin.command: ansible.builtin.command:
cmd: "cargo install --root {{ _neovide.install_prefix }} --git https://github.com/neovide/neovide" cmd:
- cargo
- install
- --root
- "{% if ansible_os_family != 'Linux' %}.{% else %}{{ _neovide.install_prefix }}"
- --git
- https://github.com/neovide/neovide.git
- --tag
- "{{ _neovide.version }}"
- name: Copy neovide icon - name: Copy neovide icon
become: true become: true

36
tasks/build/neovim.yml Normal file
View File

@@ -0,0 +1,36 @@
- ansible.builtin.include_vars:
file: neovim.yml
name: _neovim
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: nvim.
register: d_nvim_tmp
- name: clone neovim git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_nvim_tmp.path }}/neovim"
repo: "{{ _neovim.git_repo }}"
version: "v{{ _neovim.version }}"
- name: build neovim
ansible.builtin.command:
chdir: "{{ d_nvim_tmp.path }}/neovim"
cmd:
- make
- "CMAKE_BUILD_Type={{ _neovim.build_type }}"
- "CMAKE_INSTALL_PREFIX={{ _neovim.install_prefix }}"
- name: install neovim appimage
become: true
ansible.builtin.get_url:
url: https://github.com/neovim/neovim/releases/download/v{{ _neovim.version }}/nvim.appimage
dest: /usr/local/bin/nvim
checksum: sha256:6a021e9465fe3d3375e28c3e94c1c2c4f7d1a5a67e4a78cf52d18d77b1471390
tags:
- RedHat
- linux
- package

View File

@@ -2,7 +2,13 @@
- name: install nushell via cargo - name: install nushell via cargo
become: true become: true
ansible.builtin.command: ansible.builtin.command:
cmd: "cargo install --root {{ _nushell.install_prefix }} {{ nuitem }} --locked" cmd:
- cargo
- install
- --root
- "{{ _nushell.install_prefix }}"
- "{{ nuitem }}"
- --locked
loop_control: loop_control:
loop_var: nuitem loop_var: nuitem
loop: loop:

View File

@@ -1,7 +1,7 @@
--- ---
- name: generate package manager installation list - name: generate package installation lists
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "{{ ansible_os_family }}/{{ pkg }}.yml" file: "pkgs/{{ ansible_os_family }}/{{ pkg }}.yml"
loop: "{{ packages }}" loop: "{{ packages }}"
loop_control: loop_control:
loop_var: pkg loop_var: pkg
@@ -9,8 +9,60 @@
- config - config
- packages - packages
- name: install system package list - name: upgrade linux packages
ansible.builtin.include_tasks: block:
file: "{{ ansible_os_family }}_do_install.yml" - ansible.builtin.dnf:
name: "*"
state: latest
when: ansible_os_family == 'RedHat'
- ansible.builtin.apt:
name: "*"
state: latest
when: ansible_os_family == 'Debian'
become: true
when: full_upgrade
- name: Linux specific installation
block:
- ansible.builtin.dnf:
name: "{{ syspkgs }}"
state: "{{ install_state }}"
when: ansible_os_family == 'RedHat'
- ansible.builtin.apt:
name: "{{ syspkgs }}"
state: "{{ install_state }}"
when: ansible_os_family == 'Darwin'
become: true
when: ansible_system == 'Linux'
tags:
- Linux
- RedHat
- Debian
- packages
- name: Macos specific installation
block:
- community.general.homebrew:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
- community.general.homebrew_cask:
name: "{{ caskpkgs | unique }}"
state: "{{ install_state }}"
tags: tags:
- packages - packages
- Darwin
- macOS
- homebrew
- homebrew_cask
- name: install srcpkgs
ansible.builtin.include_tasks:
file: "build/{{ srcpkg }}.yml"
loop: "{{ srcpkgs }}"
loop_control:
loop_var: srcpkg
when: srcpkgs|length > 0
tags:
- packages
- source

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

@@ -1,9 +1,24 @@
# install hashicorp vault for Debian/Ubuntu # 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 - name: install hashicorp archive gpg key
become: true become: true
ansible.builtin.command: ansible.builtin.command:
cmd: wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg cmd:
- gpg
- --dearmor
- -o
- /usr/share/keyrings/hashicorp-archive-keyring.gpg
- "{{ d_hashicorp_tmp.path }}/gpg"
- name: enable hasicorp repo for debian - name: enable hasicorp repo for debian
ansible.builtin.apt_repository: ansible.builtin.apt_repository:

View File

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

@@ -13,4 +13,4 @@
- name: append to pkgs - name: append to pkgs
set_fact: set_fact:
syspkgs: "{{ syspkgs + nushell_pkgdeps }}" syspkgs: "{{ syspkgs + nushell_pkgdeps }}"
altpkgs: "{{ altpkgs + nushell_altdeps }}" srcpkgs: "{{ srcpkgs + nushell_altdeps }}"

View File

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

View File

@@ -1,7 +1,7 @@
--- ---
- name: install rust and cargo - name: install rust and cargo
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "{{ ansible_os_family }}/rust.yml" file: "pkgs/{{ ansible_os_family }}/rust.yml"
tags: tags:
- rust - rust
- dependency - dependency
@@ -19,7 +19,7 @@
- name: append to pkgs - name: append to pkgs
set_fact: set_fact:
syspkgs: "{{ syspkgs + alacritty_deps }}" syspkgs: "{{ syspkgs + alacritty_deps }}"
altpkgs: "{{ altpkgs + [ 'Linux/alacritty.yml' ] }}" srcpkgs: "{{ srcpkgs + [ 'build/alacritty.yml' ] }}"
tags: tags:
- syspkgs - syspkgs
- altpkgs - srcpkgs

View File

@@ -3,5 +3,5 @@
become: true become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: "{{ _ghbase }}/carapace-sh/carapace-bin/releases/download/v{{ carapace_version }}/carapace-bin_{{ carapace_version }}_linux_amd64.rpm" name: "{{ _ghbase }}/carapace-sh/carapace-bin/releases/download/v{{ carapace_version }}/carapace-bin_{{ carapace_version }}_linux_amd64.rpm"
state: present state: "{{ install_state }}"
disable_gpg_check: true disable_gpg_check: true

View File

@@ -1,7 +1,7 @@
--- ---
- name: ensure hashicorp repo is active - name: ensure hashicorp repo is active
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "{{ ansible_os_family }}/hashicorp_repo.yml" file: "pkgs/{{ ansible_os_family }}/hashicorp_repo.yml"
- name: append to pkgs - name: append to pkgs
set_fact: set_fact:

View File

@@ -1,7 +1,7 @@
--- ---
- name: ensure dependencies - name: ensure dependencies
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: packages/RedHat/terra_repo.yml file: "pkgs/{{ ansible_os_family }}/terra_repo.yml"
tags: tags:
- dependency - dependency
- package - package

Some files were not shown because too many files have changed in this diff Show More