This commit is contained in:
Matthew Stobbs
2025-02-01 14:21:29 -07:00
parent b83dc78546
commit 6885752c02
3 changed files with 67 additions and 0 deletions

45
tasks/build/zls.yml Normal file
View File

@@ -0,0 +1,45 @@
---
- 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
ansible.builtin.stat:
path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls"
register: r_zls_stat
- name: update/install zls
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 }}/{{ pkgconfig_zls.version }}/{{ zls_pkg }}"
decompress: false
- name: create install_path
ansible.builtin.file:
state: directory
path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}"
become: true
- name: extract zls package
ansible.builtin.unarchive:
dest: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}"
src: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}"
remote_src: true
become: true
- name: link zls binary
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