Matthew Stobbs 01239701f9 add restic
- fix packages that were broken
- change the way configuration is done
  - define default facts for packages with os_family level vars
  - refine the default facts into an os_family specfic config
2026-04-18 18:44:18 -06:00
2025-01-17 13:50:08 -07:00
2025-03-24 21:42:43 -06:00
2026-04-18 18:44:18 -06:00
2025-03-23 14:04:51 -06:00
2026-04-14 00:31:05 -06:00
2025-01-24 23:23:24 -07:00
2026-04-14 00:40:06 -06:00

Ansible package manager

A ports like system for ansible

Manage package installation for a number of packages that sometimes need special handling. Some are built from source, some are appimages, some are special sources like cargo, npm, go, etc.

When defining a workstation role, I had a lot of packages that needed special instructions to properly install and use. I decided to simplify the management of those packages by creating a role with special handling.

The following are for general use. Not all packages have a candidate for system package managers

Order of precedence for package installation:

  1. System package manager (dnf, apt, homebrew, etc.)
  2. Source built - only in some situations, like for fast moving software (neovim, hyprland)
    • Includes language package managers like go install, cargo install, and npm install
  3. Flatpak (Linux only)
  4. Snap (Linux only)
  5. Appimage (Linux only)

This does not configure installed software, just installs it

To install any of the available packages, they must be part of a list called packages. Dependencies are handled on a best case basis.

Supported Operating Systems

  • Fedora Linux first class support
  • MacOS best effort
  • RHEL based distributions Experimental, best effort
  • Debian Experimental, best effort
  • Alpine linux Experimental, best effort

Available Packages

  • air: hot reload for go default method source
  • alacritty: terminal built in rust default method source
  • ansible-lint: linting for yaml.ansible files default method pipx
  • ansible: configuration management default method system
  • ansible_ls: ansible language-server
  • bashls: bash language server
  • bat: bat, an ehanced replacement for cat
  • broot: a file browser/manager for the cli
  • btop: advanced top replacement
  • buf: protocol buffer tooling in go
  • bufls: protocol buffer language server
  • cbfmt: tool to format codeblocks inside structured documents
  • cheat: cli cheatsheet creator and viewer
  • checkmake: a linter and analyzer for makefiles
  • choose: an alternative to cut written in rust
  • clangd: the LLVM based C/C++ compiler, langauge server and linter
  • cmake: build system for C/C++ projects
  • cmakelang: cmake linter and formatter
  • commitlint-cli: linting for git commit messages
  • commitlint-config-conventional: config for commitlint-cli
  • cssls: css language server
  • direnv: load .env files in the cli
  • dockerls: dockerfile lanaguage server
  • eslint: ECMA Script linting
  • eza: a modern ls replacement
  • fd: a modern replacement for find
  • firewalld: modern zone based firewall
  • flatpak: universal linux package management system
  • fzf: fuzzy find from a list given over stdin
  • ghostty: a modern advanced terminal emulator
  • git: project versioning system default method system
  • gitea-server: git hosting with a cup of tea
  • go: the go programming language default method archive
  • gopls: the go language server
  • gping: graphical pinging on the cli
  • htmlls: html language server
  • jsonls: json language server
  • lazygit: git made easy
  • neovim: best vim fork ever #neovim #development
  • nerdfonts: fonts patched with icons and glyphs
  • nodejs: javascript runtime engine
  • npm: nodejs package manager
  • pipx: install pip packages as self contained executables
  • ripgrep: fast modern grep replacement
  • rust: the rust programming language
  • starship: command line prompt generator
  • yazi: terminal file manager in rust default method source
  • zig: the zig programming language
  • zoxide: easily jump between directories
  • zsh: Z shell

Requirements

  • nothing by ansible

Role Variables

  • use_local: Boolean, default true
    • When true, uses the following paths:
      • $HOME/.local as the install prefix, placing binaries in $HOME/.local/bin
      • $HOME/.local/appimage for saved appimages, which are then linked to $HOME/.local/bin
      • $HOME/.local/archive for extracted archives linking binaries to $HOME/.local/bin
      • $HOME/.cache for caching downloads
      • $HOME/.cargo for cargo installations, placing binaries in $HOME/.cargo/bin
    • When false, uses the following system wide paths:
      • /usr/local as the install prefix, placing binaries in /usr/local/bin
      • /opt/appimage for saved appimages, which are then linked to /usr/local/bin
      • /opt/archive for extracted archives, linking binaries to /usr/local/bin
      • /opt/cache for caching downloads
      • /opt/cargo for rust cargo installations, placing binaries in /opt/cargo/bin
  • packages: List of strings
    • List of packages to install from the Available Packages list
  • prefer_method: String, default system
    • The preferred method of installation an application when multiple options exist
    • Valid options are:
      • flatpak - Flatpak, Linux only
      • langtool - Using language tools such as cargo, go, npm or pipx
      • snap - Snap, Linux only
      • source - Prefer building from source. Not recommended
      • system - Default, system package manager (dnf, apt, homebrew, etc.)

Dependencies

Example Playbook

- name: Ensure packages are installed
  vars:
    packages:
      - air
      - go
      - rust
      - neovim
  hosts: devmachines
  gather_facts: true
  tasks:
    - name: Install given packages
      ansible.builtin.inlude_role:
        name: ansible_role_package

License

MIT

Author Information

Description
Ansible role to install various packages used on workstations and servers
https://git.sprouting.cloud/sprouting.cloud/ansible_role_package
Readme 1.4 MiB
Languages
Python 77.2%
Shell 12.2%
Jinja 10.6%