Files
ansible_role_package/tasks/facts.yml
Matthew Stobbs e39c3b7046 working on cleanup and fixing a few format issues
- modifying how installs are done
2026-02-15 17:57:05 -07:00

67 lines
1.9 KiB
YAML

# vim: set filetype=yaml.ansible :
---
- name: Set package_home_base for Darwin
when:
- ansible_facts["system"] == 'Darwin'
ansible.builtin.set_fact:
package_home_base: /Users
- name: Set package_home_base for Linux
when:
- ansible_facts["system"] == 'Linux' or
ansible_facts["os_family"] == 'FreeBSD'
ansible.builtin.set_fact:
package_home_base: /home
- name: Set default paths
ansible.builtin.set_fact:
path_appimage: "{{ install_prefix }}/appimage"
path_archive: "{{ install_prefix }}/archive"
path_bin: "{{ install_prefix }}/bin"
path_cargo: "{{ install_prefix }}/cargo"
path_source: "{{ install_prefix }}/source"
path_go: "{{ install_prefix }}/go"
path_pipx: "{{ install_prefix }}/pipx"
store_path: "{{ ansible_facts['user_dir'] }}/.cache/ansible_role_package"
path_lib: "{{ install_prefix }}/lib"
- name: Set install_become_group from install_become_user
block:
- name: Get install_become_user userinfo
ansible.builtin.getent:
database: passwd
key: "{{ install_become_user }}"
- name: Set Linux specific facts
when:
- ansible_facts["system"] == 'Linux'
ansible.builtin.set_fact:
pipx_exec: "/usr/bin/pipx"
path_lib: lib64
root_prefix: /usr/local
- name: Set alpine linux specific facts
when:
- ansible_facts["os_family"] == 'Alpine'
ansible.builtin.set_fact:
path_lib: lib
- name: Set dist code if RedHat based
when:
- ansible_facts["os_family"] == 'RedHat'
changed_when: false
register: rpm_dist
ansible.builtin.command:
cmd: rpm --eval "%{dist}"
- name: Set macOS specific facts
when:
- ansible_facts["distribution"] == 'MacOSX' or
ansible_facts["distribution"] == 'MacOS'
ansible.builtin.set_fact:
brewtap: [] # homebrew taps to add
pipx_exec: "/opt/homebrew/bin/pipx" # pipx executable
pkg_cask: [] # homebrew casks
pkg_tap: [] # homebrew tap packages
path_lib: lib # macos shared library path