Files
ansible_role_package/tasks/pkgs/starship.yml

42 lines
1.3 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Package: starship
## Description: fancy and useful shell prompt
## Version: latest
## Methods: source
## Helpers: cargo
---
- name: Set starship default config
ansible.builtin.set_fact:
starship:
install_methods:
- source
- name: Configure starship
when:
- "'starship' not in __configured"
block:
- name: Set starship install method
when:
- starship_install_method is undefined
ansible.builtin.set_fact:
starship_install_method: "{{ install_method if install_method in starship.install_methods else starship.install_methods[0] }}"
- name: Configure starship source install
when:
- starship_install_method == "source"
block:
- name: Set cargo build options
ansible.builtin.set_fact:
starship_cargo_install:
name: starship
locked: true
version: "{{ starship_version | default(omit) }}"
- name: Append starship to pkg_cargo
ansible.builtin.set_fact:
pkg_cargo: "{{ pkg_cargo + [{'name': 'starship', 'locked': true}] }}"
- name: Finalize starship configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'starship': starship_install_method } ) }}"