should have all the variables needed

This commit is contained in:
Matthew Stobbs
2026-01-25 01:38:28 -07:00
parent 7b8eaf35b7
commit fc0f6e6a82
5 changed files with 120 additions and 66 deletions

View File

@@ -12,54 +12,58 @@
ansible.builtin.set_fact:
package_home_base: /home
- name: Set local path prefix
when:
- use_local
- name: Set defaults paths
ansible.builtin.set_fact:
path:
prefix: "{{ package_home_base }}/{{ ansible_ssh_user }}/.local"
- name: Set non-local path prefix
when:
- not use_local
ansible.builtin.set_fact:
path:
prefix: "{{ default_install_prefix }}"
install_prefix: "{{ install_prefix | default(default_install_prefix) }}"
default_store_path: "{{ ansible_user_dir }}/.cache/ansible_role_package"
default_path_appimage: "{{ install_prefix | default(default_install_prefix) }}/appimage"
default_path_archive: "{{ install_prefix | default(default_install_prefix) }}/archive"
default_path_bin: "{{ install_prefix | default(default_install_prefix) }}/bin"
default_path_cargo: "{{ install_prefix | default(default_install_prefix) }}/cargo"
default_path_go: "{{ install_prefix | default(default_install_prefix) }}/go"
default_path_pipx: "{{ install_prefix | default(default_install_prefix) }}/pipx"
- name: Set install variables
ansible.builtin.set_fact:
ext_become: "{{ not use_local }}"
path:
prefix: "{{ default_install_prefix }}"
appimage: "{{ path.appimage | default(path.prefix ~ defaults.path.suffix.appimage) }}"
archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}"
bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}"
cargo: "{{ path.cargo | default(path.prefix ~ defaults.path.suffix.cargo) }}"
go: "{% if ansible_distribution == 'MacOSX' %}/usr/local/go{% else %}{{ path.go | default(path.prefix ~ defaults.path.suffix.go) }}{% endif %}"
pipx: "{{ path.pipx | default(path.prefix ~ defaults.path.suffix.pipx) }}"
store_path: "{{ store_path | default(default_store_path) }}"
path_appimage: "{{ path_appimage | default(default_path_appimage) }}"
path_archive: "{{ path_archive | default(default_path_archive) }}"
path_bin: "{{ path_bin | default(default_path_bin) }}"
path_cargo: "{{ path_cargo | default(default_path_cargo) }}"
path_go: "{{ path_go | default(default_path_go) }}"
path_pipx: "{{ path_pipx | default(default_path_pipx) }}"
- name: Set OS independant facts
ansible.builtin.set_fact:
pkg_archive: [] # packages installed via prebuilt archive
pkg_cargo: [] # rust packages from cargo using `cargo install`
pkg_cargo_build: [] # rust packages using `cargo build` before install
pkg_go: [] # go applications
pkg_npm: [] # npm commands
pkg_pipx: [] # pipx packages
pkg_src: [] # packages built from source
pkg_sys: [] # system package manager packages, homebrew on macOS, dnf for RedHat based, apt for Debian Based
pkg_zig: [] # zig packages
- name: Set Linux specific facts
when:
- ansible_system == 'Linux'
ansible.builtin.set_fact:
flatpak_remote: # flatpak remotes, includes flathub by default
- name: flathub
url: https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak_remotes: "{{ default_flatpak_remotes }}"
pkg_appimage: [] # appimages to install
pkg_flatpak: [] # flatpak packages to install
pkg_snap: [] # snpacraft.io packages
pipx_exec: "/usr/bin/pipx"
sys_pkg_become: true # Linux package managers require sudo access
lib_path: lib64
path_lib: lib64
root_prefix: /usr/local
- name: Set alpine linux specific facts
when:
- ansible_os_family == 'Alpine'
ansible.builtin.set_fact:
lib_path: lib
path_lib: lib
- name: Set rpm dist if RedHat based
- name: Set dist code if RedHat based
when:
- ansible_os_family == 'RedHat'
changed_when: false
@@ -76,17 +80,4 @@
pipx_exec: "/opt/homebrew/bin/pipx" # pipx executable
pkg_cask: [] # homebrew casks
pkg_tap: [] # homebrew tap packages
sys_pkg_become: false # homebrew doesn't require sudo access
lib_path: lib # macos shared library path
- name: Set OS independant facts
ansible.builtin.set_fact:
pkg_archive: [] # packages installed via prebuilt archive
pkg_cargo: [] # rust packages from cargo using `cargo install`
pkg_cargo_build: [] # rust packages using `cargo build` before install
pkg_go: [] # go applications
pkg_npm: [] # npm commands
pkg_pipx: [] # pipx packages
pkg_zig: [] # zig packages
pkg_src: [] # packages built from source
pkg_sys: [] # system package manager packages, homebrew on macOS, dnf for RedHat based, apt for Debian Based
path_lib: lib # macos shared library path