# 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 - 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, 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 ```yaml - 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