You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

1 year ago
---
- name: Set up fonts
vars:
1 year ago
uid: "{{ lookup('env','USER') }}"
fonts:
- key: UbuntuMono
value: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/UbuntuMono.zip
- key: EBGaramond
value: https://www.fontsc.com/font/download/eb-garamond
1 year ago
font_size: 14
1 year ago
hosts: localhost
connection: local
become: false
tasks:
- name: Have font installed allready
ansible.builtin.stat:
path: /usr/local/share/fonts/{{ item.key }}
register: r
loop: '{{ fonts }}'
1 year ago
- name: get font
ansible.builtin.command:
chdir: /tmp/
cmd: wget -O {{ item.item.key }}.zip {{ item.item.value }}
when: not item.stat.exists
loop: '{{ r.results }}'
- name: create font dir
ansible.builtin.file:
dest: /tmp/{{ item.item.key }}
state: directory
when: not item.stat.exists
loop: '{{ r.results }}'
- name: unzip font
become: true
1 year ago
ansible.builtin.command:
chdir: /tmp/{{ item.item.key }}
cmd: unzip ../{{ item.item.key }}.zip
when: not item.stat.exists
loop: '{{ r.results }}'
1 year ago
- name: install font
1 year ago
become: true
ansible.builtin.command:
chdir: /tmp/
cmd: mv {{ item.item.key }} /usr/local/share/fonts/
creates: /usr/local/share/fonts/{{ item.item.key }}
when: not item.stat.exists
loop: '{{ r.results }}'
- name: delete font dir
ansible.builtin.file:
dest: /tmp/{{ item.item.key }}
state: absent
when: not item.stat.exists
loop: '{{ r.results }}'
- name: delete font zip
ansible.builtin.file:
dest: /tmp/{{ item.item.key }}.zip
state: absent
when: not item.stat.exists
loop: '{{ r.results }}'
1 year ago
- name: make foot dir
ansible.builtin.file:
dest: /home/{{ uid }}/.config/foot
state: directory
- name: install foot config
ansible.builtin.template:
src: ../templates/foot.ini.j2
dest: /home/{{ uid }}/.config/foot/foot.ini
owner: '{{ uid }}'
group: '{{ uid }}'
mode: '0640'