214 lines
5.2 KiB
YAML
214 lines
5.2 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Show indev warning
|
|
ansible.builtin.debug:
|
|
msg: "This software is in development. Use at your own risk"
|
|
|
|
- name: Set installation facts
|
|
ansible.builtin.include_tasks:
|
|
file: facts.yml
|
|
|
|
- name: Create cache directory
|
|
register: d_cache
|
|
ansible.builtin.file:
|
|
path: "{{ store_path }}"
|
|
mode: '0755'
|
|
owner: "{{ user_id }}"
|
|
group: "{{ user_gid }}"
|
|
state: directory
|
|
|
|
- name: Ensure required paths exists
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
loop:
|
|
- "{{ install_prefix }}"
|
|
- "{{ path_appimage }}"
|
|
- "{{ path_archive }}"
|
|
- "{{ path_bin }}"
|
|
- "{{ path_cargo }}"
|
|
- "{{ path_source }}"
|
|
- "{{ path_pipx }}"
|
|
loop_control:
|
|
loop_var: path
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
owner: "{{ install_prefix_owner }}"
|
|
group: "{{ install_prefix_group }}"
|
|
path: "{{ path }}"
|
|
|
|
- name: Read package configuration
|
|
ansible.builtin.include_vars:
|
|
file: pkglist.yml
|
|
|
|
- name: Add needed packages for Fedora
|
|
when:
|
|
- distribution == 'Fedora'
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ packages_extra + ['python3-paramiko'] }}"
|
|
|
|
- name: Add needed MacOS packages
|
|
when:
|
|
- distribution == 'MacOSX'
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ packages_extra + ['gnu-tar', 'virtualenv'] }}"
|
|
|
|
- name: Add needed Alpine packages
|
|
when:
|
|
- os_family == 'Alpine'
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ packages_extra + ['tar', 'unzip'] }}"
|
|
|
|
- name: Append extra packages to system install list
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ pkg_sys + packages_extra }}"
|
|
|
|
- name: Generate package installation lists
|
|
loop: "{{ packages | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: "pkgs/{{ pkg }}.yml"
|
|
|
|
- name: Clean installations that require it
|
|
ansible.builtin.include_tasks: "helpers/clean_install.yml"
|
|
|
|
- name: Install go if required
|
|
when:
|
|
- pkg_go|length > 0
|
|
ansible.builtin.include_tasks: pkgs/go.yml
|
|
|
|
- name: Install rust and cargo if required
|
|
when:
|
|
- pkg_cargo|length > 0 or
|
|
pkg_cargo_build|length > 0
|
|
ansible.builtin.include_tasks: pkgs/rust.yml
|
|
|
|
- name: Ensure pipx is installed
|
|
when:
|
|
- pkg_pipx|length > 0
|
|
block:
|
|
- name: Queue pipx install
|
|
ansible.builtin.include_tasks: pkgs/pipx.yml
|
|
|
|
- name: Ensure pipx path exists
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
path: "{{ path_pipx }}"
|
|
|
|
- name: Ensure nodejs and npm are installed
|
|
when:
|
|
- pkg_npm|length > 0
|
|
ansible.builtin.include_tasks: pkgs/nodejs.yml
|
|
|
|
- name: Ensure appimage path exists
|
|
when:
|
|
- pkg_appimage is defined
|
|
- pkg_appimage|length > 0
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
path: "{{ path_appimage }}"
|
|
|
|
- name: Ensure archive path exists
|
|
when:
|
|
- pkg_archive|length > 0
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
path: "{{ path_archive }}"
|
|
|
|
- name: Depend zig
|
|
when:
|
|
- pkg_zig|length > 0
|
|
ansible.builtin.include_tasks: pkgs/zig.yml
|
|
|
|
- name: Install pkg_sys list using system package manager
|
|
when:
|
|
- pkg_sys|length > 0
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.package:
|
|
name: "{{ pkg_sys | unique }}"
|
|
state: present
|
|
|
|
- name: Install pkg_archive
|
|
when:
|
|
- pkg_archive|length > 0
|
|
loop: "{{ pkg_archive }}"
|
|
loop_control:
|
|
loop_var: archive
|
|
ansible.builtin.include_tasks: helpers/archive.yml
|
|
|
|
- name: Linux specific tasks
|
|
when:
|
|
- system == 'Linux'
|
|
ansible.builtin.include_tasks: linux.yml
|
|
|
|
- name: MacOS specific tasks
|
|
when:
|
|
- distribution == 'MacOSX'
|
|
ansible.builtin.include_tasks: macos.yml
|
|
|
|
- name: Install cargo packages
|
|
when:
|
|
- pkg_cargo|length > 0 or
|
|
pkg_cargo_build|length > 0
|
|
block:
|
|
- name: Install cargo packages
|
|
loop: "{{ pkg_cargo | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/cargo.yml
|
|
|
|
- name: Install cargo_build packages
|
|
loop: "{{ pkg_cargo_build }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/cargo_build.yml
|
|
|
|
- name: Install go packages
|
|
when:
|
|
- pkg_go|length > 0
|
|
block:
|
|
- name: Install go pkgs
|
|
loop: "{{ pkg_go }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/go_install.yml
|
|
|
|
- name: Install local npm packages
|
|
when:
|
|
- pkg_npm|length > 0
|
|
loop: "{{ pkg_npm | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/npm.yml
|
|
|
|
- name: Install python pipx packages for user
|
|
when:
|
|
- pkg_pipx|length > 0
|
|
loop: "{{ pkg_pipx | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/pipx.yml
|
|
|
|
- name: Build and install make packages
|
|
when:
|
|
- pkg_make|length > 0
|
|
loop: "{{ pkg_make | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks: helpers/make.yml
|
|
|
|
- name: Dump __configured
|
|
ansible.builtin.debug:
|
|
var: __configured
|