Install cargo only if pkg_cargo needs it

This commit is contained in:
Matthew Stobbs
2025-05-10 12:55:10 -06:00
parent 7183372163
commit 454f2fab73
20 changed files with 117 additions and 109 deletions

View File

@@ -19,13 +19,13 @@
- name: Ensure go is present
vars:
pkg: go
listen: "Depend go"
listen: Depend go
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure go path exists
become: "{{ ext_become }}"
listen: "Depend go"
listen: Depend go
ansible.builtin.file:
state: directory
mode: '0755'
@@ -46,47 +46,47 @@
- name: Ensure pipx is installed
vars:
pkg: pipx
listen: "Depend pipx"
listen: Depend pipx
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Ensure pipx path exists
become: "{{ ext_become }}"
listen: "Depend pipx"
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: 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:

View File

@@ -99,11 +99,26 @@
- 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
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:
state: directory
mode: '0755'
path: "{{ path.cargo }}"
- name: Install cargo packages
loop: "{{ pkg_cargo | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: cargo.yml
- name: Install go packages
when:

View File

@@ -11,9 +11,9 @@
- name: Append alacritty to pkg_cargo
when:
- alacritty.method == 'cargo'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + alacritty.build_deps }}"
pkg_cargo: "{{ pkg_cargo + [alacritty.cargo] }}"

View File

@@ -11,9 +11,9 @@
- name: Append broot to pkg_sys and pkg_cargo
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + broot.deps }}"
pkg_cargo: "{{ pkg_cargo + [broot] }}"

View File

@@ -11,9 +11,9 @@
- name: Append choose to pkg_cargo
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [choose] }}"

View File

@@ -5,9 +5,9 @@
- dotenv_linter_configured is undefined
block:
- name: Append dotenv-linter to pkg_cargo
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['dotenv-linter'] }}"

View File

@@ -7,9 +7,9 @@
- name: Append du-dust to pkg_cargo
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['du-dust'] }}"

View File

@@ -5,9 +5,9 @@
- eza_configured is undefined
block:
- name: Append eza to pkg_cargo
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['eza'] }}"

View File

@@ -13,9 +13,9 @@
- name: Append gping to pkg_cargo
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['gping'] }}"

View File

@@ -5,8 +5,8 @@
- htmx_lsp_configured is undefined
block:
- name: Append htmx-lsp to pkg_cargo
notify: Depend cargo
changed_when: true
# notify: Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['htmx-lsp'] }}"

View File

@@ -5,9 +5,9 @@
- jinja_lsp_configured is undefined
block:
- name: Append jinja-lsp to pkg_cargo
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['jinja-lsp'] }}"

View File

@@ -13,8 +13,8 @@
- name: Append mcfly to pkg_cargo
when:
- ansible_system == 'Linux'
notify: Depend cargo
changed_when: true
# notify: Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['mcfly'] }}"

View File

@@ -15,11 +15,11 @@
- name: Append neovide build_deps to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + neovide.deps }}"
- name: Append neovide to pkg_cargo
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [neovide] }}"

View File

@@ -1,17 +1,17 @@
# vim: set filetype=yaml.ansible :
---
- name: Add nodejs
when:
- nodejs_configured is undefined
block:
- name: Load nodejs config
ansible.builtin.include_tasks:
file: config/nodejs.yml
# - name: Add nodejs
# when:
# - nodejs_configured is undefined
# block:
- name: Load nodejs config
ansible.builtin.include_tasks:
file: config/nodejs.yml
- name: Append nodejs to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + nodejs.pkgs }}"
- name: Append nodejs to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + nodejs.pkgs }}"
- name: Set nodejs_configured
ansible.builtin.set_fact:
nodejs_configured: true
- name: Set nodejs_configured
ansible.builtin.set_fact:
nodejs_configured: true

View File

@@ -1,17 +1,10 @@
# vim: set filetype=yaml.ansible :
---
- name: Add rust
when:
- rust_configured is undefined
block:
- name: Load rust config
ansible.builtin.include_tasks:
file: config/rust.yml
- name: Load rust config
ansible.builtin.include_tasks:
file: config/rust.yml
- name: Append rust to pkgs
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + rust.pkgs }}"
- name: Set rust_configured
ansible.builtin.set_fact:
rust_configured: true
- name: Install rust and cargo
become: true
ansible.builtin.package:
name: "{{ rust.pkgs }}"

View File

@@ -13,9 +13,9 @@
- name: Append sd to pkg_cargo
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['sd'] }}"

View File

@@ -5,9 +5,9 @@
- starship_configured is undefined
block:
- name: Append starship to pkg_cargo
notify:
- Depend cargo
changed_when: true
# notify:
# - Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [{'name': 'starship', 'locked': true}] }}"

View File

@@ -13,8 +13,8 @@
- name: Append tldr to pkg_cargo
when:
- ansible_system == 'Linux'
notify: Depend cargo
changed_when: true
# notify: Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['tlrc'] }}"

View File

@@ -17,8 +17,8 @@
- name: Add xh to cargopkgs
when:
- ansible_system == 'Linux'
notify: Depend cargo
changed_when: true
# notify: Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [xh] }}"

View File

@@ -5,8 +5,8 @@
- yazi_fm_configured is undefined
block:
- name: Append yazi-fm to pkg_cargo
notify: Depend cargo
changed_when: true
# notify: Depend cargo
# changed_when: true
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + ['yazi-fm', 'yazi-cli'] }}"