bfd3afd3536c1f49a02934369ce2543632ad5b3b
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)
- 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 #devtools #go
- alacritty: terminal built in rust #cargo #rust #terminal
- ansible-lint: linting for yaml.ansible files #ansible #devtools
- ansible: configuration management #ansible #management
- ansible_ls: ansible language-server #ansible #devtools
- aquamarine: graphics library for hyrpland #c++ #library #hyprland
- bashls: bash language server #devtools #node
- bat: bat, an ehanced replacement for cat #terminal
- bitwarden: password mananger #password #security #gui
- blender: 3d modeling, video editing tools #3d #gui #media
- broot: a file browser/manager for the cli #cli #cargo #rust
- btop: advanced top replacement #cli #monitor
- buf: protocol buffer tooling in go #devtools #go
- bufls: protocol buffer language server #devtools #go
- carapace: universal command completion engine #cli #tool
- cheat: cli cheatsheet creator and viewer #cli #tool
- checkmake: a linter and analyzer for makefiles #devtools #go
- choose: an alternative to cut written in rust #rust #cargo
- clangd: the LLVM based C/C++ compiler, langauge server and linter #devtools #c #c++
- cmake: build system for C/C++ projects #devtools #c #c++
- cmakelang: cmake linter and formatter #devtools #cmake #python
- commitlint-cli: linting for git commit messages #git #devtools
- commitlint-config-conventional: config for commitlint-cli #git #devtools
- consul: service discovery by hashicorp #go #system #hashicorp
- cssls: css language server #devtools #css
- curlie: enhanced version of curl #devtools #network
- dbeaver: database manager gui #devtools #database
- direnv: load .env files in the cli #devtools #configuration
- dockerls: dockerfile lanaguage server #docker #container #devtools
- dotenv-linter: linter for .env files #devtools #rust
- duf: a good looking replacement for df #cli #tools #monitor
- dust: a better looking version of du #cli #tools #monitor
- editorconfig: common editor configuration system #devtools #editor
- eslint: ECMA Script linting #devtools #ecma #javascript
- eza: a modern ls replacement #cli #tools
- fd: a modern replacement for find #cli #tools
- firefox: a modern OSS web browser #gui #web
- flatpak: universal linux package management system #linux #flatpak #package
- fzf: fuzzy find from a list given over stdin #cli #tools
- ghostty: a modern advanced terminal emulator #tty #terminal #gui #tools
- git: project versioning system #git #devtools #tools
- glow: cli markdown parser and viewer #tools #cli
- go: the go programming language #go #devtools
- godot: the best OSS game making studio/engine #devtools #gaming #gui
- gopls: the go language server #go #devtools
- gping: graphical pinging on the cli #cli #monitor #network
- greetd: a simple system greeter #cli #linux
- heroic: heroic games launcher #gui #gaming #linux
- htmlls: html language server #devtools #html
- htmx-lsp: htmx language server #devtool #html
- httpie: a graphical REST client #devtools #gui #network
- hugo: static html site generator #cli #html #blog
- hyperfine: a cli benchmarking tool #cli #benchmark
- hyprcursor: a hyprland support library #hyprland #c++
- hyprgraphics: a hyrpland graphics library #hyprland #c++
- hypridle: hyprland system idle monitor #hyprland #c++ #system
- hyprland: a pretty tiling window manager #hyprland #linux #c++ #windowmanager
- hyprland_protocols: a hyprland wayland protocol library #hyprland #c++
- hyprland_qt_support: hyprland qt libraries #hyprland #qt #c++
- hyprland_qtutils: hyrpland tools in qt: #hyprland #qt #c++ #tools
- hyprlang: hyprland configuration language #hyrpland #c++
- hyprlock: hyprland screen locker #hyprland #c++ #system
- hyprpaper: hyprland wallpaper manager #hyprland #c++ #graphics
- hyprpicker: hyprland colour picker #hyprland #tool #c++
- hyprpolkitagent: hyprland policy kit agent #hyprland #security #c++
- hyprutils: hyprland utilities library #hyprland #c++ #tools
- hyprwayland_scanner: hyprland wayland library scanner #hyprland #c++ #wayland
- intelephense: php language server, linter and formatter #phpp #devtools
- jinja-lsp: the jinja language server #jinga #python #devtools
- jq: json cli parser #json #cli #devtools
- jsonls: json language server #json #devtools
- kitty: high perfomance terminal emulator #gui #terminal #rust
- lazygit: git made easy #git #cli #devtools
- libreoffice: the free office suite #gui
- luals: lua language server #devtools #lua
- markdownlint-cli: markdown linter #devtools #markdown
- mcfly: cli history manager #cli #shell #tools
- minio_client: cli S3 client #cli #network #tools
- neovide: graphical interface for neovim in rust #neovim #devtools #rust #cargo
- neovim: best vim fork ever #neovim #devtools #cli
- nerdfonts: fonts patched with icons and glyphs #font #gui #terminal
- nextcloud: nextcloud desktop sync client #gui #tools #network
- nginxls: nginx configuration language server #nginx #network #tools
- nodejs: javascript runtime engine #javascript #cli #devtools
- nomad: application orchestration by hashicorp #go #network #hashicorp
- nwg_hello: a greetd greeter #nwg #greetd #linux
- packer: machine builder by hashicorp #vm #go #devtools #hashicorp
- pandoc: universal document translator #cli #tools
- pgadmin: postgresql administration gui #devtools #gui #database
- pipx: install pip packages as self contained executables #python #manage
- podman: container runtime engine compatible with docker #container #cli
- pulumi: infrastructure as code via regular programming languages #iac #cli #manage
- pyright: python language server, linter and formatter #python #devtools
- python3: python3 language interpreter #python #devtools
- quobix-vacuum: openapi linter and sdk written in go #go #network #devtools
- revive: a fast and strict linter for go #go #devtools
- ripgrep: fast modern grep replacement
- rust: the rust programming language #rust #cargo
- sd: a modern replacement for sed #cli #tools
- sdbus_cpp_2: systmd dbus library version 2 #c++ #linux #systemd #devtools
- sqlfluff: sql linter #devtools #sql
- sqlls: sql language server #devtools #sql
- starship: command line prompt generator #cli #tools #shell
- stow: manage dotfiles easily #cli #tools #manage
- tailscale: p2p vpn with wireguard #network #tools #security
- tailwindcss-languageserver: tailwindcss language server #devtool #css #html
- templ: generate HTML using go #go #html #template #devtools
- terraform: infrastructre as code via configuration files #network #devtools #cli #hashicorp
- terraformls: terraform language server #devtools #terraform #hashicorp
- thunderbird: email client from mozilla #email #network #gui
- tidy: html linter and formatter #devtools #html
- tldr: manpage summarizer #cli #tools
- tmux: terminal multiplexer #cli #tools
- uwsm: universal wayland system manager #wayland #hyprland #linux
- vault: secrets management by hashicorp #secrets #security #hashicorp
- xdg_desktop_portal_hyprland: xdg portal for hyprland #hyprland #gui
- xh: cli curl replacement #network #cli #tools
- yamlls: yaml language server #yaml #devtools
- yazi: terminal file manager in rust #cli #tools #rust #cargo
- zfs: the zetabyte filesystem #zfs #filesystem #cli #linux
- zig: the zig programming language #zig #devtools
- zls: the zig language server #zig #devtools
- zoxide: easily jump between directories #cli #shell #tools
- zsh: Z shell #cli #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%