52 lines
1.6 KiB
YAML
52 lines
1.6 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:
|
|
Archlinux: [system, source]
|
|
default: [source]
|
|
- name: Finalise choose default facts
|
|
ansible.builtin.set_fact:
|
|
choose:
|
|
methods: "{{ choose.methods[os_family] | default(choose.methods.defualt) }}"
|
|
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 } ) }}"
|