50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
#
|
|
## Package: gopls
|
|
## Description: go language server
|
|
## Version: latest
|
|
## Methods: source
|
|
## Helpers: go_install
|
|
---
|
|
- name: Set gopls default facts # {{{
|
|
ansible.builtin.set_fact:
|
|
gopls:
|
|
methods:
|
|
- source
|
|
install_files:
|
|
- to: bin/gopls
|
|
version: "{{ gopls_version | default('latest') }}"
|
|
install_url: golang.org/x/tools/gopls
|
|
pkg_deps:
|
|
- go
|
|
# }}}
|
|
- name: Start gopls configuration
|
|
when:
|
|
- "'gopls' not in __configured"
|
|
block:
|
|
- name: Set gopls install method
|
|
when:
|
|
- gopls_imethod is undefined
|
|
ansible.builtin.set_fact:
|
|
gopls_imethod: "{{ imethod if imethod in gopls.methods else gopls.methods[0] }}"
|
|
|
|
- name: Set gopls source install facts
|
|
when:
|
|
- gopls_imethod == 'source'
|
|
block:
|
|
- name: Configure gopls source install
|
|
ansible.builtin.set_fact:
|
|
gopls_go_pkg:
|
|
url: "{{ gopls.install_url }}@ {{ gopls.version }}"
|
|
bin: "{{ path_bind }}/gopls"
|
|
files: "{{ gopls.install_files }}"
|
|
|
|
- name: Queue gopls for go_install
|
|
ansible.builtin.set_fact:
|
|
pkg_go: "{{ pkg_go + [gopls_go_pkg] }}"
|
|
gopls_install: "{{ gopls_imethod }}={{ gopls_go_pkg }}"
|
|
|
|
- name: Finalise gopls configuration
|
|
ansible.builtin.set_fact:
|
|
__configured: "{{ __configured | combine( { 'gopls': gopls_install } ) }}"
|