LaTeXfonts.yml 1.25 KB
Newer Older
julian.gethmann's avatar
julian.gethmann committed
1
---
2 3 4 5 6 7
- name: Check for getnonfreefonts
  command: /usr/local/bin/getnonfreefonts-sys --version
  register: gnff_available
  changed_when: gnff_available.rc != 0
  ignore_errors: yes

8 9
- name: Check installed fonts
  become: yes
10
  command: sudo su -c "/usr/local/bin/getnonfreefonts --sys -l | grep 'not installed'"
11 12 13 14
  register: all_fonts
  changed_when: all_fonts.rc == 0
  ignore_errors: yes

julian.gethmann's avatar
julian.gethmann committed
15
- name: Download common MS fonts
16
  become: yes
17
  get_url:
18 19
    dest: "{{ texpath }}"
    url: "https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts"
20
    mode: 0755
julian.gethmann's avatar
julian.gethmann committed
21
  register: tex_fonts_dl_ok
22
  when: gnff_available.changed
julian.gethmann's avatar
julian.gethmann committed
23 24

- name: Install getnonfreefonts
25
  become: yes
26
  environment:
julian.gethmann's avatar
julian.gethmann committed
27
    PATH: "{{ lookup('env', 'PATH') }}"
28 29 30
  command: "{{ texpath }}/install-getnonfreefonts"
  args:
    creates: /usr/local/bin/getnonfreefonts
julian.gethmann's avatar
julian.gethmann committed
31 32

- name: Install all TeX fonts
33
  become: yes
34
  environment:
julian.gethmann's avatar
julian.gethmann committed
35
    PATH: "{{ lookup('env', 'PATH') }}"
36
  command: sudo su -c "/usr/local/bin/getnonfreefonts --sys -a"
37 38
  args:
    warn: False
39
  when: all_fonts.changed
julian.gethmann's avatar
julian.gethmann committed
40 41

- name: Register all TeX fonts
42
  environment:
julian.gethmann's avatar
julian.gethmann committed
43 44
    PATH: "{{ lookup('env', 'PATH') }}"
  become: yes
45
  command: sudo su -c "/usr/local/bin/getnonfreefonts --sys -r"
46
  when: all_fonts.changed
julian.gethmann's avatar
julian.gethmann committed
47

48 49
- name: flush handlers
  meta: flush_handlers