make directories only when needed

This commit is contained in:
Matthew Stobbs
2025-03-25 04:28:10 -06:00
parent fe7af27e26
commit 6d124fa626
3 changed files with 95 additions and 65 deletions

View File

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

View File

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