Working on source packages

Signed-off-by: Matthew Stobbs <matthew@stobbs.ca>
This commit is contained in:
Matthew Stobbs
2026-02-02 02:35:16 -07:00
parent fa78c0aa0c
commit c613a29ce4
14 changed files with 470 additions and 396 deletions

View File

@@ -5,10 +5,61 @@ argument_specs:
short_description: Install software using ansible
description:
- Make the installation of packages consistent on each platform.
- Installs for RedHat, Debian and MacOS based systems.
author:
- Matthew Stobbs <matthew@stobbs.ca>
- Will install via system package managers, source, or specific install tool. For example, a go package installed via source will run `go install`.
maintainers:
- Matthew Stobbs
options:
packages:
type: list
elements: str
required: true
description:
- List of packages to install using this role's package name.
- See README.md for the list of available packages.
install_become:
type: bool
default: true
description:
- Install packages using privilege elevation.
install_become_user:
type: bool
default: root
description:
- User to become when install_become is true.
install_method:
type: str
default: system
description:
- Install packages using system package manager when available.
- When a package doesn't have a system install candidate for the host, it uses it's default install method as defined in the pkglist variables called `<pkgname>_install_methods`
- Most packages will be either `system` or `source` installs.
- System installs default to using the system package manager, if possible.
- Source installs download, build and install the package via source code. Source installs could be of different types based on the language. For example; python packages installed using `source` are installed with either pipx (default) or system pip.
choices:
- system
- source
python_package_method:
type: str
default: pipx
description:
- How to install pip packages.
choices:
- pipx
- system
install_prefix:
type: str
required: false
default: /usr/local
description:
- The prefix to use for non-system package installs.
- All package files will be installed using the directory prefixed by this prefix.
extra_ldd_paths:
type: list
elements: path
required: false
default: []
description:
- Paths to add to the ld.so.conf path list. Will create a file in `/etc/ld.so.conf.d/` on most systems.
packages:
type: list
elements: str
@@ -16,80 +67,84 @@ argument_specs:
description:
- The list of packages to install by name.
- The list must contain only values that exist in B(Available Packages) in README.md
extra_packages:
packages_extra:
type: list
elements: str
required: false
default: []
description:
- Extra system packages by installation name to install using the system package manager
- These are installed directly using the system package manager
flatpak_default_remote:
type: str
required: false
default: flathub
description:
- the Default remote name to use with flatpak installation.
flatpak_method:
type: str
required: false
default: system
description:
- Default installation method for flatpaks.
- Possible values are 'system' and 'user'
install_method:
type: str
default: system
choices:
- system
- source
- appimage
- flatpak
- snap
- Possible values are 'system' and 'user'.
- Only applies to linux distros.
flatpak_remotes:
type: list
elements: dict
required: false
default:
- name: flathub
url: https://dl.flathub.org/repo/flathub.flatpakrepo
description:
- Default installation method for packages.
- Varies between each indivdual package, but this is for overall package installation.
- Possible values are V(system), V(source), V(appimage), V(flatpak), V(snap)
- When using MacOS, the V(system) option uses homebrew by default.
install_prefix:
type: path
default: /usr/local
description:
- Default installation prefix when installation non-system packages.
store_path:
type: path
default: ANSIBLE_USER_DIR/.cache/ansible_role_package
description:
- Where to store cached files like archives and git repos
clean_source:
- List of flatpak remotes to add to the system.
- Does not remove pre existing flatpak repos.
clean_install:
type: bool
default: false
description:
- Remove existing installation of package before installing
- Remove existing installation of package before installing.
path_appimage:
type: path
default: INSTALL_PREFIX/appimage
default: /usr/local/appimage
description:
- Where appimage files are stored.
path_archive:
type: path
default: INSTALL_PREFIX/archive
default: /usr/local/archive
description:
- Where archives are extracted.
path_bin:
type: path
default: INSTALL_PREFIX/bin
default: /usr/local/bin
description:
- Where binaries are installed or linked.
- Needs to be added to your PATH
- Needs to be added to your PATH to be usable.
path_cargo:
type: path
default: INSTALL_PREFIX/cargo
default: /usr/local/cargo
description:
- Where cargo installs it's packages
path_go:
type: path
default: INSTALL_PREFIX/go
default: /usr/local/go
description:
- Where go is installed. Equivalent of GOROOT.
path_pipx:
type: path
default: INSTALL_PREFIX/pipx
default: /usr/local/pipx
description:
- Where pipx installs it's virtual environments
use_become:
type: bool
default: true
store_path:
type: path
default: /<ansible_user_dir>/.cache/ansible_role_package
required: false
description:
- Elevate privileges when installing non-system packages.
- Building will be done as the ansible user, elevating only when installing.
- Where cached files are kept, such as git repositories.
- Packages that are compiled have their source extracted here.
clean_cache:
type: bool
default: false
description:
- Clean the V(store_path) after completing package install.
- Removes source code, archives and git repositories