104 lines
2.4 KiB
YAML
104 lines
2.4 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
# create all the facts used throughout the role, but shouldn't be touched
|
|
# by the user
|
|
- name: Set installation facts
|
|
ansible.builtin.include_tasks:
|
|
file: facts.yml
|
|
|
|
- name: Ensure required paths exist
|
|
become: "{{ ext_become }}"
|
|
loop: "{{ paths | dict2items }}"
|
|
loop_control:
|
|
loop_var: path
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
path: "{{ path.value }}"
|
|
|
|
- name: Read default package configuration
|
|
ansible.builtin.include_vars:
|
|
dir: pkgs
|
|
extensions:
|
|
- yml
|
|
name: pkgconfig
|
|
|
|
- name: Generate package installation lists
|
|
loop: "{{ packages | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: addpkg.yml
|
|
|
|
- name: Install sys_pkgs list using system package manager
|
|
become: "{{ sys_pkg_become }}"
|
|
ansible.builtin.package:
|
|
name: "{{ sys_pkgs | unique }}"
|
|
state: present
|
|
|
|
- name: Linux based OS
|
|
when: ansible_system == 'Linux'
|
|
ansible.builtin.include_tasks:
|
|
file: linux.yml
|
|
|
|
- name: Darwin/macOS based OS
|
|
when: ansible_distribution == 'MacOSX'
|
|
ansible.builtin.include_tasks:
|
|
file: macos.yml
|
|
|
|
- name: Install archive_pkgs
|
|
when:
|
|
- archive_pkgs|length > 0
|
|
loop: "{{ archive_pkgs }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: "archive/{{ pkg }}.yml"
|
|
|
|
- name: Build and install source packages
|
|
when:
|
|
- src_pkgs|length > 0
|
|
loop: "{{ src_pkgs | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: "src/{{ pkg }}.yml"
|
|
|
|
- name: Install cargo packages
|
|
when:
|
|
- cargo_pkgs|length > 0
|
|
loop: "{{ cargo_pkgs | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: cargo.yml
|
|
|
|
- name: Install go packages
|
|
when:
|
|
- go_pkgs|length > 0
|
|
loop: "{{ go_pkgs | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: go.yml
|
|
|
|
- name: Install local npm packages
|
|
become: "{% if ansible_system == 'Linux' %}true{% else %}false{% endif %}"
|
|
community.general.npm:
|
|
global: true
|
|
name: "{{ npmpkg }}"
|
|
state: latest
|
|
loop: "{{ npmpkgs | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: npm.yml
|
|
|
|
- name: Install python pipx packages for user
|
|
loop: "{{ pipx_pkgs | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
when: pipx_pkgs|length > 0
|
|
ansible.builtin.include_tasks:
|
|
file: pipx.yml
|