Update handlers, move deps to pkg_lengths

Signed-off-by: Matthew Stobbs <matthew.stobbs@ucalgary.ca>
This commit is contained in:
Matthew Stobbs
2025-05-12 12:12:40 -06:00
parent 88e104f77c
commit 0eb7361c65
3 changed files with 89 additions and 108 deletions

View File

@@ -1,99 +1,5 @@
# vim: set filetype=yaml.ansible :
---
- name: Ensure appimage path exists
become: "{{ ext_become }}"
listen: "Depend appimage"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.appimage }}"
- name: Ensure archive path exists
become: "{{ ext_become }}"
listen: "Depend archive"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}"
- name: Ensure go is present
vars:
pkg: go
listen: Depend go
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure go path exists
become: "{{ ext_become }}"
listen: Depend go
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.go }}"
- name: Depend flatpak
vars:
pkg: flatpak
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend node
vars:
pkg: nodejs
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure pipx is installed
vars:
pkg: pipx
listen: Depend pipx
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure pipx path exists
become: "{{ ext_become }}"
listen: Depend pip"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.pipx }}"
# - name: Ensure rust and cargo are installed
# vars:
# pkg: rust
# listen: Depend cargo
# ansible.builtin.include_tasks:
# file: addpkg.yml
#
# - name: Ensure cargo path exists
# become: "{{ ext_become }}"
# listen: Depend cargo
# ansible.builtin.file:
# state: directory
# mode: '0755'
# path: "{{ path.cargo }}"
#
# - name: Depend rust
# vars:
# pkg: rust
# listen: "Depend rust"
# ansible.builtin.include_tasks:
# file: addpkg.yml
#
# - name: Ensure cargo path exists
# become: "{{ ext_become }}"
# listen: "Depend rust"
# ansible.builtin.file:
# state: directory
# mode: '0755'
# path: "{{ path.cargo }}"
- name: Depend zig
vars:
pkg: zig
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend terra repo
ansible.builtin.include_tasks:
file: repos/terra.yml

View File

@@ -69,6 +69,86 @@
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['tar', 'unzip'] }}"
- name: Ensure extra dependencies are installed
block:
- name: Ensure go binary is installed
when: pkg_go|length > 0
vars:
pkg: go
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure go path exists
become: "{{ ext_become }}"
when: pkg_go|length > 0
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.go }}"
- name: Ensure rust and cargo are installed
when: pkg_cargo|length > 0
vars:
pkg: rust
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure pipx is installed
when: pkg_pipx|length > 0
vars:
pkg: pipx
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure pipx path exists
when: pkg_pipx|length > 0
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.pipx }}"
- name: Ensure nodejs and npm are installed
when: pkg_node|length > 0
vars:
pkg: nodejs
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure flatpak is installed
when:
- pkg_flatpak is defined
- pkg_flatpak|length > 0
vars:
pkg: flatpak
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure appimage path exists
when:
- pkg_appimage is defined
- pkg_appimage|length > 0
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.appimage }}"
- name: Ensure archive path exists
when: pkg_archive|length > 0
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}"
- name: Depend zig
when: pkg_zig|length > 0
vars:
pkg: zig
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Install sys_pkgs list using system package manager
become: "{{ sys_pkg_become }}"
ansible.builtin.package:
@@ -100,12 +180,6 @@
when:
- pkg_cargo|length > 0
block:
- name: Ensure rust and cargo are installed
vars:
pkg: rust
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure cargo path exists
become: "{{ ext_become }}"
ansible.builtin.file:
@@ -123,6 +197,8 @@
- name: Install go packages
when:
- pkg_go|length > 0
block:
- name: Install go pkgs
loop: "{{ pkg_go | unique }}"
loop_control:
loop_var: pkg

View File

@@ -5,6 +5,5 @@
file: config/rust.yml
- name: Install rust and cargo
become: true
ansible.builtin.package:
name: "{{ rust.pkgs }}"
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + rust.pkgs }}"