Files
Matthew Stobbs 01239701f9 add restic
- fix packages that were broken
- change the way configuration is done
  - define default facts for packages with os_family level vars
  - refine the default facts into an os_family specfic config
2026-04-18 18:44:18 -06:00

56 lines
1.6 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
pkg_deps:
- go
# }}}
- 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: Queue package dependencies
loop: "{{ cheat.pkg_deps }}"
loop_control:
loop_var: dep
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
- 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 } ) }}"