96 lines
3.0 KiB
YAML
96 lines
3.0 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Set package_home_base for Darwin
|
|
when:
|
|
- ansible_system == 'Darwin'
|
|
ansible.builtin.set_fact:
|
|
package_home_base: /Users
|
|
|
|
- name: Set package_home_base for Linux
|
|
when:
|
|
- ansible_system == 'Linux'
|
|
ansible.builtin.set_fact:
|
|
package_home_base: /home
|
|
|
|
- name: Dump ansible user
|
|
debug:
|
|
var: ansible_ssh_user
|
|
|
|
- name: Set local path prefix
|
|
when:
|
|
- use_local
|
|
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: "{{ defaults.path.prefix }}"
|
|
|
|
- name: Set install variables
|
|
ansible.builtin.set_fact:
|
|
ext_become: "{{ not use_local }}"
|
|
path:
|
|
prefix: "{{ path.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) }}"
|
|
|
|
- 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_method: "{% if use_local %}user{% else %}system{% endif %}"
|
|
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
|
|
root_prefix: /usr/local
|
|
|
|
- name: Set alpine linux specific facts
|
|
when:
|
|
- ansible_os_family == 'Alpine'
|
|
ansible.builtin.set_fact:
|
|
lib_path: lib
|
|
|
|
- name: Set rpm dist if RedHat based
|
|
when:
|
|
- ansible_os_family == 'RedHat'
|
|
changed_when: false
|
|
register: rpm_dist
|
|
ansible.builtin.command:
|
|
cmd: rpm --eval "%{dist}"
|
|
|
|
- name: Set macOS specific facts
|
|
when:
|
|
- ansible_distribution == 'MacOSX'
|
|
ansible.builtin.set_fact:
|
|
brewtap: [] # homebrew taps to add
|
|
pipx_exec: "/opt/homebrew/bin/pipx"
|
|
pkg_cask: [] # homebrew casks
|
|
pkg_tap: [] # homebrew tap packages
|
|
sys_pkg_become: false # homebrew doesn't require sudo access
|
|
lib_path: lib
|
|
|
|
- name: Set OS independant facts
|
|
ansible.builtin.set_fact:
|
|
pkg_archive: [] # packages installed via prebuilt archive
|
|
pkg_cargo: [] # rust packages from cargo
|
|
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: []
|