81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Set common facts
|
|
ansible.builtin.set_fact:
|
|
distribution: "{{ ansible_facts['distribution'] }}"
|
|
system: "{{ ansible_facts['system'] }}"
|
|
os_family: "{{ ansible_facts['os_family'] }}"
|
|
user_dir: "{{ ansible_facts['user_dir'] }}"
|
|
user_id: "{{ ansible_facts['user_id'] }}"
|
|
user_gid: "{{ ansible_facts['user_gid'] }}"
|
|
os_version:
|
|
major: "{{ ansible_facts['distribution_major_version'] }}"
|
|
version: "{{ ansible_facts['distribution_version'] }}"
|
|
release: "{{ ansible_facts['distribution_release'] }}"
|
|
|
|
- name: Set package_home_base for Darwin
|
|
when:
|
|
- system == 'Darwin'
|
|
ansible.builtin.set_fact:
|
|
package_home_base: /Users
|
|
|
|
- name: Set package_home_base for Linux
|
|
when:
|
|
- system == 'Linux' or
|
|
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_zig: "{{ install_prefix }}/zig"
|
|
path_pipx: "{{ install_prefix }}/pipx"
|
|
store_path: "{{ 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:
|
|
- 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:
|
|
- os_family == 'Alpine'
|
|
ansible.builtin.set_fact:
|
|
path_lib: lib
|
|
|
|
- name: Set dist code if RedHat based
|
|
when:
|
|
- os_family == 'RedHat'
|
|
changed_when: false
|
|
register: rpm_dist
|
|
ansible.builtin.command:
|
|
cmd: rpm --eval "%{dist}"
|
|
|
|
- name: Set macOS specific facts
|
|
when:
|
|
- distribution == 'MacOSX' or
|
|
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
|