41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
#
|
|
## Package: buf
|
|
## Description: A CLI tool for working with protocols buffers
|
|
## Version: latest
|
|
## Methods: source
|
|
## Helpers: go_install
|
|
---
|
|
- name: Set default buf values
|
|
ansible.builtin.set_fact:
|
|
buf:
|
|
install_methods:
|
|
- source
|
|
build_deps:
|
|
- go
|
|
version: latest
|
|
go_pkg: github.com/bufbuild/buf/cmd/buf
|
|
- name: Configure bug install
|
|
when:
|
|
- "'buf' not in __configured"
|
|
block:
|
|
- name: Set buf install method
|
|
when:
|
|
- buf_install_method is undefined
|
|
ansible.builtin.set_fact:
|
|
buf_install_method: "{{ install_method if install_method in buf.install_methods else buf.install_methods[0] }}"
|
|
|
|
- name: Configure buf source install
|
|
when:
|
|
- buf_install_method == 'source'
|
|
block:
|
|
- name: Append buf to pkg_go
|
|
ansible.builtin.set_fact:
|
|
buf_go_install:
|
|
bin: buf
|
|
url: "{{ buf.go_pkg }}@{{ buf.version }}"
|
|
|
|
- name: Finalise buf configuration
|
|
ansible.builtin.set_fact:
|
|
__configured: "{{ __configured | combine( { 'buf': buf_install_method } ) }}"
|