add lua-language-server package
This commit is contained in:
44
tasks/build/lua-language-server.yml
Normal file
44
tasks/build/lua-language-server.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
- name: set needed variables lua language server
|
||||
ansible.builtin.set_fact:
|
||||
luals_pkg: "lua-language-server-{{ pkgconfig_luals.version }}-{{ pkgconfig_luals.sysmap[ansible_system] }}-{{ pkgconfig_luals.archmap[ansible_architecture] }}.tar.gz"
|
||||
|
||||
- name: check if lua language server is already installed
|
||||
ansible.builtin.stat:
|
||||
path: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
|
||||
register: r_luals_stat
|
||||
|
||||
- name: install lua-language-server
|
||||
block:
|
||||
- name: create temp path
|
||||
ansible.builtin.tempfile:
|
||||
state: directory
|
||||
prefix: luals_dl.
|
||||
register: d_luals_dl_tmp
|
||||
|
||||
- name: get latest lua-language-server
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
||||
url: "{{ pkgconfig_luals.base_url }}/{{ pkgconfig_luals.version }}/{{ luals_pkg }}"
|
||||
decompress: false
|
||||
|
||||
- name: create install_path
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ pkgconfig_luals.install_path }}"
|
||||
become: true
|
||||
|
||||
- name: extract lua language server archive
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkgconfig_luals.install_path }}"
|
||||
src: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
||||
remote_src: true
|
||||
become: true
|
||||
|
||||
- name: link lua language server binary
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
|
||||
path: "{{ pkgconfig_luals.install_prefix }}/bin/lua-language-server"
|
||||
become: true
|
||||
when: not r_luals_stat.stat.exists
|
||||
@@ -9,9 +9,6 @@
|
||||
path: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
|
||||
register: r_zig_stat
|
||||
|
||||
- debug:
|
||||
var: r_zig_stat
|
||||
|
||||
- name: update/install zig
|
||||
block:
|
||||
- name: create temp path
|
||||
@@ -19,13 +16,13 @@
|
||||
state: directory
|
||||
prefix: zig_dl.
|
||||
register: d_zig_dl_tmp
|
||||
|
||||
|
||||
- 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
|
||||
|
||||
|
||||
- name: create install_path
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
---
|
||||
- name: get latest lua-language-server
|
||||
ansible.builtin.get_url:
|
||||
url: https://github.com/LuaLS/lua-language-server/releases/download/3.13.5/lua-language-server-3.13.5-linux-x64.tar.gz
|
||||
- ansible.builtin.include_vars:
|
||||
file: lua-language_server.yml
|
||||
name: _luals
|
||||
- ansible.builtin.set_fact:
|
||||
pkgconfig_luals: "{{ _luals | ansible.builtin.combine(pkgconfig.luals) }}"
|
||||
|
||||
- name: append to pkgs
|
||||
ansible.builtin.set_fact:
|
||||
srcpkgs: "{{ srcpkgs + [ 'lua-language-server' ] }}"
|
||||
|
||||
Reference in New Issue
Block a user