Files
ansible_role_package/tasks/pkgs/buf.yml
2026-03-14 20:22:51 -06:00

35 lines
1014 B
YAML

# vim: set filetype=yaml.ansible :
---
- 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 } ) }}"