From 7f00bb70dc129f942a3a98895523b8940bea82a0 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Fri, 27 Mar 2026 20:34:40 -0600 Subject: [PATCH] working on more package, almost done --- meta/argument_spec.yml | 2 +- tasks/helpers/zig.yml | 9 ++++ tasks/pkgs/alacritty.yml | 4 +- tasks/pkgs/ansible.yml | 2 +- tasks/pkgs/ansible_ls.yml | 15 ++----- tasks/pkgs/broot.yml | 2 +- tasks/pkgs/cheat.yml | 2 +- tasks/pkgs/choose.yml | 2 +- tasks/pkgs/eza.yml | 1 + tasks/pkgs/ghostty.yml | 12 ++++- tasks/pkgs/git.yml | 14 +++--- tasks/pkgs/go.yml | 12 ++--- tasks/pkgs/neovim.yml | 10 ++--- tasks/pkgs/nodejs.yml | 10 ++--- tasks/pkgs/rust.yml | 10 ++--- tasks/pkgs/starship.yml | 10 ++--- tasks/pkgs/vscode-langservers-extracted.yml | 10 ++--- tasks/pkgs/zig.yml | 10 ++--- tasks/pkgs/zoxide.yml | 14 ++++-- tasks/pkgs/zsh.yml | 49 ++++++++++++++------- vars/main.yml | 2 +- 21 files changed, 122 insertions(+), 80 deletions(-) diff --git a/meta/argument_spec.yml b/meta/argument_spec.yml index b61b080..c49f349 100644 --- a/meta/argument_spec.yml +++ b/meta/argument_spec.yml @@ -26,7 +26,7 @@ argument_specs: default: root description: - User to become when install_become is true. - install_method: + imethod: type: str default: system description: diff --git a/tasks/helpers/zig.yml b/tasks/helpers/zig.yml index 104dd21..4cbbb54 100644 --- a/tasks/helpers/zig.yml +++ b/tasks/helpers/zig.yml @@ -25,3 +25,12 @@ when: - pkg.archive is defined ansible.bulitin.include_tasks: helpers/archive.yml + +- name: Ensure facts are set + ansible.builtin.set_fact: + zbf: "{{ pkg.build_flags | default([]) }}" + +- name: Zig build and install + ansible.builtin.command: + argv: "{{ ['zig', 'build' '-p', install_prefix] + zbf }}" + chdir: "{{ pkg.source_path }}" diff --git a/tasks/pkgs/alacritty.yml b/tasks/pkgs/alacritty.yml index 344d01b..1d61a5d 100644 --- a/tasks/pkgs/alacritty.yml +++ b/tasks/pkgs/alacritty.yml @@ -137,9 +137,9 @@ pkg_sys: "{{ pkg_sys + alacritty_bds }}" pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}" - - name: Finalise alacritty source instal + - name: Finalise alacritty source install ansible.builtin.set_fact: - cargo_install: "{{ alacritty_imethod }}={{ alacritty_src_install }}+{{ alacritty_bds }}" + alacritty_install: "{{ alacritty_imethod }}={{ alacritty_src_install }}+{{ alacritty_bds }}" - name: Configure alacritty system install when: diff --git a/tasks/pkgs/ansible.yml b/tasks/pkgs/ansible.yml index 95f186d..660e25b 100644 --- a/tasks/pkgs/ansible.yml +++ b/tasks/pkgs/ansible.yml @@ -44,7 +44,7 @@ - name: Append ansible to pipx install list when: - ansible_imethod == 'source' - ansible.builtin.set_fact: + block: - name: Configure ansible source install ansible.builtin.set_fact: ansible_src_install: diff --git a/tasks/pkgs/ansible_ls.yml b/tasks/pkgs/ansible_ls.yml index 88fbc80..30e9e43 100644 --- a/tasks/pkgs/ansible_ls.yml +++ b/tasks/pkgs/ansible_ls.yml @@ -15,7 +15,7 @@ npm_pkg: name: '@ansible/ansible-language-server' global: true - version: latest + version: "{{ ansible_ls_version | default('latest') }}" pkg_deps: - nodejs # }}} @@ -39,21 +39,14 @@ loop_var: dep ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml" - - name: Set ansible_ls npm_pkg config - ansible.builtin.set_fact: - ansible_ls_npm_pkg: - name: "{{ ansible_ls.npm_pkg.name }}" - global: "{{ ansible_ls.npm_pkg.global }}" - version: "{{ ansible_ls_version | default(ansible_ls.npm_pkg.version) }}" - - name: Append ansible ls to pkg_npm ansible.builtin.set_fact: - pkg_npm: "{{ pkg_npm + [ansible_ls_npm_pkg] }}" + pkg_npm: "{{ pkg_npm + [ansible_ls.npm_pkg] }}" - name: Finalise ansible_ls source install ansible.builtin.set_fact: - ansible_ls_install: "{{ ansible_ls_imethod }}={{ ansible_ls_npm_pkg }}" + ansible_ls_install: "{{ ansible_ls_imethod }}={{ ansible_ls.npm_pkg }}" - - name: Set ansible_ls_configured + - name: Finalise ansible_ls configuration ansible.builtin.set_fact: __configured: "{{ __configured | combine( { 'ansible_ls': ansible_ls_install } ) }}" diff --git a/tasks/pkgs/broot.yml b/tasks/pkgs/broot.yml index 8d6ac60..6b9f9e1 100644 --- a/tasks/pkgs/broot.yml +++ b/tasks/pkgs/broot.yml @@ -64,7 +64,7 @@ - name: Finalise broot source install ansible.builtin.set_fact: - broot_install: "{{ broot_imethod }}={{ broot_cago_install }}+{{ broot.build_deps[os_family] }}" + broot_install: "{{ broot_imethod }}={{ broot_cargo_install }}+{{ broot.build_deps[os_family] }}" - name: Configure broot system install when: diff --git a/tasks/pkgs/cheat.yml b/tasks/pkgs/cheat.yml index 999878e..feb26c1 100644 --- a/tasks/pkgs/cheat.yml +++ b/tasks/pkgs/cheat.yml @@ -40,7 +40,7 @@ - name: Finalise cheat go install ansible.builtin.set_fact: - cheat_install: "{{ cheat_imethod }}={{ cheat_go_install] }}" + cheat_install: "{{ cheat_imethod }}={{ cheat_go_install }}" - name: Set cheat_configured ansible.builtin.set_fact: diff --git a/tasks/pkgs/choose.yml b/tasks/pkgs/choose.yml index 11b0bd6..24aa8d7 100644 --- a/tasks/pkgs/choose.yml +++ b/tasks/pkgs/choose.yml @@ -39,7 +39,7 @@ - name: Finalise choose cargo install ansible.builtin.set_fact: - choose_install: "{{ choose_imethod }}={{ choose_cargo_install] }}" + choose_install: "{{ choose_imethod }}={{ choose_cargo_install }}" - name: Finalise choose configuration ansible.builtin.set_fact: diff --git a/tasks/pkgs/eza.yml b/tasks/pkgs/eza.yml index 9b37f1e..c47e750 100644 --- a/tasks/pkgs/eza.yml +++ b/tasks/pkgs/eza.yml @@ -10,6 +10,7 @@ ansible.builtin.set_fact: eza: methods: + - source - system # }}} - name: Configure eza diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index 422ebba..d76b29b 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -90,8 +90,10 @@ - name: Set ghostty facts ansible.builtin.set_fact: ghostty: + version: "{{ ghostty_version | default(ghostty.version) }}" methods: "{{ ghostty[distribution].methods | default(_methods['default']) }}" source_url: "{{ ghostty.base_url }}/{{ ghostty.version }}/ghostty-{{ ghostty.version }}.tar.gz" + archive: "ghostty-{{ ghostty.version }}.tar.gz" pkg_deps: "{{ ghostty[distribution].pkg_deps | default(omit) }}" build_deps: "{{ ghostty[distribution].build_deps | default(ghostty.default.build_deps) }}" @@ -122,7 +124,15 @@ - name: Configure ghostty zig install ansible.builtin.set_fact: - + ghostty_source_install: + name: ghostty + source_path: "{{ path_archive }}/ghostty/ghostty-{{ ghostty.version }}" + archive: + extract_to: "{{ path_archive }}/ghostty" + name: "{{ ghostty.archive }}" + url: "{{ ghostty.source_url }}" + build_flags: + - "-Doptimize=ReleaseFast" - name: Configure ghostty appimage install when: diff --git a/tasks/pkgs/git.yml b/tasks/pkgs/git.yml index 7f571ee..28f0662 100644 --- a/tasks/pkgs/git.yml +++ b/tasks/pkgs/git.yml @@ -3,7 +3,7 @@ - name: Set git default facts # {{{ ansible.builtin.set_fact: git: - install_methods: + methods: - system # }}} - name: Configure git @@ -12,18 +12,22 @@ block: - name: Set git install method when: - - git_install_method is undefined + - git_imethod is undefined ansible.builtin.set_fact: - git_install_method: "{{ install_method if install_method in git.install_methods else git.install_methods[0] }}" + git_imethod: "{{ imethod if imethod in git.methods else git.methods[0] }}" - name: Configure git system install when: - - git_install_method == "system" + - git_imethod == "system" block: - name: Append git to pkg_sys ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['git'] }}" + - name: Finalise git system install + ansible.builtin.set_fact: + git_install: "{{ git_imethod }}=git" + - name: Finalize git configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'git': git_install_method } ) }}" + __configured: "{{ __configured | combine( { 'git': git_install } ) }}" diff --git a/tasks/pkgs/go.yml b/tasks/pkgs/go.yml index 6d331a1..e34ea8f 100644 --- a/tasks/pkgs/go.yml +++ b/tasks/pkgs/go.yml @@ -3,7 +3,7 @@ - name: Set go default facts # {{{ ansible.builtin.set_fact: go: - install_methods: + methods: - archive - system pkgname: @@ -51,13 +51,13 @@ block: - name: Configure go install method when: - - go_install_method is undefined + - go_imethod is undefined ansible.builtin.set_fact: - go_install_method: "{{ install_method if install_method in go.install_methods else go.install_methods[0] }}" + go_imethod: "{{ imethod if imethod in go.methods else go.methods[0] }}" - name: Configure go system installation when: - - go_install_method == 'system' + - go_imethod == 'system' block: - name: Set go pkgname ansible.builtin.set_fact: @@ -75,7 +75,7 @@ - name: Configure go archive installation when: - - go_install_method == 'archive' + - go_imethod == 'archive' block: - name: Configure go ansible.builtin.set_fact: @@ -114,4 +114,4 @@ - name: Finalise go configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'go': go_install_method } ) }}" + __configured: "{{ __configured | combine( { 'go': go_imethod } ) }}" diff --git a/tasks/pkgs/neovim.yml b/tasks/pkgs/neovim.yml index c9e7e88..f18d36c 100644 --- a/tasks/pkgs/neovim.yml +++ b/tasks/pkgs/neovim.yml @@ -9,7 +9,7 @@ - name: Set neovim default facts # {{{ ansible.builtin.set_fact: neovim: - install_methods: + methods: - source - system - appimage @@ -65,13 +65,13 @@ block: - name: Set neovim install method when: - - neovim_install_method is undefined + - neovim_imethod is undefined ansible.builtin.set_fact: - neovim_install_method: "{{ install_method if install_method in neovim.install_methods else neovim.install_methods[0] }}" + neovim_imethod: "{{ imethod if imethod in neovim.methods else neovim.methods[0] }}" - name: Configure neovim source install when: - - neovim_install_method == "source" + - neovim_imethod == "source" block: - name: Queue pkg build deps when: @@ -103,4 +103,4 @@ - name: Finalized neovim configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'neovim': neovim_install_method } ) }}" + __configured: "{{ __configured | combine( { 'neovim': neovim_imethod } ) }}" diff --git a/tasks/pkgs/nodejs.yml b/tasks/pkgs/nodejs.yml index dcb97ef..b6ee3b8 100644 --- a/tasks/pkgs/nodejs.yml +++ b/tasks/pkgs/nodejs.yml @@ -9,7 +9,7 @@ - name: Set nodejs default facts ansible.builtin.set_fact: nodejs: - install_methods: + methods: - system pkgname: RedHat: [nodejs] @@ -24,13 +24,13 @@ block: - name: Set nodejs install method when: - - nodejs_install_method is undefined + - nodejs_imethod is undefined ansible.builtin.set_fact: - nodejs_install_method: "{{ install_method if install_method in nodejs.install_methods else nodejs.install_methods[0] }}" + nodejs_imethod: "{{ imethod if imethod in nodejs.methods else nodejs.methods[0] }}" - name: Configure nodejs system install when: - - nodejs_install_method == "system" + - nodejs_imethod == "system" block: - name: Set nodejs package name ansible.builtin.set_fact: @@ -41,4 +41,4 @@ - name: Finalize nodejs configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'nodejs': nodejs_install_method } ) }}" + __configured: "{{ __configured | combine( { 'nodejs': nodejs_imethod } ) }}" diff --git a/tasks/pkgs/rust.yml b/tasks/pkgs/rust.yml index 44de750..1610974 100644 --- a/tasks/pkgs/rust.yml +++ b/tasks/pkgs/rust.yml @@ -9,7 +9,7 @@ - name: Set rust default facts ansible.builtin.set_fact: rust: - install_methods: + methods: - system pkgname: RedHat: rust @@ -23,13 +23,13 @@ block: - name: Set rust install method when: - - rust_install_method is undefined + - rust_imethod is undefined ansible.builtin.set_fact: - rust_install_method: "{{ install_method if install_method in rust.install_methods else rust.install_methods[0] }}" + rust_imethod: "{{ imethod if imethod in rust.methods else rust.methods[0] }}" - name: Append rust to install list when: - - rust_install_method == "system" + - rust_imethod == "system" block: - name: Queue rust install ansible.builtin.set_fact: @@ -37,4 +37,4 @@ - name: Finalize rust configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine ( { 'rust': rust_install_method } ) }}" + __configured: "{{ __configured | combine ( { 'rust': rust_imethod } ) }}" diff --git a/tasks/pkgs/starship.yml b/tasks/pkgs/starship.yml index 2a888d2..d32b012 100644 --- a/tasks/pkgs/starship.yml +++ b/tasks/pkgs/starship.yml @@ -9,7 +9,7 @@ - name: Set starship default config ansible.builtin.set_fact: starship: - install_methods: + methods: - source - name: Configure starship @@ -18,13 +18,13 @@ block: - name: Set starship install method when: - - starship_install_method is undefined + - starship_imethod is undefined ansible.builtin.set_fact: - starship_install_method: "{{ install_method if install_method in starship.install_methods else starship.install_methods[0] }}" + starship_imethod: "{{ imethod if imethod in starship.methods else starship.methods[0] }}" - name: Configure starship source install when: - - starship_install_method == "source" + - starship_imethod == "source" block: - name: Set cargo build options ansible.builtin.set_fact: @@ -38,4 +38,4 @@ - name: Finalize starship configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'starship': starship_install_method } ) }}" + __configured: "{{ __configured | combine( { 'starship': starship_imethod } ) }}" diff --git a/tasks/pkgs/vscode-langservers-extracted.yml b/tasks/pkgs/vscode-langservers-extracted.yml index 4e1c82f..24bae5e 100644 --- a/tasks/pkgs/vscode-langservers-extracted.yml +++ b/tasks/pkgs/vscode-langservers-extracted.yml @@ -9,7 +9,7 @@ - name: Set vscode-langservers-extracted default facts ansible.builtin.set_fact: vscode_langservers_extracted: - install_methods: + methods: - source npm_pkg: '@zed-industries/vscode-langservers-extracted' version: 4.10.7 @@ -19,13 +19,13 @@ block: - name: Set vscode-langservers-extracted install method when: - - vscode_langservers_extracted_install_method is undefined + - vscode_langservers_extracted_imethod is undefined ansible.builtin.set_fact: - vscode_langservers_extracted_install_method: "{{ install_method if install_method in vscode_langservers_extracted.install_methods else vscode_langservers_extracted.install_methods[0] }}" + vscode_langservers_extracted_imethod: "{{ imethod if imethod in vscode_langservers_extracted.methods else vscode_langservers_extracted.methods[0] }}" - name: Configure vscode-langservers-extracted source install when: - - vscode_langservers_extracted_install_method == 'source' + - vscode_langservers_extracted_imethod == 'source' block: - name: Configure vscode-langservers-extracted npm install ansible.builtin.set_fact: @@ -39,4 +39,4 @@ - name: Finalise vscode-langservers-extracted configuration ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'vscode-langservers-extracted': vscode_langservers_extracted_install_method } ) }}" + __configured: "{{ __configured | combine( { 'vscode-langservers-extracted': vscode_langservers_extracted_imethod } ) }}" diff --git a/tasks/pkgs/zig.yml b/tasks/pkgs/zig.yml index 886182b..442bfd4 100644 --- a/tasks/pkgs/zig.yml +++ b/tasks/pkgs/zig.yml @@ -8,7 +8,7 @@ --- - name: Set zig default facts ansible.builtin.set_fact: - install_methods: + methods: - archive - system version: "{{ zig_version | default('0.15.2') }}" @@ -21,19 +21,19 @@ block: - name: Set zig install method when: - - zig_install_method is undefined + - zig_imethod is undefined ansible.builtin.set_fact: - zig_install_method: "{{ install_method if install_method in zig.install_methods else zig.install_methods[0] }}" + zig_imethod: "{{ imethod if imethod in zig.methods else zig.methods[0] }}" - name: Configure zig system install when: - - zig_install_method == 'system' + - zig_imethod == 'system' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + [zig.pkgname[os_family]] }}" - name: Configure zig archive install when: - - zig_install_method == 'archive' + - zig_imethod == 'archive' block: - name: Configure zig archive install ansible.builtin.set_fact: diff --git a/tasks/pkgs/zoxide.yml b/tasks/pkgs/zoxide.yml index 3fd8c27..30fb6d2 100644 --- a/tasks/pkgs/zoxide.yml +++ b/tasks/pkgs/zoxide.yml @@ -1,14 +1,20 @@ # vim: set filetype=yaml.ansible : --- +- name: Set zoxide default facts # {{{ + ansible.builtin.set_fact: + zoxide: + methods: + - system +# }}} - name: Configure zoxide when: - "'zoxide' not in __configured" block: - - name: Set zoxied install method + - name: Set zoxide install method when: - - zoxide_install_method is undefined + - zoxide_imethod is undefined ansible.builtin.set_fact: - zoxide_install_method: "{{ install_method if install_method in zoxide.install_methods else zoxide.install_methods[0] }}" + zoxide_imethod: "{{ imethod if imethod in zoxide.methods else zoxide.methods[0] }}" - name: Append zoxide to pkg_sys ansible.builtin.set_fact: @@ -16,4 +22,4 @@ - name: Set zoxide_configured ansible.builtin.set_fact: - __configured: "{{ __configured | combine( { 'zoxide': zoxide_install_method } ) }}" + __configured: "{{ __configured | combine( { 'zoxide': zoxide_imethod } ) }}" diff --git a/tasks/pkgs/zsh.yml b/tasks/pkgs/zsh.yml index ef34f14..5122294 100644 --- a/tasks/pkgs/zsh.yml +++ b/tasks/pkgs/zsh.yml @@ -1,33 +1,52 @@ # vim: set filetype=yaml.ansible : --- +- name: Set zsh default facts # {{{ + ansible.builtin.set_fact: + zsh: + methods: + - system + pkgname: + RedHat: zsh + Debian: zsh + Alpine: zsh + Archlinux: zsh +# }}} - name: Add zsh when: - "'zsh' not in __configured" block: - name: Set zsh install method when: - - zsh_install_method is undefined + - zsh_imethod is undefined ansible.builtin.set_fact: - zsh_install_method: "{{ install_method if install_method in zsh.install_methods else zsh.install_methods[0] }}" + zsh_imethod: "{{ imethod if imethod in zsh.methods else zsh.methods[0] }}" - name: Append zsh to pkg_sys when: - - zsh_install_method == 'system' - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['zsh'] }}" + - zsh_imethod == 'system' + block: + - name: Queue zsh system install + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + [zsh.pkgname[os_family]] }}" + + - name: Finalise zsh system install + ansible.builtin.set_fact: + zsh_install: "{{ zsh_imethod }}={{ zsh.pkgname[os_family] }}" - name: Configure zsh source install when: - - zsh_install_method == 'source' - ansible.builtin.set_fact: - zsh_source_install: - build_deps: - build_flags: - source_dir: - repo: "{{ zsh_base_url }}" - version: "{{ zsh_version }}" - files: + - zsh_imethod == 'source' + block: + - name: Set zsh source install facts + ansible.builtin.set_fact: + zsh_source_install: + build_deps: + build_flags: + source_dir: + repo: "{{ zsh_base_url }}" + version: "{{ zsh_version }}" + files: - name: Set zsh_configured ansible.builtin.set_fact: - zsh_configured: true + __configured: "{{ __configured | combine( { 'zsh': zsh_install } ) }}" diff --git a/vars/main.yml b/vars/main.yml index 481956f..d31902e 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -7,7 +7,7 @@ clean_cache: false build_jobs: "{{ ansible_processor_nproc | int }}" install_become: true install_become_user: root -install_method: system +imethod: system install_prefix: /usr/local install_prefix_mode: '0755' install_prefix_owner: root