LaTeXfonts.yml 1.29 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

julian.gethmann's avatar
julian.gethmann committed
8
- name: Download common MS fonts
9 10 11 12
  get_url:
    dest: /tmp/
    url: "https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts"
    mode: 777
julian.gethmann's avatar
julian.gethmann committed
13
  register: tex_fonts_dl_ok
14
  when: gnff_available.changed
julian.gethmann's avatar
julian.gethmann committed
15 16

- name: Install getnonfreefonts
17
  environment:
julian.gethmann's avatar
julian.gethmann committed
18 19
    PATH: "{{ lookup('env', 'PATH') }}"
  become: yes
20
  command: /tmp/install-getnonfreefonts
21 22 23 24 25 26 27 28 29
  when: gnff_available.changed
  register: gnff_downloaded

- name: Check installed fonts
  become: yes
  command: sudo su -c "/usr/local/bin/getnonfreefonts-sys -l | grep 'not installed'"
  register: all_fonts
  changed_when: all_fonts.rc == 0
  ignore_errors: yes
julian.gethmann's avatar
julian.gethmann committed
30 31

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

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

- name: cleanup
46 47 48 49
  file:
    state: absent
    dest: "/tmp/{{ item }}"
  with_items:
julian.gethmann's avatar
julian.gethmann committed
50
  - install-getnonfreefonts
51
  when: gnff_downloaded.changed