ctorgalson.nerdfonts

Ansible 角色 NerdFonts

这是一个用于在 Linux 和 macOS 上安装 Nerd Fonts 的 Ansible 角色。

在当前版本中,它直接从 Github 下载单个字体文件,但不克隆整个仓库(因为它太大了!)

需求

没有特殊要求。

角色变量

变量名 默认值 描述
nf_user '' 要为其安装字体的用户名。必填。
nf_group 未设置 要为其安装字体的用户组。必填。
nf_linux_fonts_dir /home/{{ nf_user }}/.local/share/fonts/NerdFonts 在 Linux 系统上安装字体的默认位置。
nf_macos_fonts_dir /Users/{{ nf_user }}/Library/Fonts 在 macOS 系统上安装字体的默认位置。
nf_github_raw_patched_fonts https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts 下载原始字体文件的远程目录。
nf_single_fonts [] 要下载的单个字体路径的列表,相对于 nf_github_raw_patched_fonts(参见下面的示例剧本)。必填。

依赖

没有特殊依赖。

示例剧本

---
- name: Ansible 角色 NerdFonts 示例剧本。
  hosts: all
  vars:
    nf_user: "molecule"
    nf_group: "{{ nf_user }}"
    nf_single_fonts:
     - "UbuntuMono/Regular/complete/Ubuntu Mono Nerd Font Complete.ttf"
     - "AurulentSansMono/complete/AurulentSansMono-Regular Nerd Font Complete.otf"
  tasks:
    - name: "包含 ansible-role-nerdfonts"
      include_role:
        name: "ansible-role-nerdfonts"

许可证

GPLv3

关于项目

An Ansible role to install some/all Nerdfonts on Linux and macOS.

安装
ansible-galaxy install ctorgalson.nerdfonts
许可证
gpl-3.0
下载
1.3k