make paths only when needed

This commit is contained in:
Matthew Stobbs
2025-03-25 04:14:11 -06:00
parent cc29115f16
commit fe7af27e26
2 changed files with 62 additions and 34 deletions

View File

@@ -33,11 +33,20 @@
remote: "{{ flatpak.remote | default('flathub') }}" remote: "{{ flatpak.remote | default('flathub') }}"
state: present state: present
- name: Install pkg_appimage - name: Install appimages
when: when:
- pkg_appimage|length > 0 - pkg_appimage|length > 0
loop: "{{ pkg_appimage }}" block:
loop_control: - name: Ensure appimage path exists
loop_var: pkg become: "{{ ext_become }}"
ansible.builtin.include_tasks: ansible.builtin.file:
file: appimage.yml state: directory
mode: '0755'
path: "{{ path.appimage }}"
- name: Install pkg_appimage
loop: "{{ pkg_appimage }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: appimage.yml

View File

@@ -37,16 +37,6 @@
ansible.builtin.debug: ansible.builtin.debug:
var: packages var: packages
- 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 - name: Read default package configuration
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: pkgs dir: pkgs
@@ -109,39 +99,68 @@
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "archive/{{ pkg }}.yml" file: "archive/{{ pkg }}.yml"
- name: Install cargo packages - name: Cargo Packages installalation
when: when:
- pkg_cargo|length > 0 - pkg_cargo|length > 0
loop: "{{ pkg_cargo | unique }}" block:
loop_control: - name: Ensure cargo path exists
loop_var: pkg become: "{{ ext_become }}"
ansible.builtin.include_tasks: ansible.builtin.file:
file: cargo.yml state: directory
mode: '0755'
path: "{{ path.cargo }}"
- name: Install go packages - name: Install cargo packages
loop: "{{ pkg_cargo | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: cargo.yml
- name: Go Packages installalation
when: when:
- pkg_go|length > 0 - pkg_go|length > 0
loop: "{{ pkg_go | unique }}" block:
loop_control: - name: Ensure go path exists
loop_var: pkg become: "{{ ext_become }}"
ansible.builtin.include_tasks: ansible.builtin.file:
file: go.yml state: directory
mode: '0755'
path: "{{ path.go }}"
- name: Install go packages
loop: "{{ pkg_go | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: go.yml
- name: Install local npm packages - name: Install local npm packages
when:
- pkg_npm|length > 0
loop: "{{ pkg_npm | unique }}" loop: "{{ pkg_npm | unique }}"
loop_control: loop_control:
loop_var: pkg loop_var: pkg
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: npm.yml file: npm.yml
- name: Install python pipx packages for user - name: PipX Packages installalation
when: when:
- pkg_pipx|length > 0 - pkg_pipx|length > 0
loop: "{{ pkg_pipx | unique }}" block:
loop_control: - name: Ensure pipx path exists
loop_var: pkg become: "{{ ext_become }}"
ansible.builtin.include_tasks: ansible.builtin.file:
file: pipx.yml state: directory
mode: '0755'
path: "{{ path.pipx }}"
- name: Install python pipx packages for user
loop: "{{ pkg_pipx | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: pipx.yml
- name: Build and install source packages - name: Build and install source packages
when: when: