ac7ad62d401474a7f79a6cc3d5928db40be7ca9b
ansible_role_package
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.
Order of precedence for package installation:
- System package manager (dnf, apt, homebrew, etc.)
- Source built - only in some situations, like for fast moving software (neovim, hyprland)
- Appimage (Linux only)
- Flatpak (Linux only)
- Snap (Linux only), takes precedence over flatpak on Ubuntu based systems
- Language package manager (
cargo install,go install,npm install, etc.)
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
- MacOS
- RHEL based distributions Experimental best effort
- Debian Experimental
- 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
- aquamarine: graphics library for hyrpland default method source
- bashls: bash language server
- bat: bat, an ehanced replacement for cat
- bitwarden: password mananger
- blender: 3d modeling, video editing tools
- broot: a file browser/manager for the cli
- btop: advanced top replacement
- buf: protocol buffer tooling in go
- bufls: protocol buffer language server
- carapace: universal command completion engine
- 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
- cockpit: webui to managed linux systems
- commitlint-cli: linting for git commit messages
- commitlint-config-conventional: config for commitlint-cli
- consul: service discovery by hashicorp
- cssls: css language server
- curlie: enhanced version of curl
- dbeaver: database manager gui
- direnv: load .env files in the cli
- dockerls: dockerfile lanaguage server
- dotenv-linter: linter for .env files
- duf: a good looking replacement for df
- dust: a better looking version of du
- editorconfig: common editor configuration system
- eslint: ECMA Script linting
- eza: a modern ls replacement
- fd: a modern replacement for find
- firefox: a modern OSS web browser
- 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
- glow: cli markdown parser and viewer
- go: the go programming language default method archive
- godot: the best OSS game making studio/engine
- gopls: the go language server
- gping: graphical pinging on the cli
- greetd: a simple system greeter
- heroic: heroic games launcher
- htmlls: html language server
- htmx-lsp: htmx language server
- httpie: a graphical REST client
- hugo: static html site generator
- hyperfine: a cli benchmarking tool
- hyprcursor: a hyprland support library
- hyprgraphics: a hyrpland graphics library
- hypridle: hyprland system idle monitor
- hyprland: a pretty tiling window manager
- hyprland_protocols: a hyprland wayland protocol library
- hyprland_qt_support: hyprland qt libraries
- hyprland_qtutils: hyrpland tools in qt
- hyprlang: hyprland configuration language
- hyprlock: hyprland screen locker
- hyprpaper: hyprland wallpaper manager
- hyprpicker: hyprland colour picker
- hyprpolkitagent: hyprland policy kit agent
- hyprutils: hyprland utilities library
- hyprwayland_scanner: hyprland wayland library scanner
- intelephense: php language server, linter and formatter
- jinja-lsp: the jinja language server
- jq: json cli parser
- jsonls: json language server
- kitty: high perfomance terminal emulator
- lazygit: git made easy
- libreoffice: the free office suite
- luals: lua language server
- markdownlint-cli: markdown linter
- mcfly: cli history manager
- minio_client: cli S3 client
- neovide: graphical interface for neovim in rust
- neovim: best vim fork ever #neovim #development
- nerdfonts: fonts patched with icons and glyphs
- nfs_client: nfs client software
- nfs_server: nfs server software
- nginxls: nginx configuration language server
- nodejs: javascript runtime engine
- nomad: application orchestration by hashicorp
- nwg_hello: a greetd greeter
- packer: machine builder by hashicorp
- pandoc: universal document translator
- pgadmin: postgresql administration gui
- pipx: install pip packages as self contained executables
- podman: container runtime engine compatible with docker
- pulumi: infrastructure as code via regular programming languages
- pyright: python language server, linter and formatter
- python3: python3 language interpreter
- quobix-vacuum: openapi linter and sdk written in go
- restic: an advanced backup system
- revive: a fast and strict linter for go
- ripgrep: fast modern grep replacement
- rust: the rust programming language
- samba_client: client software for samba
- samba_server: server software for samba
- sd: a modern replacement for sed
- sdbus_cpp_2: systemd dbus library version 2
- sqlfluff: sql linter
- sqlls: sql language server
- starship: command line prompt generator
- stow: manage dotfiles easily
- tailscale: p2p vpn with wireguard
- tailwindcss-languageserver: tailwindcss language server
- templ: generate HTML using go
- terraform: infrastructre as code via configuration files
- terraformls: terraform language server
- thunderbird: email client from mozilla
- tidy: html linter and formatter
- tldr: manpage summarizer
- tmux: terminal multiplexer
- uwsm: universal wayland system manager
- vault: secrets management by hashicorp
- xdg_desktop_portal_hyprland: xdg portal for hyprland
- xh: cli curl replacement
- yamlls: yaml language server
- yazi: terminal file manager in rust default method source
- zfs: the zetabyte filesystem
- zig: the zig programming language
- zls: the zig language server
- zoxide: easily jump between directories
- zsh: Z shell
Requirements
- nothing by ansible
Role Variables
use_local: Boolean, defaulttrue- When
true, uses the following paths:$HOME/.localas the install prefix, placing binaries in$HOME/.local/bin$HOME/.local/appimagefor saved appimages, which are then linked to$HOME/.local/bin$HOME/.local/archivefor extracted archives linking binaries to$HOME/.local/bin$HOME/.cachefor caching downloads$HOME/.cargofor cargo installations, placing binaries in$HOME/.cargo/bin
- When
false, uses the following system wide paths:/usr/localas the install prefix, placing binaries in/usr/local/bin/opt/appimagefor saved appimages, which are then linked to/usr/local/bin/opt/archivefor extracted archives, linking binaries to/usr/local/bin/opt/cachefor caching downloads/opt/cargofor rust cargo installations, placing binaries in/opt/cargo/bin
- When
packages: List of strings- List of packages to install from the
Available Packageslist
- List of packages to install from the
prefer_method: String, defaultsystem- The preferred method of installation an application when multiple options exist
- Valid options are:
flatpak- Flatpak, Linux onlylangtool- Using language tools such ascargo,go,npmorpipxsnap- Snap, Linux onlysource- Prefer building from source. Not recommendedsystem- 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
- Matthew Stobbs matthew@stobbs.ca
Description
Ansible role to install various packages used on workstations and servers
https://git.sprouting.cloud/sprouting.cloud/ansible_role_package
Languages
Python
77.2%
Shell
12.2%
Jinja
10.6%