diff --git a/tasks/pkgs/alacritty.yml b/tasks/pkgs/alacritty.yml index 9dcef01..da0aaf3 100644 --- a/tasks/pkgs/alacritty.yml +++ b/tasks/pkgs/alacritty.yml @@ -101,7 +101,7 @@ - name: Set alacritty install extra build deps when: - ansible_os_family == "RedHat" - - ansible_os_major_version < 9 + - ansible_distribution_major_version|int <= 8 block: - name: Add extra dependencies for EL7 when: diff --git a/tasks/pkgs/ansible.yml b/tasks/pkgs/ansible.yml index eeaa37d..8319ae7 100644 --- a/tasks/pkgs/ansible.yml +++ b/tasks/pkgs/ansible.yml @@ -33,13 +33,13 @@ when: - ansible_install_method == "system" ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + [ ansible_pkgname[os_family] ] }}" + pkg_sys: "{{ pkg_sys + [ ansible.pkgname[os_family] ] }}" - name: Append ansible to pipx install list when: - ansible_install_method == 'source' ansible.builtin.set_fact: - pkg_pipx: "{{ pkg_pipx + [ { 'name': ansible_pkgname['pip'] } ] }}" + pkg_pipx: "{{ pkg_pipx + [ { 'name': ansible.pkgname['pip'] } ] }}" - name: Complete ansible configuration ansible.builtin.set_fact: diff --git a/tasks/pkgs/ansible_lint.yml b/tasks/pkgs/ansible_lint.yml index 8a73ab2..aa634fa 100644 --- a/tasks/pkgs/ansible_lint.yml +++ b/tasks/pkgs/ansible_lint.yml @@ -30,7 +30,7 @@ when: - ansible_lint_install_method is undefined ansible.builtin.set_fact: - ansible_lint_install_method: "{{ install_method if install_method in ansible_lint_install_methods else ansible_lint_methods[0] }}" + ansible_lint_install_method: "{{ install_method if install_method in ansible_lint.install_methods else ansible_lint.install_methods[0] }}" - name: Configure pipx source install when: diff --git a/tasks/pkgs/bitwarden.yml b/tasks/pkgs/bitwarden.yml index 93ff94f..a0a508d 100644 --- a/tasks/pkgs/bitwarden.yml +++ b/tasks/pkgs/bitwarden.yml @@ -45,3 +45,9 @@ name: "{{ bitwarden.flatpak.name }}" remote: "{{ bitwarden.flatpak.remote }}" method: "{{ bitwarden_flatpak_method | default(flatpak_method) }}" + + - name: Finalize bitwarden configuration + when: + - "'bitwarden' not in __configured" + ansible.builtin.set_fact: + __configured: "{{ __configured | combine( { 'bitwarden': bitwarden_install_method } ) }}" diff --git a/tasks/pkgs/broot.yml b/tasks/pkgs/broot.yml index 2b10567..83a51b8 100644 --- a/tasks/pkgs/broot.yml +++ b/tasks/pkgs/broot.yml @@ -1,24 +1,58 @@ # vim: set filetype=yaml.ansible : --- +- name: Set default broot values + ansible.builtin.set_fact: + broot: + install_methods: + - system + - source + version: 1.55.0 + build_deps: + Debian: + - build-essential + - libxcb1-dev + - libxcb-render0-dev + - libxcb-shape0-dev + - libxcb-xfixes0-dev + RedHat: + - libxcb-devel + Alpine: + - libxcb-dev + Darwin: [] - name: Add broot + when: + - "'broot' not in __configured" block: - - name: Load broot config - ansible.builtin.include_tasks: - file: config/broot.yml - - - name: Append broot to pkg_sys and pkg_cargo + - name: Set broot install method when: - - ansible_system == 'Linux' + - broot_install_method is undefined ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + broot.deps }}" - pkg_cargo: "{{ pkg_cargo + [broot] }}" + broot_install_method: "{{ install_method if install_method in broot.install_methods else broot.install_methods[0] }}" - - name: Append broot to pkg_sys + - name: Configure broot source install when: - - ansible_system == 'Darwin' - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['broot'] }}" + - broot_install_method == 'source' + block: + - name: Set cargo build options + ansible.builtin.set_fact: + broot_cargo_install: + name: broot + version: "{{ broot.version }}" + - name: Append broot to install list + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + broot.build_deps[os_family] }}" + pkg_cargo: "{{ pkg_cargo + [broot_cargo_install] }}" + + - name: Configure broot system install + when: + - broot_install_method == 'system' + block: + - name: Append broot to pkg_sys + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['broot'] }}" - name: Set broot_configured ansible.builtin.set_fact: - broot_configured: true + __configured: "{{ __configured | combine( { 'broot': broot_install_method } ) }}" diff --git a/tasks/pkgs/btop.yml b/tasks/pkgs/btop.yml index 56c6cf7..0c65712 100644 --- a/tasks/pkgs/btop.yml +++ b/tasks/pkgs/btop.yml @@ -1,5 +1,26 @@ # vim: set filetype=yaml.ansible : --- -- name: Append btop to pkg_ssys +- name: Set default btop options ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['btop'] }}" + btop: + install_methods: + - system + pkgname: btop +- name: Configure btop install + when: + - "'btop' not in __configured" + block: + - name: Set btop install method + ansible.builtin.set_fact: + btop_install_method: "{{ install_method if install_method in btop.install_methods else btop.install_methods[0] }}" + + - name: Configure btop system install + when: + - btop_install_method == 'system' + block: + - name: Append btop to pkg_sys + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + [btop.pkgname] }}" + - name: Finalise btop configuration + ansible.builtin.set_fact: + __configured: "{{ __configured | combine( { 'btop': btop_install_method } ) }}" diff --git a/tasks/pkgs/buf.yml b/tasks/pkgs/buf.yml index 6b90811..dfbdc9a 100644 --- a/tasks/pkgs/buf.yml +++ b/tasks/pkgs/buf.yml @@ -1,13 +1,34 @@ # vim: set filetype=yaml.ansible : --- -- name: Add buf +- name: Set default buf values + ansible.builtin.set_fact: + buf: + install_methods: + - source + build_deps: + - go + version: latest + go_pkg: github.com/bufbuild/buf/cmd/buf +- name: Configure bug install when: - - buf_configured is undefined + - "'buf' not in __configured" block: - - name: Append buf to pkg_go + - name: Set buf install method + when: + - buf_install_method is undefined ansible.builtin.set_fact: - pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf/cmd/buf@latest'] }}" + buf_install_method: "{{ install_method if install_method in buf.install_methods else buf.install_methods[0] }}" - - name: Set buf_configured + - name: Configure buf source install + when: + - buf_install_method == 'source' + block: + - name: Append buf to pkg_go + ansible.builtin.set_fact: + buf_go_install: + bin: buf + url: "{{ buf.go_pkg }}@{{ buf.version }}" + + - name: Finalise buf configuration ansible.builtin.set_fact: - buf_configured: true + __configured: "{{ __configured | combine( { 'buf': buf_install_method } ) }}" diff --git a/tasks/pkgs/bufls.yml b/tasks/pkgs/bufls.yml index 0b6506a..b008b48 100644 --- a/tasks/pkgs/bufls.yml +++ b/tasks/pkgs/bufls.yml @@ -1,13 +1,31 @@ # vim: set filetype=yaml.ansible : --- -- name: Add bufls - when: - - bufls_configured is undefined - block: - - name: Append bufls to pkg_go - ansible.builtin.set_fact: - pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf-language-server/cmd/bufls@latest'] }}" +- name: Set default bufls options + ansible.builtin.set_fact: + bufls: + install_methods: + - source + version: latest + go_pkg: github.com/bufbuild/buf-language-server/cmd/bufls - - name: Set bufls_configured +- name: Configure bufls install + when: + - "'bufls' not in __configured" + block: + - name: Set bufls install method ansible.builtin.set_fact: - bufls_configured: true + bufls_install_method: "{{ install_method if install_method in bufls.install_methods else bufls.install_methods[0] }}" + + - name: Configure bufls source install + when: + - bufls_install_method == 'source' + block: + - name: Configure bufls go install + ansible.builtin.set_fact: + bufls_go_install: + url: "{{ bufls.go_pkg }}@{{ bufls.version }}" + bin: "{{ path_bin }}/bufls" + + - name: Finalise bufls configuration + ansible.builtin.set_fact: + __configured: "{{ __configured | combine( { 'bufls': bufls_install_method } ) }}" diff --git a/tasks/pkgs/cargo.yml b/tasks/pkgs/cargo.yml index 448c58d..28f0de5 100644 --- a/tasks/pkgs/cargo.yml +++ b/tasks/pkgs/cargo.yml @@ -1,5 +1,10 @@ # vim: set filetype=yaml.ansible : --- +- name: Set default cargo values + ansible.builtin.set_fact: + cargo: + install_methods: + - system - name: Configure cargo when: - "'cargo' not in __configured" @@ -8,12 +13,12 @@ when: - cargo_install_method is undefined ansible.builtin.set_fact: - cargo_install_method: "{{ install_method if install_method in cargo_install_methods else cargo_install_methods[0] }}" + cargo_install_method: "{{ install_method if install_method in cargo.install_methods else cargo.install_methods[0] }}" - name: Add dependencies when: - cargo_pkgdeps is defined - loop: cargo_pkgdeps + loop: "{{ cargo_pkgdeps }}" loop_control: loop_var: dep ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml" diff --git a/tasks/pkgs/cbfmt.yml b/tasks/pkgs/cbfmt.yml index b9e8c2d..b921d71 100644 --- a/tasks/pkgs/cbfmt.yml +++ b/tasks/pkgs/cbfmt.yml @@ -1,6 +1,29 @@ # vim: set filetype=yaml.ansible : --- -- name: Set cbfmt config +- name: Set default cbfmt values ansible.builtin.set_fact: cbfmt: - pkgs: "{{ pkgconfig.cbfmt.pkgs }}" + install_methods: + - system + pkgname: cbfmt +- name: Configure cbfmt install + when: + - "'cbfmt' not in __configured" + block: + - name: Set cbfmt install method + when: + - cbfmt_install_method is undefined + ansible.builtin.set_fact: + cbfmt_install_method: "{{ install_method if install_method in cbfmt.install_methods else cbfmt.install_methods[0] }}" + + - name: Configure cbfmt system install + when: + - cbfmt_install_method == 'system' + block: + - name: Append cbfmt to system install list + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + [cbfmt.pkgname] }}" + + - name: Finalise cbfmt configuration + ansible.builtin.set_fact: + __configured: "{{ __configured | combine( { 'cbfmt': cbfmt_install_method } ) }}"