diff --git a/tasks/appimage.yml b/tasks/appimage.yml index df1a6b0..57965bf 100644 --- a/tasks/appimage.yml +++ b/tasks/appimage.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible : --- - name: Install appimage - become: "{{ archive_become }}" + become: "{{ ext_become }}" block: - name: Ensure appimage path exists ansible.builtin.file: @@ -10,7 +10,7 @@ state: directory - name: Fetch appimage - become: "{{ archive_become }}" + become: "{{ ext_become }}" ansible.builtin.get_url: mode: '0755' decompress: false @@ -19,7 +19,7 @@ dest: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}" - name: Link appimage to bin - become: "{{ archive_become }}" + become: "{{ ext_become }}" ansible.builtin.file: state: link src: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}" diff --git a/tasks/archive/go.yml b/tasks/archive/go.yml index 2b5a37d..94a1fbd 100644 --- a/tasks/archive/go.yml +++ b/tasks/archive/go.yml @@ -20,8 +20,8 @@ become: "{{ sys_pkg_become }}" register: get_url_go ansible.builtin.get_url: - dest: "{{ path.cache }}/{{ go.archive }}" - url: "{{ go.url }}" + dest: "{{ d_tempdir.path }}/{{ go.archive }}" + url: "{{ go.base_url }}/{{ go.archive }}" checksum: "{{ go.sum }}" decompress: false mode: '0644' @@ -32,7 +32,7 @@ - ansible_system == 'Linux' ansible.builtin.unarchive: dest: "{{ path.prefix }}" - src: "{{ d_go_dl_tmp.path }}/{{ go.archive }}" + src: "{{ d_tempdir.path }}/{{ go.archive }}" remote_src: true - name: Install go macOS using pkg file @@ -40,5 +40,4 @@ when: - ansible_distribution == 'MacOSX' ansible.builtin.command: - creates: "{{ path.go }}" - cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go.archive }} -target /" + cmd: "installer -pkg {{ d_tempdir.path }}/{{ go.archive }} -target /" diff --git a/tasks/archive/zls.yml b/tasks/archive/zls.yml index 9f2d619..355d5f7 100644 --- a/tasks/archive/zls.yml +++ b/tasks/archive/zls.yml @@ -2,41 +2,31 @@ --- - 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 exists ansible.builtin.stat: - path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls" + path: "{{ path.archive }}/{{ zls_path }}/zls" register: r_zls_stat - name: Update/install zls - when: - - not r_zls_stat.stat.exists block: - - name: Create temp path - ansible.builtin.tempfile: - state: directory - prefix: zls_dl. - register: d_zls_dl_tmp - - name: Download zls archive ansible.builtin.get_url: - dest: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}" - url: "{{ pkgconfig.zls.base_url }}/{{ zls_pkg }}" + dest: "{{ d_tempfile.path }}/{{ zls_pkg }}" + url: "{{ zls.base_url }}/{{ zls_pkg }}" decompress: false mode: '0644' - name: Extract zls package become: "{{ ext_become }}" ansible.builtin.unarchive: - dest: "{{ path.ardhive }}/{{ zls_path }}" - src: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}" + dest: "{{ path.archive }}" + src: "{{ d_tempfile.path }}/{{ zls_pkg }}" remote_src: true - name: Link zls binary become: "{{ ext_become }}" ansible.builtin.file: state: link - src: "{{ path.ardhive }}/{{ zls_path }}/zls" + src: "{{ path.archive }}/{{ zls_path }}/zls" path: "{{ path.bin }}/zls" diff --git a/tasks/cargo.yml b/tasks/cargo.yml index d163ac7..7eb3a5c 100644 --- a/tasks/cargo.yml +++ b/tasks/cargo.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible --- - name: Install cargo pkg - become: "{{ archive_become }}" + become: "{{ ext_become }}" community.general.cargo: name: "{{ pkg.name }}" version: "{{ pkg.vers }}" diff --git a/tasks/config/clangd.yml b/tasks/config/clangd.yml index 6777ccb..eacd9b9 100644 --- a/tasks/config/clangd.yml +++ b/tasks/config/clangd.yml @@ -1,4 +1,4 @@ - name: Set clangd config ansible.builtin.set_fact: clangd: - pkgs: "{{ pkgconfig.clangd.pkg[ansible_os_family] }}" + pkgs: "{{ pkgconfig.clangd.pkgs[ansible_os_family] }}" diff --git a/tasks/config/fd.yml b/tasks/config/fd.yml index 861fdbc..dca7e72 100644 --- a/tasks/config/fd.yml +++ b/tasks/config/fd.yml @@ -1,4 +1,4 @@ - name: Set fd config ansible.builtin.set_fact: fd: - pkgs: "{{ pkgconfig.fd.pkgs[ansible_os_famly] }}" + pkgs: "{{ pkgconfig.fd.pkgs[ansible_system] }}" diff --git a/tasks/config/go.yml b/tasks/config/go.yml index b47c418..cce458e 100644 --- a/tasks/config/go.yml +++ b/tasks/config/go.yml @@ -3,7 +3,8 @@ - name: Set go configuration ansible.builtin.set_fact: go: - arch: "{{ pkgconfig_go.archmap[ansible_architecture] }}" + method: archive + arch: "{{ pkgconfig.go.archmap[ansible_architecture] }}" ext: "{{ pkgconfig.go.extmap[ansible_system] }}" sys: "{{ ansible_system | lower }}" vers: "{{ pkgconfig.go.version }}" @@ -11,11 +12,12 @@ - name: Set go composite facts ansible.builtin.set_fact: go: + method: archive arch: "{{ go.arch }}" - archive: "go{{ go.ver }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig_go.extmap[ansible_system] }}" + archive: "go{{ go.vers }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig.go.extmap[ansible_system] }}" ext: "{{ go.ext }}" - inst_path: "{{ path.install }}/go" + inst_path: "{{ path.prefix }}" sum: "{{ pkgconfig.go.sums[go.vers][ansible_system][go.arch] }}" sys: "{{ go.sys }}" - url: "{{ pkgconfig.go.base_url }}/{{ go.archive }}" + base_url: "{{ pkgconfig.go.base_url }}" vers: "{{ go.vers }}" diff --git a/tasks/config/libreoffice.yml b/tasks/config/libreoffice.yml index 33b99ce..6dbd69a 100644 --- a/tasks/config/libreoffice.yml +++ b/tasks/config/libreoffice.yml @@ -3,6 +3,6 @@ - name: Set libreoffice config ansible.builtin.set_fact: libreoffice: - method: "{{ pkgconfig.libreoffice.method }}" + method: "{{ pkgconfig.libreoffice.methods[ansible_distribution] | default(pkgconfig.libreoffice.methods.default) }}" flatpak: "{{ pkgconfig.libreoffice.flatpak }}" - pkgs: "{{ pkgconfig.libreoffice[ansible_os_family] }}" + pkgs: "{{ pkgconfig.libreoffice.pkgs[ansible_os_family] }}" diff --git a/tasks/config/neovim.yml b/tasks/config/neovim.yml index d4c6ace..eba49a8 100644 --- a/tasks/config/neovim.yml +++ b/tasks/config/neovim.yml @@ -3,7 +3,7 @@ - name: Set neovim install method ansible.builtin.set_fact: neovim: - method: "{{ pkgconfig.neovim.method[ansible_distribution] | default(pkgconfig.neovim.method.default) }}" + method: "{{ pkgconfig.neovim.methods[ansible_distribution] | default(pkgconfig.neovim.methods.default) }}" - name: Set neovim config ansible.builtin.set_fact: diff --git a/tasks/config/nodejs.yml b/tasks/config/nodejs.yml new file mode 100644 index 0000000..1ee3330 --- /dev/null +++ b/tasks/config/nodejs.yml @@ -0,0 +1,4 @@ +- name: Set nodejs config + ansible.builtin.set_fact: + nodejs: + pkgs: "{{ pkgconfig.nodejs.pkgs[ansible_system] }}" diff --git a/tasks/config/pgadmin.yml b/tasks/config/pgadmin.yml new file mode 100644 index 0000000..b458e7d --- /dev/null +++ b/tasks/config/pgadmin.yml @@ -0,0 +1,6 @@ +- name: Set pgadmin config + ansible.builtin.set_fact: + pgadmin: + method: "{{ pkgconfig.pgadmin.methods[ansible_distribution] | default(pkgconfig.pgadmin.methods.default) }}" + pkgs: "{{ pkgconfig.pgadmin.pkgs[ansible_system] }}" + flatpak: "{{ pkgconfig.pgadmin.flatpak }}" diff --git a/tasks/config/terraform.yml b/tasks/config/terraform.yml new file mode 100644 index 0000000..a9081ba --- /dev/null +++ b/tasks/config/terraform.yml @@ -0,0 +1,4 @@ +- name: Set terraform config + ansible.builtin.set_fact: + terraform: + pkgs: "{{ pkgconfig.terraform.pkgs[ansible_system] }}" diff --git a/tasks/config/terraformls.yml b/tasks/config/terraformls.yml new file mode 100644 index 0000000..4389106 --- /dev/null +++ b/tasks/config/terraformls.yml @@ -0,0 +1,4 @@ +- name: Set terraformls config + ansible.builtin.set_fact: + terraformls: + pkgs: "{{ pkgconfig.terraformls.pkgs[ansible_system] }}" diff --git a/tasks/config/tidy.yml b/tasks/config/tidy.yml new file mode 100644 index 0000000..8ea18c2 --- /dev/null +++ b/tasks/config/tidy.yml @@ -0,0 +1,4 @@ +- name: Set tidy config + ansible.builtin.set_fact: + tidy: + pkgs: "{{ pkgconfig.tidy.pkgs[ansible_system] }}" diff --git a/tasks/config/zls.yml b/tasks/config/zls.yml index e58bb40..b53b8e6 100644 --- a/tasks/config/zls.yml +++ b/tasks/config/zls.yml @@ -1,5 +1,9 @@ # vim: set filetype=yaml.ansible : --- -version: 0.13.0 -install_prefix: "{{ default_install_prefix }}" -install_path: /opt/zls +- name: Set zls config + ansible.builtin.set_fact: + zls: + path: "zls-{{ pkgconfig.zls.sysmap[ansible_system] }}-{{ pkgconfig.zls.archmap[ansible_architecture] }}-{{ pkgconfig.zls.version }}" + pkg: "zls-{{ pkgconfig.zls.sysmap[ansible_system] }}-{{ pkgconfig.zls.archmap[ansible_architecture] }}-{{ pkgconfig.zls.version }}.tar.xz" + vers: "{{ pkgconfig.zls.version }}" + base_url: "{{ pkgconfig.zls.base_url }}" diff --git a/tasks/go.yml b/tasks/go.yml index 333e55f..85cea83 100644 --- a/tasks/go.yml +++ b/tasks/go.yml @@ -1,6 +1,6 @@ --- - name: Install go packages - become: "{{ archive_become }}" + become: "{{ ext_become }}" environment: GOBIN: "{{ path.bin }}" PATH: "{{ path.go }}/bin:$PATH" diff --git a/tasks/linux.yml b/tasks/linux.yml index 121cd37..fd6d5c6 100644 --- a/tasks/linux.yml +++ b/tasks/linux.yml @@ -3,13 +3,13 @@ - name: Install flatpaks on Linux Systems when: - - flatpaks|length > 0 + - pkg_flatpak|length > 0 block: - name: Add flatpak remotes when: - - flatpak_remotes|length > 0 + - flatpak_remote|length > 0 become: "{{ ext_become }}" - loop: "{{ flatpak_remotes | unique }}" + loop: "{{ flatpak_remote | unique }}" loop_control: loop_var: remote community.general.flatpak_remote: @@ -20,8 +20,10 @@ state: present - name: Install flatpaks + when: + - pkg_flatpak|length > 0 become: "{{ ext_become }}" - loop: "{{ flatpaks | unique }}" + loop: "{{ pkg_flatpak | unique }}" loop_control: loop_var: flatpak community.general.flatpak: diff --git a/tasks/macos.yml b/tasks/macos.yml index c5836ab..8cc98ac 100644 --- a/tasks/macos.yml +++ b/tasks/macos.yml @@ -1,19 +1,22 @@ # vim: set filetype=yaml.ansible : --- - name: Tap homebrew taps + when: + - brewtap|length > 0 community.general.homebrew_tap: - name: "{{ brew_taps | unique }}" + name: "{{ brewtap | unique }}" state: present - when: brew_taps|length > 0 - name: Install homebrew casks + when: pkg_cask|length > 0 community.general.homebrew_cask: - name: "{{ cask_pkgs | unique }}" + name: "{{ pkg_cask | unique }}" state: present - when: cask_pkgs|length > 0 # TODO: fix the need to have this workaround - name: Workaround to install homebrew taps - ansible.builtin.command: - cmd: "brew install {{ (tap_pkgs | unique) | join(' ') }}" + when: + - pkg_tap|length > 0 changed_when: true + ansible.builtin.command: + cmd: "brew install {{ (pkg_tap | unique) | join(' ') }}" diff --git a/tasks/main.yml b/tasks/main.yml index af0b02d..b6e2809 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,6 +2,12 @@ --- # create all the facts used throughout the role, but shouldn't be touched # by the user +- name: Create temporary directory for downloads + ansible.builtin.tempfile: + state: directory + prefix: ansible_role_package. + register: d_tempdir + - name: Set installation facts ansible.builtin.include_tasks: file: facts.yml diff --git a/tasks/npm.yml b/tasks/npm.yml index 1b6e8ad..f07d1ab 100644 --- a/tasks/npm.yml +++ b/tasks/npm.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible : --- - name: Install npm pkg - become: "{{ archive_become }}" + become: "{{ ext_become }}" community.general.npm: global: true name: "{{ pkg }}" diff --git a/tasks/pipx.yml b/tasks/pipx.yml index 29ef20e..8e67a18 100644 --- a/tasks/pipx.yml +++ b/tasks/pipx.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible : --- - name: Install pipx pkg - become: "{{ archive_become }}" + become: "{{ ext_become }}" community.general.pipx: executable: "{{ pipx_exec }}" name: "{{ pipx_pkg }}" diff --git a/tasks/pkgs/broot.yml b/tasks/pkgs/broot.yml index 77d5652..5bb1666 100644 --- a/tasks/pkgs/broot.yml +++ b/tasks/pkgs/broot.yml @@ -3,6 +3,8 @@ - name: Append to pkg_sys and pkg_cargo when: - ansible_system == 'Linux' + notify: + - Depend cargo ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + broot.deps }}" pkg_cargo: "{{ pkg_cargo + [broot] }}" diff --git a/tasks/pkgs/direnv.yml b/tasks/pkgs/direnv.yml new file mode 100644 index 0000000..67accf7 --- /dev/null +++ b/tasks/pkgs/direnv.yml @@ -0,0 +1,3 @@ +- name: Append to pkg_sys + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['direnv'] }}" diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index 3701146..dc15649 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -3,6 +3,7 @@ - name: Source pkg installation when: - ghostty.method == 'src' + - ansible_distribution != 'MacOSX' notify: - Depend zig block: diff --git a/tasks/pkgs/go.yml b/tasks/pkgs/go.yml index c92d2bd..7431f03 100644 --- a/tasks/pkgs/go.yml +++ b/tasks/pkgs/go.yml @@ -2,12 +2,11 @@ --- - name: Install from archive when: - - go.use_archive + - go.method == 'archive' ansible.builtin.set_fact: pkg_archive: "{{ pkg_archive + ['go'] }}" - name: Append to pkgs - when: - - not go.use_archive + - go.method != 'archive' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['go'] }}" diff --git a/tasks/pkgs/libreoffice.yml b/tasks/pkgs/libreoffice.yml index ecd7405..754c7e6 100644 --- a/tasks/pkgs/libreoffice.yml +++ b/tasks/pkgs/libreoffice.yml @@ -1,20 +1,19 @@ # vim: set filetype=yaml.ansible : --- -- name: Append to flatpkgs +- name: Append to pkg_flatpak when: - libreoffice.method == 'flatpak' ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + libreoffice.flatpak }}" + pkg_flatpak: "{{ pkg_flatpak + libreoffice.flatpak }}" - name: Append to pkg_sys when: - libreoffice.method == 'sys' - - ansible_system == 'Linux' ansible.builtin.set_fact: sys_pkg: "{{ sys_pkg + libreoffice.pkgs }}" - name: Append to caskpkgs when: - - ansible_system == 'Darwin' + - libreoffice.method == 'cask' ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['libreoffice'] }}" + pkg_cask: "{{ pkg_cask + libreoffice.pkgs }}" diff --git a/tasks/pkgs/neovim.yml b/tasks/pkgs/neovim.yml index 0033bfc..77191b7 100644 --- a/tasks/pkgs/neovim.yml +++ b/tasks/pkgs/neovim.yml @@ -2,12 +2,12 @@ --- - name: Append to appimages when: - - nvim.method == 'appimage' + - neovim.method == 'appimage' ansible.builtin.set_fact: pkg_appimage: "{{ pkg_appimage + ['neovim'] }}" - name: Append neovim to pkg_sys when: - - nvim.method == 'sys' + - neovim.method == 'sys' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['neovim'] }}" diff --git a/tasks/pkgs/nodejs.yml b/tasks/pkgs/nodejs.yml index c06d282..4ee1ac1 100644 --- a/tasks/pkgs/nodejs.yml +++ b/tasks/pkgs/nodejs.yml @@ -2,4 +2,4 @@ --- - name: Append to pkgs ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + pkgconfig.nodejs.pkgs[ansible_system] }}" + pkg_sys: "{{ pkg_sys + nodejs.pkgs }}" diff --git a/tasks/pkgs/pgadmin.yml b/tasks/pkgs/pgadmin.yml index 0981b16..6d219df 100644 --- a/tasks/pkgs/pgadmin.yml +++ b/tasks/pkgs/pgadmin.yml @@ -2,14 +2,14 @@ --- - name: Append to pkg_flatpak when: - - ansible_system == 'Linux' + - pgadmin.method == 'flatpak' notify: - Depend flatpak ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_flatpak + [pkgconfig.pgadmin.flatpak] }}" + pkg_flatpak: "{{ pkg_flatpak + [pgadmin.flatpak] }}" - name: Append to pkg_cask when: - - ansible_system == 'Darwin' + - pgadmin.method == 'cask' ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['pgadmin4'] }}" + pkg_cask: "{{ pkg_cask + pgadmin.pkgs }}" diff --git a/tasks/pkgs/rust.yml b/tasks/pkgs/rust.yml index a1b9592..6ee7716 100644 --- a/tasks/pkgs/rust.yml +++ b/tasks/pkgs/rust.yml @@ -2,4 +2,4 @@ --- - name: Append to pkgs ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + pkgconfig.rust.pkgs }}" + pkg_sys: "{{ pkg_sys + rust.pkgs }}" diff --git a/tasks/pkgs/terraform.yml b/tasks/pkgs/terraform.yml index 25bf5bc..3c3e297 100644 --- a/tasks/pkgs/terraform.yml +++ b/tasks/pkgs/terraform.yml @@ -3,5 +3,15 @@ - name: Append to pkgs notify: - Depend hashicorp repo - ansible.builtin.set_fact: - pkg_taps: "{{ pkg_taps + [pkgconfig.terraform[ansible_system]] }}" + block: + - name: MacOSX specific + when: + - ansible_distribution == 'MacOSX' + ansible.builtin.set_fact: + pkg_tap: "{{ pkg_tap + terraform.pkgs }}" + + - name: Linux specific + when: + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + terraform.pkgs }}" diff --git a/tasks/pkgs/terraformls.yml b/tasks/pkgs/terraformls.yml index 6db41a0..b5e3532 100644 --- a/tasks/pkgs/terraformls.yml +++ b/tasks/pkgs/terraformls.yml @@ -8,10 +8,10 @@ when: - ansible_system == 'Darwin' ansible.builtin.set_fact: - pkg_taps: "{{ pkg_taps + [pkgconfig.terraformls[ansible_system]] }}" + pkg_tap: "{{ pkg_tap + terraformls.pkgs }}" - name: Linux specific when: - ansible_system == 'Linux' ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['terraformls'] }}" + pkg_sys: "{{ pkg_sys + terraformls.pkgs }}" diff --git a/tasks/pkgs/tidy.yml b/tasks/pkgs/tidy.yml index 50d5672..4404779 100644 --- a/tasks/pkgs/tidy.yml +++ b/tasks/pkgs/tidy.yml @@ -2,4 +2,4 @@ --- - name: Append to pkg_sys ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + pkgconfig.tidy.pkgs[ansible_system] }}" + pkg_sys: "{{ pkg_sys + tidy.pkgs }}" diff --git a/tasks/pkgs/vault.yml b/tasks/pkgs/vault.yml index 70337c5..a42c509 100644 --- a/tasks/pkgs/vault.yml +++ b/tasks/pkgs/vault.yml @@ -8,7 +8,7 @@ when: - ansible_system == 'Darwin' ansible.builtin.set_fact: - pkg_taps: "{{ pkg_taps + [pkgconfig.vault[ansible_system]] }}" + pkg_tap: "{{ pkg_tap + [pkgconfig.vault[ansible_system]] }}" - name: Linux specific when: diff --git a/tasks/pkgs/zls.yml b/tasks/pkgs/zls.yml index daae7c2..74d0e21 100644 --- a/tasks/pkgs/zls.yml +++ b/tasks/pkgs/zls.yml @@ -4,4 +4,4 @@ notify: - Depend zig ansible.builtin.set_fact: - pkg_src: "{{ pkg_src + ['zls'] }}" + pkg_archive: "{{ pkg_archive + ['zls'] }}" diff --git a/tasks/repos/hashicorp.yml b/tasks/repos/hashicorp.yml index a1af55c..e2e0167 100644 --- a/tasks/repos/hashicorp.yml +++ b/tasks/repos/hashicorp.yml @@ -34,15 +34,9 @@ when: - ansible_os_family == 'Debian' block: - - name: Create temporary directory - ansible.builtin.tempfile: - state: directory - prefix: hashicorp. - register: d_hashicorp_tmp - - name: Get hashicorp archive gpg key ansible.builtin.get_url: - dest: "{{ d_hashicorp_tmp.path }}/gpg" + dest: "{{ d_tempdir.path }}/hashicorp_gpg" url: https://apt.releases.hashicorp.com/gpg mode: '0644' @@ -55,7 +49,7 @@ - --dearmor - -o - /usr/share/keyrings/hashicorp-archive-keyring.gpg - - "{{ d_hashicorp_tmp.path }}/gpg" + - "{{ d_tempdir.path }}/hashicorp_gpg" - name: Enable hasicorp repo for debian ansible.builtin.apt_repository: @@ -66,8 +60,5 @@ - name: MacOS specific configuration when: - ansible_distribution == 'MacOSX' - block: - - name: Enable hashicorp homebrew tap - when: ansible_os_family == 'Darwin' - ansible.builtin.set_fact: - brewtaps: "{{ brewtaps + ['hashicorp/tap'] }}" + ansible.builtin.set_fact: + brewtaps: "{{ brewtaps + ['hashicorp/tap'] }}" diff --git a/tasks/src/ghostty.yml b/tasks/src/ghostty.yml index 50eeb4e..b6c4210 100644 --- a/tasks/src/ghostty.yml +++ b/tasks/src/ghostty.yml @@ -2,32 +2,16 @@ --- - name: Build ghostty from source block: - - name: Create temp path - ansible.builtin.tempfile: - state: directory - prefix: ghostty. - register: d_ghostty_tmp - - name: Clone ghostty git repository ansible.builtin.git: depth: 1 - dest: "{{ d_ghostty_tmp.path }}/ghostty" - repo: "{{ pkgconfig_ghostty.git_repo }}" - version: "{{ pkgconfig_ghostty.version }}" + dest: "{{ d_tempdir.path }}/ghostty" + repo: "{{ ghostty.repo }}" + version: "{{ ghostty.vers }}" - name: Build ghostty - ansible.builtin.command: - chdir: "{{ d_ghostty_tmp.path }}/ghostty" - cmd: "zig build -D{{ pkgconfig_ghostty.optimize }}" + become: "{{ ext_become }}" register: c_ghostty_build - - - name: Install ghostty - ansible.file.copy: - src: "{{ d_ghostty_tmp.path }}/ghostty/zig-out/bin/ghostty" - dest: "{{ pkgconfig_ghostty.install_prefix }}/bin/ghostty" - owner: "{{ pkgconfig_ghostty.owner }}" - group: "{{ pkgconfig_ghostty.group }}" - mode: "0755" - remote_src: true - become: "{{ pkgconfig_ghostty.become }}" - become_user: "{% if pkgconfig_ghostty.become %}{{ pkgconfig_ghostty.owner }}{% else %}~{% endif %}" + ansible.builtin.command: + chdir: "{{ d_tempdir.path }}/ghostty" + cmd: "zig build -p {{ path.prefix }} -D{{ pkgconfig_ghostty.optimize }}" diff --git a/tasks/src/neovim.yml b/tasks/src/neovim.yml index 3dc44e9..20ac6cc 100644 --- a/tasks/src/neovim.yml +++ b/tasks/src/neovim.yml @@ -14,12 +14,10 @@ version: "{{ pkgconfig_neovim.version }}" - name: Build and install neovim + become: "{{ ext_become }}" ansible.builtin.make: - chdir: "{{ d_nvim_tmp.path }}/neovim" + chdir: "{{ d_tempdir.path }}/neovim" params: - CMAKE_BUILD_TYPE: "{{ pkgconfig_neovim.build_type }}" - CMAKE_INSTALL_PREFIX: "{{ pkgconfig_neovim.install_prefix }}" + CMAKE_BUILD_TYPE: "{{ neovim.build_type }}" + CMAKE_INSTALL_PREFIX: "{{ path.prefix }}" target: install - become: "{{ pkgconfig_neovim.dobecome }}" - become_user: "{% if pkgconfig_neovim.dobecome %}{{ pkgconfig_neovim.owner }}{% else %}~{% endif %}" - when: not pkgconfig_neovim.use_appimage diff --git a/vars/pkgs/broot.yml b/vars/pkgs/broot.yml index 40a9f2b..b196d23 100644 --- a/vars/pkgs/broot.yml +++ b/vars/pkgs/broot.yml @@ -9,3 +9,4 @@ broot: - libxcb-xfixes0-dev RedHat: - libxcb + Darwin: [] diff --git a/vars/pkgs/fd.yml b/vars/pkgs/fd.yml index 8e5c94d..a2a2380 100644 --- a/vars/pkgs/fd.yml +++ b/vars/pkgs/fd.yml @@ -2,7 +2,5 @@ fd: pkgs: Darwin: - fd - RedHat: - - fd-find - Debian: + Linux: - fd-find diff --git a/vars/pkgs/ghostty.yml b/vars/pkgs/ghostty.yml index 0a4492f..3f11d3f 100644 --- a/vars/pkgs/ghostty.yml +++ b/vars/pkgs/ghostty.yml @@ -8,6 +8,7 @@ ghostty: RedHat: - gtk4-devel - libadwaita-devel + Darwin: [] archmap: arm64: aarch64 x86_64: x86_64 diff --git a/vars/pkgs/libreoffice.yml b/vars/pkgs/libreoffice.yml index de536f6..4f21fb5 100644 --- a/vars/pkgs/libreoffice.yml +++ b/vars/pkgs/libreoffice.yml @@ -1,9 +1,16 @@ libreoffice: - method: flatpak + methods: + default: sys + Ubuntu: flatpak + Fedora: flatpak + MacOSX: cask flatpak: name: org.libreoffice.LibreOffice remote: flathub - Debian: - - libreoffice - RedHat: - - libreoffice + pkgs: + Debian: + - libreoffice + RedHat: + - libreoffice + Darwin: + - libreoffice diff --git a/vars/pkgs/neovim.yml b/vars/pkgs/neovim.yml index 14df1dc..a20e4ec 100644 --- a/vars/pkgs/neovim.yml +++ b/vars/pkgs/neovim.yml @@ -4,8 +4,8 @@ neovim: appimage: base_url: https://github.com/neovim/neovim/releases/download link_name: nvim - method: - default: appimage + methods: + default: src Fedora: sys Ubuntu: sys MacOSX: sys diff --git a/vars/pkgs/pgadmin.yml b/vars/pkgs/pgadmin.yml index 959f4a4..5e2069e 100644 --- a/vars/pkgs/pgadmin.yml +++ b/vars/pkgs/pgadmin.yml @@ -2,3 +2,11 @@ pgadmin: flatpak: name: org.pgadmin.pgadmin4 remote: flathub + methods: + default: flatpak + MacOSX: cask + Fedora: flatpak + Ubuntu: flatpak + pkgs: + Darwin: + - pgadmin4 diff --git a/vars/pkgs/terraform.yml b/vars/pkgs/terraform.yml index 29c2578..409abf8 100644 --- a/vars/pkgs/terraform.yml +++ b/vars/pkgs/terraform.yml @@ -1,3 +1,6 @@ terraform: - Linux: terraform - Darwin: hashicorp/tap/terraform + pkgs: + Linux: + - terraform + Darwin: + - hashicorp/tap/terraform diff --git a/vars/pkgs/terraformls.yml b/vars/pkgs/terraformls.yml index fbc8ed9..57999c4 100644 --- a/vars/pkgs/terraformls.yml +++ b/vars/pkgs/terraformls.yml @@ -1,3 +1,6 @@ terraformls: - Linux: terraform-ls - Darwin: hashicorp/tap/terraform-ls + pkgs: + Linux: + - terraform-ls + Darwin: + - hashicorp/tap/terraform-ls diff --git a/vars/pkgs/zls.yml b/vars/pkgs/zls.yml index 4734984..7fe592e 100644 --- a/vars/pkgs/zls.yml +++ b/vars/pkgs/zls.yml @@ -1,4 +1,5 @@ zls: + version: 0.13.0 base_url: https://builds.zigtools.org sysmap: Darwin: macos