Files
ansible_role_package/tasks/build/nerdfonts.yml
Matthew Stobbs 2e4e73666d fixed nerdfonts variable error
Signed-off-by: Matthew Stobbs <matthew.stobbs@ucalgary.ca>
2025-02-14 14:12:59 -07:00

38 lines
1.3 KiB
YAML

# vim: set filetype=yaml.ansible :
# Install nerdfonts for each platform
---
- name: linux installation
when: ansible_system == 'Linux'
block:
- name: set install path for non-system installs
ansible.builtin.set_fact:
nerdfonts_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts"
when: not pkgconfig_nerdfonts.system_install
- name: set install path for system wide installs
ansible.builtin.set_fact:
nerdfonts_install_path: "/usr/local/share/fonts"
when: pkgconfig_nerdfonts.system_install
- name: create nerdfonts directories
ansible.builtin.file:
path: "{{ nerdfonts_install_path }}/{{ font }}"
state: directory
become: "{{ pkgconfig_nerdfonts.system_install }}"
loop: "{{ pkgconfig_nerdfonts.install }}"
loop_control:
loop_var: font
register: nerdfont_result
- name: Download and extract nerdfonts
ansible.builtin.unarchive:
creates: "{{ nerdfonts_install_path }}/{{ font }}/README.md"
src: "{{ pkgconfig_nerdfonts.base_url }}/{{ font }}.tar.xz"
dest: "{{ nerdfonts_install_path }}/{{ font }}"
remote_src: true
when: nerdfont_result is changed
become: "{{ nerdfonts_system_install }}"
loop: "{{ pkgconfig_nerdfonts.install }}"
loop_control:
loop_var: font