Make stuff run on Mint VM at work
This commit is contained in:
33
dot_bootstrap/setup_fonts.yml
Normal file
33
dot_bootstrap/setup_fonts.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
- name: Role out main Configuration to {{ ansible_hostname }}
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: true
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Get my user
|
||||
ansible.builtin.set_fact:
|
||||
regular_user: "{{ ansible_env.SUDO_USER or ansible_user_id }}"
|
||||
|
||||
|
||||
|
||||
- name: Ensure fonts directory exists
|
||||
ansible.builtin.file:
|
||||
path: "~{{ regular_user }}/.fonts"
|
||||
state: directory
|
||||
owner: "{{ regular_user }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Check if specific font files exist
|
||||
ansible.builtin.find:
|
||||
paths: "~{{ regular_user }}/.fonts"
|
||||
patterns: "CaskaydiaCoveNerdFont*.ttf" # Adjust for actual font files in the zip
|
||||
register: existing_fonts
|
||||
|
||||
- name: Download and extract Nerdfonts
|
||||
ansible.builtin.unarchive:
|
||||
src: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/CascadiaCode.zip
|
||||
dest: "~{{ regular_user }}/.fonts"
|
||||
remote_src: true
|
||||
owner: "{{ regular_user }}"
|
||||
when: existing_fonts.matched == 0 # Only run if no matching fonts found
|
||||
Reference in New Issue
Block a user