Files
ansible_role_package/tasks/pkgs/cheat.yml

48 lines
1.4 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Package: cheet
## Description: create and view interactive cheat sheets
## Version: latest
## Methods: source
## Helpers: go_install
---
- name: Set cheat default facts # {{{
ansible.builtin.set_fact:
cheat:
methods:
- source
go_pkg: github.com/cheat/cheat/cmd/cheat
version: latest
# }}}
- name: Configure cheat
when:
- "'cheat' not in __configured"
block:
- name: Set cheat install method
when:
- cheat_imethod is undefined
ansible.builtin.set_fact:
cheat_imethod: "{{ imethod if imethod in cheat.methods else cheat.methods[0] }}"
- name: Configure cheat source install
when:
- cheat_imethod == 'source'
block:
- name: Configure cheat go install
ansible.builtin.set_fact:
cheat_go_install:
url: "{{ cheat.go_pkg }}@{{ cheat.version }}"
bin: "{{ path_bin }}/cheat"
- name: Append cheat to pkg_go
ansible.builtin.set_fact:
pkg_go: "{{ pkg_go + [cheat_go_install] }}"
- name: Finalise cheat go install
ansible.builtin.set_fact:
cheat_install: "{{ cheat_imethod }}={{ cheat_go_install }}"
- name: Set cheat_configured
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'cheat': cheat_install } ) }}"