Files
ansible_role_package/tasks/pkgs/choose.yml
2026-04-13 14:50:45 -06:00

47 lines
1.4 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Package: choose
## Description: a human-friendly and fast alternative to cut and (sometimes) awk
## Version: latest
## Methods: source
## Helpers: cargo
---
- name: Set choose default facts # {{{
ansible.builtin.set_fact:
choose:
methods:
- source
version: 1.3.7
# }}}
- name: Configure choose
when:
- "'choose' not in __configured"
block:
- name: Set choose install method
when:
- choose_imethod is undefined
ansible.builtin.set_fact:
choose_imethod: "{{ imethod if imethod in choose.methods else choose.methods[0] }}"
- name: Configure choose source install
when:
- choose_imethod == 'source'
block:
- name: Configure choose cargo install
ansible.builtin.set_fact:
choose_cargo_install:
name: choose
version: "{{ choose.version }}"
- name: Append choose to pkg_cargo
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [choose_cargo_install] }}"
- name: Finalise choose cargo install
ansible.builtin.set_fact:
choose_install: "{{ choose_imethod }}={{ choose_cargo_install }}"
- name: Finalise choose configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'choose': choose_install } ) }}"