add zls
This commit is contained in:
45
tasks/build/zls.yml
Normal file
45
tasks/build/zls.yml
Normal 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
|
||||
10
tasks/pkgs/zls.yml
Normal file
10
tasks/pkgs/zls.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- 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
|
||||
ansible.builtin.set_fact:
|
||||
srcpkgs: "{{ srcpkgs + [ 'zls' ] }}"
|
||||
Reference in New Issue
Block a user