adjusting variable names, fixing errors
This commit is contained in:
@@ -6,35 +6,44 @@
|
||||
## Methods: source
|
||||
## Helpers: go_install
|
||||
---
|
||||
- name: Set default buf values
|
||||
- name: Set default buf values # {{{
|
||||
ansible.builtin.set_fact:
|
||||
buf:
|
||||
install_methods:
|
||||
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
|
||||
- buf_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
buf_install_method: "{{ install_method if install_method in buf.install_methods else buf.install_methods[0] }}"
|
||||
buf_imethod: "{{ imethod if imethod in buf.methods else buf.methods[0] }}"
|
||||
|
||||
- name: Configure buf source install
|
||||
when:
|
||||
- buf_install_method == 'source'
|
||||
- buf_imethod == 'source'
|
||||
block:
|
||||
- name: Append buf to pkg_go
|
||||
- name: Configure buf go install
|
||||
ansible.builtin.set_fact:
|
||||
buf_go_install:
|
||||
bin: buf
|
||||
url: "{{ buf.go_pkg }}@{{ buf.version }}"
|
||||
|
||||
- name: Append buf to pkg_go
|
||||
ansible.builtin.set_fact:
|
||||
pkg_go: "{{ pkg_go + [buf_go_install] }}"
|
||||
|
||||
- name: Finalise buf source install
|
||||
ansible.builtin.set_fact:
|
||||
buf_install: "{{ buf_imethod }}={{ buf_go_install }}"
|
||||
|
||||
- name: Finalise buf configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'buf': buf_install_method } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'buf': buf_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user