finished list, now to test them all
This commit is contained in:
@@ -1,8 +1,23 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
#
|
||||
## Package: nerdfonts
|
||||
## Description: Monospace fonts that are attractive for developers
|
||||
## Version: latest
|
||||
## Methods: archive
|
||||
## Helpers: nerdfont_config, archive
|
||||
---
|
||||
- name: Set default nerdfonts facts # {{{
|
||||
ansible.builtin.set_fact:
|
||||
__nerdfonts:
|
||||
nerdfonts:
|
||||
methods:
|
||||
Linux:
|
||||
- archive
|
||||
Darwin:
|
||||
- system
|
||||
install_path: share/fonts
|
||||
base_url: https://github.com/ryanoasis/nerd-fonts/releases/latest/download
|
||||
install_list: "{{ nerdfonts_install_list | default(['JetBrainsMono', 'FiraCode', 'Symbols']) }}"
|
||||
__nerdfonts: # {{{
|
||||
0xProto:
|
||||
brew: font-0xproto-nerd-font
|
||||
"3270":
|
||||
@@ -165,40 +180,56 @@
|
||||
brew: font-victor-mono-nerd-font
|
||||
ZedMono:
|
||||
brew: font-zed-mono-nerd-font
|
||||
# }}}
|
||||
base_url: https://github.com/ryanoasis/nerd-fonts/releases/latest/download
|
||||
# }}}
|
||||
- name: Configure nerdfonts
|
||||
when:
|
||||
- "'nerdfonts' not in __configured"
|
||||
block:
|
||||
- name: Create nerdfonts directories
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ install_prefix }}/{{ nerdfonts_install_path }}"
|
||||
owner: "{{ install_prefix_owner }}"
|
||||
group: "{{ install_prefix_group }}"
|
||||
- name: Set nerdfonts install method
|
||||
when:
|
||||
- nerdfonts_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
nerdfonts_imethod: "{{ imethod if imethod in nerdfonts.methods[system] else nerdfonts.methods[system][0] }}"
|
||||
|
||||
- name: Configure nerdfonts archive install
|
||||
when:
|
||||
- nerdfonts_install_list|length > 0
|
||||
- ansible_facts["system"] != 'Darwin'
|
||||
loop: "{{ nerdfonts_install_list }}"
|
||||
loop_control:
|
||||
loop_var: nf
|
||||
ansible.builtin.include_tasks: helpers/nerdfont_config.yml
|
||||
- nerdfonts_imethod == 'archive'
|
||||
block:
|
||||
- name: Create nerdfonts directories
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ install_prefix }}/{{ nerdfonts.install_path }}"
|
||||
owner: "{{ install_prefix_owner }}"
|
||||
group: "{{ install_prefix_group }}"
|
||||
|
||||
- name: Append nerdfonts to pkg_cask
|
||||
- name: Configure nerdfonts archive install
|
||||
when:
|
||||
- nerdfonts_install_list|length > 0
|
||||
loop: "{{ nerdfonts.install_list }}"
|
||||
loop_control:
|
||||
loop_var: nf
|
||||
ansible.builtin.include_tasks: helpers/nerdfont_config.yml
|
||||
|
||||
- name: Configure nerdfonts system install
|
||||
when:
|
||||
- ansible_facts["system"] == 'Darwin'
|
||||
loop: "{{ nerdfonts_install_list }}"
|
||||
loop_control:
|
||||
loop_var: nf
|
||||
- nerdfonts_imethod == 'system'
|
||||
block:
|
||||
- name: Append nerdfonts to pkg_cask
|
||||
loop: "{{ nerdfonts.install_list }}"
|
||||
loop_control:
|
||||
loop_var: nf
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + [__nerdfonts[nf].brew] }}"
|
||||
|
||||
- name: Finalise nerdfonts archive install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + [__nerdfonts[nf].brew] }}"
|
||||
nerdfonts_install: "{{ nerdfonts_imethod }}={{ nerdfont.install_list }}"
|
||||
|
||||
- name: Set nerdfonts_configured
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'nerdfonts': true } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'nerdfonts': nerdfonts_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user