126 lines
2.8 KiB
YAML
126 lines
2.8 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
# create all the facts used throughout the role, but shouldn't be touched
|
|
# by the user
|
|
- name: Create temporary directory for downloads
|
|
ansible.builtin.tempfile:
|
|
state: directory
|
|
prefix: ansible_role_package.
|
|
register: d_tempdir
|
|
|
|
- name: Set installation facts
|
|
ansible.builtin.include_tasks:
|
|
file: facts.yml
|
|
|
|
- name: Ensure required path exist
|
|
become: "{{ ext_become }}"
|
|
loop: "{{ path | dict2items }}"
|
|
loop_control:
|
|
loop_var: p
|
|
ansible.builtin.file:
|
|
state: directory
|
|
mode: '0755'
|
|
path: "{{ p.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: Flush handlers to ensure dependencies are installed
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Add needed MacOS packages
|
|
when:
|
|
- ansible_distribution == 'MacOSX'
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ pkg_sys + ['gnu-tar', 'virtualenv'] }}"
|
|
|
|
- name: Install sys_pkgs list using system package manager
|
|
become: "{{ sys_pkg_become }}"
|
|
ansible.builtin.package:
|
|
name: "{{ pkg_sys | unique }}"
|
|
state: present
|
|
|
|
- name: Linux specific tasks
|
|
when:
|
|
- ansible_system == 'Linux'
|
|
ansible.builtin.include_tasks:
|
|
file: linux.yml
|
|
|
|
- name: MacOS specific tasks
|
|
when:
|
|
- ansible_distribution == 'MacOSX'
|
|
ansible.builtin.include_tasks:
|
|
file: macos.yml
|
|
|
|
- name: Install pkg_archive
|
|
when:
|
|
- pkg_archive|length > 0
|
|
loop: "{{ pkg_archive }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: "archive/{{ pkg }}.yml"
|
|
|
|
- name: Install pkg_appimage
|
|
when:
|
|
- pkg_appimage|length > 0
|
|
loop: "{{ pkg_appimage }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: appimage.yml
|
|
|
|
- name: Build and install source packages
|
|
when:
|
|
- pkg_src|length > 0
|
|
loop: "{{ pkg_src | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: "src/{{ pkg }}.yml"
|
|
|
|
- name: Install cargo packages
|
|
when:
|
|
- pkg_cargo|length > 0
|
|
loop: "{{ pkg_cargo | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: cargo.yml
|
|
|
|
- name: Install go packages
|
|
when:
|
|
- pkg_go|length > 0
|
|
loop: "{{ pkg_go | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: go.yml
|
|
|
|
- name: Install local npm packages
|
|
loop: "{{ pkg_npm | unique }}"
|
|
loop_control:
|
|
loop_var: pkg
|
|
ansible.builtin.include_tasks:
|
|
file: 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:
|
|
file: pipx.yml
|