From 2d825d855dc1bfdb6cf5c8a07c02a767b481539d Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Sat, 22 Feb 2025 10:51:53 -0700 Subject: [PATCH] fix remaining packages to new format - still needs testing --- tasks/{src => archive}/zig.yml | 34 ++++++-------- tasks/{src => archive}/zls.yml | 36 +++++++-------- tasks/config/rust.yml | 5 +- tasks/pkgs/pandoc.yml | 4 +- tasks/pkgs/pgadmin.yml | 25 +++++----- tasks/pkgs/podman.yml | 4 +- tasks/pkgs/pyright.yml | 10 ++-- tasks/pkgs/{python3-pip.yml => python3.yml} | 0 tasks/pkgs/quobix-vacuum.yml | 10 ++-- tasks/pkgs/revive.yml | 10 ++-- tasks/pkgs/ripgrep.yml | 4 +- tasks/pkgs/rust.yml | 2 +- tasks/pkgs/sd.yml | 24 ++++------ tasks/pkgs/sqlfluff.yml | 10 ++-- tasks/pkgs/sqlls.yml | 11 ++--- tasks/pkgs/starship.yml | 11 ++--- tasks/pkgs/stow.yml | 4 +- tasks/pkgs/tailscale.yml | 51 ++++++++++++--------- tasks/pkgs/tailwindcss-languageserver.yml | 10 ++-- tasks/pkgs/templ.yml | 2 +- tasks/pkgs/terraform.yml | 11 ++--- tasks/pkgs/terraformls.yml | 21 ++++++--- tasks/pkgs/thunderbird.yml | 18 ++++---- tasks/pkgs/tidy.yml | 7 +-- tasks/pkgs/tldr.yml | 20 +++----- tasks/pkgs/vault.yml | 21 ++++++--- tasks/pkgs/xh.yml | 2 +- tasks/pkgs/yamlls.yml | 10 ++-- tasks/pkgs/zfs.yml | 14 +++--- tasks/pkgs/zig.yml | 10 +--- tasks/pkgs/zls.yml | 12 ++--- tasks/pkgs/zoxide.yml | 4 +- vars/pkgs/pgadmin.yml | 4 ++ 33 files changed, 200 insertions(+), 221 deletions(-) rename tasks/{src => archive}/zig.yml (59%) rename tasks/{src => archive}/zls.yml (54%) rename tasks/pkgs/{python3-pip.yml => python3.yml} (100%) create mode 100644 vars/pkgs/pgadmin.yml diff --git a/tasks/src/zig.yml b/tasks/archive/zig.yml similarity index 59% rename from tasks/src/zig.yml rename to tasks/archive/zig.yml index 662574e..a15bcc0 100644 --- a/tasks/src/zig.yml +++ b/tasks/archive/zig.yml @@ -1,46 +1,42 @@ # vim: set filetype=yaml.ansible : --- -- name: download zig archive +- name: Download zig archive ansible.builtin.set_fact: zig_path: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}" zig_pkg: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}.tar.xz" -- name: check if zig {{ pkgconfig_zig.version }} exists +- name: Check if zig exists ansible.builtin.stat: path: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig" register: r_zig_stat -- name: update/install zig +- name: Update/install zig + when: + - not r_zig_stat.stat.exists block: - - name: create temp path + - name: Create temp path ansible.builtin.tempfile: state: directory prefix: zig_dl. register: d_zig_dl_tmp - - name: download zig archive + - name: Download zig archive ansible.builtin.get_url: dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}" url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}" decompress: false + mode: '0644' - - name: create install_path - ansible.builtin.file: - state: directory - path: "{{ pkgconfig_zig.install_path }}" - become: true - - - name: extract zig package + - name: Extract zig package + become: "{{ ext_become }}" ansible.builtin.unarchive: - dest: "{{ pkgconfig_zig.install_path }}" + dest: "{{ path.archive }}/zig" src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}" remote_src: true - become: true - - name: link zig binary + - name: Link zig binary + become: "{{ ext_become }}" ansible.builtin.file: state: link - src: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig" - path: "{{ pkgconfig_zig.install_prefix }}/bin/zig" - become: true - when: not r_zig_stat.stat.exists + src: "{{ path.archive }}/{{ zig_path }}/zig" + path: "{{ path.bin }}/zig" diff --git a/tasks/src/zls.yml b/tasks/archive/zls.yml similarity index 54% rename from tasks/src/zls.yml rename to tasks/archive/zls.yml index 300975f..9f2d619 100644 --- a/tasks/src/zls.yml +++ b/tasks/archive/zls.yml @@ -1,46 +1,42 @@ # vim: set filetype=yaml.ansible : --- -- name: download zls archive +- name: Download zls archive ansible.builtin.set_fact: zls_path: "zls-{{ pkgconfig_zls.sysmap[ansible_system] }}-{{ pkgconfig_zls.archmap[ansible_architecture] }}-{{ pkgconfig_zls.version }}" zls_pkg: "zls-{{ pkgconfig_zls.sysmap[ansible_system] }}-{{ pkgconfig_zls.archmap[ansible_architecture] }}-{{ pkgconfig_zls.version }}.tar.xz" -- name: check if zls {{ pkgconfig_zls.version }} exists +- name: Check if zls exists ansible.builtin.stat: path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls" register: r_zls_stat -- name: update/install zls +- name: Update/install zls + when: + - not r_zls_stat.stat.exists block: - - name: create temp path + - name: Create temp path ansible.builtin.tempfile: state: directory prefix: zls_dl. register: d_zls_dl_tmp - - name: download zls archive + - name: Download zls archive ansible.builtin.get_url: dest: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}" - url: "{{ pkgconfig_zls.base_url }}/{{ zls_pkg }}" + url: "{{ pkgconfig.zls.base_url }}/{{ zls_pkg }}" decompress: false + mode: '0644' - - name: create install_path - ansible.builtin.file: - state: directory - path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}" - become: true - - - name: extract zls package + - name: Extract zls package + become: "{{ ext_become }}" ansible.builtin.unarchive: - dest: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}" + dest: "{{ path.ardhive }}/{{ zls_path }}" src: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}" remote_src: true - become: true - - name: link zls binary + - name: Link zls binary + become: "{{ ext_become }}" ansible.builtin.file: state: link - src: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls" - path: "{{ pkgconfig_zls.install_prefix }}/bin/zls" - become: true - when: not r_zls_stat.stat.exists + src: "{{ path.ardhive }}/{{ zls_path }}/zls" + path: "{{ path.bin }}/zls" diff --git a/tasks/config/rust.yml b/tasks/config/rust.yml index 1f1ac2d..56fdcc6 100644 --- a/tasks/config/rust.yml +++ b/tasks/config/rust.yml @@ -1,3 +1,6 @@ # vim: set filetype=yaml.ansible : --- -rustup_managed: false +- name: Set rust config + ansible.builtin.set_fact: + rust: + pkgs: "{{ pkgconfig.rust.pkgs[ansible_system] }}" diff --git a/tasks/pkgs/pandoc.yml b/tasks/pkgs/pandoc.yml index e148a03..8da3c55 100644 --- a/tasks/pkgs/pandoc.yml +++ b/tasks/pkgs/pandoc.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'pandoc' ] }}" + pkg_sys: "{{ pkg_sys + ['pandoc'] }}" diff --git a/tasks/pkgs/pgadmin.yml b/tasks/pkgs/pgadmin.yml index b74f8f8..0981b16 100644 --- a/tasks/pkgs/pgadmin.yml +++ b/tasks/pkgs/pgadmin.yml @@ -1,16 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- block: - - ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpak is undefined +- name: Append to pkg_flatpak + when: + - ansible_system == 'Linux' + notify: + - Depend flatpak + ansible.builtin.set_fact: + pkg_flatpak: "{{ pkg_flatpak + [pkgconfig.pgadmin.flatpak] }}" - - name: append to syspkgs - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'org.pgadmin.pgadmin4'] }}" - when: ansible_os_family != 'Darwin' - -- name: append to caskpkgs - set_fact: - caskpkgs: "{{ caskpkgs + [ 'pgadmin4' ] }}" - when: ansible_os_family == 'Darwin' +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['pgadmin4'] }}" diff --git a/tasks/pkgs/podman.yml b/tasks/pkgs/podman.yml index dab91e8..7183e96 100644 --- a/tasks/pkgs/podman.yml +++ b/tasks/pkgs/podman.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkg_sys ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'podman' ] }}" + pkg_sys: "{{ pkg_sys + ['podman'] }}" diff --git a/tasks/pkgs/pyright.yml b/tasks/pkgs/pyright.yml index 45ff31e..591e5f9 100644 --- a/tasks/pkgs/pyright.yml +++ b/tasks/pkgs/pyright.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/pipx.yml - when: pipx is undefined - -- name: add to pipxpkgs +- name: Add to pkg_pipx + notify: + - Depend pipx ansible.builtin.set_fact: - pipxpkgs: "{{ pipxpkgs + ['pyright'] }}" + pkg_pipx: "{{ pkg_pipx + ['pyright'] }}" diff --git a/tasks/pkgs/python3-pip.yml b/tasks/pkgs/python3.yml similarity index 100% rename from tasks/pkgs/python3-pip.yml rename to tasks/pkgs/python3.yml diff --git a/tasks/pkgs/quobix-vacuum.yml b/tasks/pkgs/quobix-vacuum.yml index 2e9ba17..922898a 100644 --- a/tasks/pkgs/quobix-vacuum.yml +++ b/tasks/pkgs/quobix-vacuum.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['@quobix/vacuum'] }}" + pkg_npm: "{{ pkg_npm + ['@quobix/vacuum'] }}" diff --git a/tasks/pkgs/revive.yml b/tasks/pkgs/revive.yml index 468bf30..3a497cd 100644 --- a/tasks/pkgs/revive.yml +++ b/tasks/pkgs/revive.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/mgechev/revive@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/mgechev/revive@latest'] }}" diff --git a/tasks/pkgs/ripgrep.yml b/tasks/pkgs/ripgrep.yml index 06f6d60..8edeef5 100644 --- a/tasks/pkgs/ripgrep.yml +++ b/tasks/pkgs/ripgrep.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkg_sys ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'ripgrep' ] }}" + pkg_sys: "{{ pkg_sys + ['ripgrep'] }}" diff --git a/tasks/pkgs/rust.yml b/tasks/pkgs/rust.yml index f7710c3..a1b9592 100644 --- a/tasks/pkgs/rust.yml +++ b/tasks/pkgs/rust.yml @@ -2,4 +2,4 @@ --- - name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + pkgconfig.rust.pkgs }}" + pkg_sys: "{{ pkg_sys + pkgconfig.rust.pkgs }}" diff --git a/tasks/pkgs/sd.yml b/tasks/pkgs/sd.yml index 3260e36..159c154 100644 --- a/tasks/pkgs/sd.yml +++ b/tasks/pkgs/sd.yml @@ -1,19 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs +- name: Append to pkg_sys + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'sd' ] }}" - when: - - ansible_os_family == 'Darwin' + pkg_sys: "{{ pkg_sys + ['sd'] }}" -- name: linux specific install - block: - - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - - - name: add to cargopkgs - ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'sd' ] }}" +- name: Add to pkg_cargo when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' + notify: + - Depend cargo + ansible.builtin.set_fact: + pkg_cargo: "{{ pkg_cargo + ['sd'] }}" diff --git a/tasks/pkgs/sqlfluff.yml b/tasks/pkgs/sqlfluff.yml index 3d406a2..27bfcca 100644 --- a/tasks/pkgs/sqlfluff.yml +++ b/tasks/pkgs/sqlfluff.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/pipx.yml - when: pipx is undefined - -- name: add to pipxpkgs +- name: Add to pkg_pipx + notify: + - Depend pipx ansible.builtin.set_fact: - pipxpkgs: "{{ pipxpkgs + ['sqlfluff'] }}" + pkg_pipx: "{{ pkg_pipx + ['sqlfluff'] }}" diff --git a/tasks/pkgs/sqlls.yml b/tasks/pkgs/sqlls.yml index f2e738d..205bab9 100644 --- a/tasks/pkgs/sqlls.yml +++ b/tasks/pkgs/sqlls.yml @@ -1,10 +1,7 @@ # vim: filetype=yaml.ansible : --- -- name: Use nodejs - ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: Add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['sql-language-server'] }}" + pkg_npm: "{{ pkg_npm + ['sql-language-server'] }}" diff --git a/tasks/pkgs/starship.yml b/tasks/pkgs/starship.yml index 1998605..24afd5d 100644 --- a/tasks/pkgs/starship.yml +++ b/tasks/pkgs/starship.yml @@ -1,10 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: install rust and cargo - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - -- name: add to cargopkgs +- name: Add to pkg_cargo + notify: + - Depend cargo ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'starship' ] }}" + pkg_cargo: "{{ pkg_cargo + ['starship'] }}" diff --git a/tasks/pkgs/stow.yml b/tasks/pkgs/stow.yml index 7792eca..52257a3 100644 --- a/tasks/pkgs/stow.yml +++ b/tasks/pkgs/stow.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: Append to pkgs +- name: Append to pkg_sys ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + [ 'stow' ] }}" + pkg_sys: "{{ pkg_sys + ['stow'] }}" diff --git a/tasks/pkgs/tailscale.yml b/tasks/pkgs/tailscale.yml index 3149f0e..1d44134 100644 --- a/tasks/pkgs/tailscale.yml +++ b/tasks/pkgs/tailscale.yml @@ -1,12 +1,14 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.set_fact: - tailscale: true -- name: enable for linux +- name: Enable for linux + when: + - ansible_system == 'Linux' block: - - name: enable for RedHat distros + - name: Enable for RedHat distros + when: + - ansible_os_family == 'RedHat' block: - - name: fedora >=41 + - name: Fedora >=41 ansible.builtin.command: creates: /etc/yum.repos.d/tailscale.repo cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.tailscale.url_base }}/fedora/tailscale.repo" @@ -15,7 +17,7 @@ - ansible_distribution == 'Fedora' - ansible_distribution_major_version|int >= 41 - - name: fedora <41 + - name: Fedora <41 ansible.builtin.command: creates: /etc/yum.repos.d/tailscale.repo cmd: "dnf config-manager --add-repo {{ pkgconfig.tailscale.url_base }}/fedora/tailscale.repo" @@ -24,35 +26,40 @@ - ansible_distribution == 'Fedora' - ansible_distribution_major_version|int < 41 - - name: rhel based distros + - name: Rhel based distros ansible.builtin.command: creates: /etc/yum.repos.d/tailscale.repo cmd: "dnf config-manager --add-repo {{ pkgconfig.tailscale.url_base }}/rhel/{{ ansible_os_major_version }}/tailscale.repo" become: true when: - ansible_distribution != 'Fedora' - when: ansible_os_family == 'RedHat' - - name: enable for Debian distros + - name: Enable for Debian distros + when: + - ansible_os_family == 'Debian' block: - - name: install tailscale keyring + - name: Install tailscale keyring block: - - ansible.builtin.get_url: + - name: Get tailscal keyring + become: "{{ sys_pkg_become }}" + ansible.builtin.get_url: url: "{{ pkgconfig.tailscale.url_base }}/debian/{{ pkgconfig.tailscale.release[ansible_os_release].gpg }}" dest: /usr/share/keyrings/tailscale-archive-keyring.gpg - become: true - - ansible.builtin.get_url: + mode: '0644' + + - name: Get tailscale repo list + become: "{{ sys_pkg_become }}" + ansible.builtin.get_url: url: "{{ pkgconfig.tailscale.url_base }}/debian/{{ pkgconfig.tailscale.release[ansible_os_release].list }}" dest: /etc/apt/sources.list.d/tailscale.list - become: true - when: ansible_os_family == 'Debian' + mode: '0644' - - name: append to syspkgs + - name: Append to pkg_sys ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'tailscale' ] }}" - when: ansible_os_family != 'Darwin' + pkg_sys: "{{ pkg_sys + ['tailscale'] }}" -- name: append to caskpkgs - set_fact: - caskpkgs: "{{ caskpkgs + [ 'tailscale' ] }}" - when: ansible_os_family == 'Darwin' +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['tailscale'] }}" diff --git a/tasks/pkgs/tailwindcss-languageserver.yml b/tasks/pkgs/tailwindcss-languageserver.yml index f04ec3b..4d78fff 100644 --- a/tasks/pkgs/tailwindcss-languageserver.yml +++ b/tasks/pkgs/tailwindcss-languageserver.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['@tailwindcss/language-server'] }}" + pkg_npm: "{{ pkg_npm + ['@tailwindcss/language-server'] }}" diff --git a/tasks/pkgs/templ.yml b/tasks/pkgs/templ.yml index ca9028b..ef5f66d 100644 --- a/tasks/pkgs/templ.yml +++ b/tasks/pkgs/templ.yml @@ -2,6 +2,6 @@ --- - name: Add to pkg_go notify: - - Depends go + - Depend go ansible.builtin.set_fact: pkg_go: "{{ pkg_go + ['github.com/a-h/templ/cmd/templ@latest'] }}" diff --git a/tasks/pkgs/terraform.yml b/tasks/pkgs/terraform.yml index 6880561..25bf5bc 100644 --- a/tasks/pkgs/terraform.yml +++ b/tasks/pkgs/terraform.yml @@ -1,10 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: ensure hashicorp repo is active - ansible.builtin.include_tasks: - file: "pkgs/hashicorp_repo.yml" - when: hashicorp is undefined - -- name: append to pkgs +- name: Append to pkgs + notify: + - Depend hashicorp repo ansible.builtin.set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.terraform[ansible_system] ] }}" + pkg_taps: "{{ pkg_taps + [pkgconfig.terraform[ansible_system]] }}" diff --git a/tasks/pkgs/terraformls.yml b/tasks/pkgs/terraformls.yml index e3477c3..6db41a0 100644 --- a/tasks/pkgs/terraformls.yml +++ b/tasks/pkgs/terraformls.yml @@ -1,10 +1,17 @@ # vim: set filetype=yaml.ansible : --- -- name: ensure hashicorp repo is active - ansible.builtin.include_tasks: - file: "pkgs/hashicorp_repo.yml" - when: hashicorp is undefined +- name: Append to pkgs + notify: + - Depend hashicorp repo + block: + - name: MacOS specific + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_taps: "{{ pkg_taps + [pkgconfig.terraformls[ansible_system]] }}" -- name: append to pkgs - ansible.builtin.set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.terraformls[ansible_system] ] }}" + - name: Linux specific + when: + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['terraformls'] }}" diff --git a/tasks/pkgs/thunderbird.yml b/tasks/pkgs/thunderbird.yml index 71ef48b..9fa2bdb 100644 --- a/tasks/pkgs/thunderbird.yml +++ b/tasks/pkgs/thunderbird.yml @@ -1,11 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs - set_fact: - syspkgs: "{{ syspkgs + [ 'thunderbird' ] }}" - when: ansible_os_family != 'Darwin' +- name: Append to pkg_sys + when: + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['thunderbird'] }}" -- name: append to caskpkgs - set_fact: - caskpkgs: "{{ caskpkgs + [ 'thunderbird' ] }}" - when: ansible_os_family == 'Darwin' +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['thunderbird'] }}" diff --git a/tasks/pkgs/tidy.yml b/tasks/pkgs/tidy.yml index dd0e7b4..50d5672 100644 --- a/tasks/pkgs/tidy.yml +++ b/tasks/pkgs/tidy.yml @@ -1,8 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.set_fact: - tidy: true - -- name: append to pkgs +- name: Append to pkg_sys ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + pkgconfig.tidy.pkgs[ansible_system] }}" + pkg_sys: "{{ pkg_sys + pkgconfig.tidy.pkgs[ansible_system] }}" diff --git a/tasks/pkgs/tldr.yml b/tasks/pkgs/tldr.yml index 8fbaeb9..9eafc22 100644 --- a/tasks/pkgs/tldr.yml +++ b/tasks/pkgs/tldr.yml @@ -1,19 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs - ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'tlrc' ] }}" +- name: Append to pkg_sys when: - ansible_os_family == 'Darwin' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['tlrc'] }}" -- name: linux specific install - block: - - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - - - name: add to cargopkgs - ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'tlrc' ] }}" +- name: Add to pkg_cargo when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_cargo: "{{ pkg_cargo + ['tlrc'] }}" diff --git a/tasks/pkgs/vault.yml b/tasks/pkgs/vault.yml index 9c139bf..70337c5 100644 --- a/tasks/pkgs/vault.yml +++ b/tasks/pkgs/vault.yml @@ -1,10 +1,17 @@ # vim: set filetype=yaml.ansible : --- -- name: ensure hashicorp repo is active - ansible.builtin.include_tasks: - file: "pkgs/hashicorp_repo.yml" - when: hashicorp is undefined +- name: Append to pkgs + notify: + - Depend hashicorp repo + block: + - name: MacOS specific + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_taps: "{{ pkg_taps + [pkgconfig.vault[ansible_system]] }}" -- name: append to pkgs - ansible.builtin.set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.vault[ansible_system] ] }}" + - name: Linux specific + when: + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['vault'] }}" diff --git a/tasks/pkgs/xh.yml b/tasks/pkgs/xh.yml index 2162acf..8a51d68 100644 --- a/tasks/pkgs/xh.yml +++ b/tasks/pkgs/xh.yml @@ -8,6 +8,6 @@ - name: Add to cargopkgs when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' ansible.builtin.set_fact: pkg_cargo: "{{ pkg_cargo + [xh] }}" diff --git a/tasks/pkgs/yamlls.yml b/tasks/pkgs/yamlls.yml index f23448d..e3d9210 100644 --- a/tasks/pkgs/yamlls.yml +++ b/tasks/pkgs/yamlls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['yaml-language-server'] }}" + pkg_npm: "{{ pkg_npm + ['yaml-language-server'] }}" diff --git a/tasks/pkgs/zfs.yml b/tasks/pkgs/zfs.yml index cae72cd..6d367e2 100644 --- a/tasks/pkgs/zfs.yml +++ b/tasks/pkgs/zfs.yml @@ -2,7 +2,7 @@ --- - name: Linux based installation when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' block: - name: RedHat based configuration when: @@ -22,7 +22,8 @@ state: present - name: Debian configuration - when: ansible_os_family == 'Debian' + when: + - ansible_os_family == 'Debian' block: - name: Enable openzfs repository become: "{{ sys_pkg_become }}" @@ -37,19 +38,20 @@ - name: Pin zfs package to backports become: "{{ sys_pkg_become }}" ansible.builtin.file: + dest: /etc/apt/preferences.d/90_zfs + state: file + mode: '0644' content: | Package: src:zfs-linux Pin: release n={{ zfs.release }}-backports Pin-Priority: 990 - dest: /etc/apt/preferences.d/90_zfs - state: present - mode: '0644' - name: Append to pkgs ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + zfs.deps + zfs.pkgs }}" - name: Append to caskpkgs - when: ansible_os_family == 'Darwin' + when: + - ansible_os_family == 'Darwin' ansible.builtin.set_fact: pkg_cask: "{{ pkg_cask + ['openzfs'] }}" diff --git a/tasks/pkgs/zig.yml b/tasks/pkgs/zig.yml index a36c852..dfdd026 100644 --- a/tasks/pkgs/zig.yml +++ b/tasks/pkgs/zig.yml @@ -1,11 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_vars: - file: zig.yml - name: _zig -- ansible.builtin.set_fact: - pkgconfig_zig: "{{ _zig | ansible.builtin.combine(pkgconfig.zig) }}" - -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - srcpkgs: "{{ srcpkgs + [ 'zig' ] }}" + pkg_src: "{{ pkg_src + ['zig'] }}" diff --git a/tasks/pkgs/zls.yml b/tasks/pkgs/zls.yml index d61d26f..daae7c2 100644 --- a/tasks/pkgs/zls.yml +++ b/tasks/pkgs/zls.yml @@ -1,11 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_vars: - file: zls.yml - name: _zls -- ansible.builtin.set_fact: - pkgconfig_zls: "{{ _zls | ansible.builtin.combine(pkgconfig.zls) }}" - -- name: append to pkgs +- name: Append to pkgs + notify: + - Depend zig ansible.builtin.set_fact: - srcpkgs: "{{ srcpkgs + [ 'zls' ] }}" + pkg_src: "{{ pkg_src + ['zls'] }}" diff --git a/tasks/pkgs/zoxide.yml b/tasks/pkgs/zoxide.yml index 5e9f779..abfa6fc 100644 --- a/tasks/pkgs/zoxide.yml +++ b/tasks/pkgs/zoxide.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'zoxide' ] }}" + pkg_sys: "{{ pkg_sys + ['zoxide'] }}" diff --git a/vars/pkgs/pgadmin.yml b/vars/pkgs/pgadmin.yml new file mode 100644 index 0000000..959f4a4 --- /dev/null +++ b/vars/pkgs/pgadmin.yml @@ -0,0 +1,4 @@ +pgadmin: + flatpak: + name: org.pgadmin.pgadmin4 + remote: flathub