arial.yml 1.97 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
---
- name: check if arial is installed
  stat:
    path: "{{ texpath }}/fonts/map/vtex/ua1.ali"
  register: arial

  # - name: temporary directory
  #   file:
  #     path: /tmp/arial
  #     state: directory
  #   when: arial.stat.isreg

- name: download uarial
  become: yes
  unarchive:
    src: "ftp://ftp.dante.de/tex-archive/fonts/urw/arial.zip"
    dest: /tmp
    creates: /tmp/arial
    remote_src: yes
  when: arial.stat.isreg == false

- name: create missing directories
  become: yes
  file:
    state: directory
    path: "{{ texpath }}/{{ item }}"
  with_items:
  - fonts/afm/urw
  - fonts/tfm/urw
  - fonts/type1/urw
  - fonts/vf/urw
  - fonts/map/dvips/ua1
  - fonts/map/vtex
  - dvips/config
  - doc/fonts
  when: arial.stat.isreg == false
  notify: 
  - update latex

- name: move afm, tfm, type1, vf dirs
  become: yes
  copy:
    src: "/tmp/arial/{{ item }}/"
    dest: "{{ texpath }}/fonts/{{ item }}/urw/arial"
  with_items: 
  - afm
  - tfm
  - type1
  - vf
  when: arial.stat.isreg == false
  notify: 
  - update latex

- name: copy latex dir
  become: yes
  copy:
    src: /tmp/arial/latex/
    dest: "{{ texpath }}/tex/latex/ua1"
  when: arial.stat.isreg == false
  notify: 
  - update latex

- name: copy map dir
  become: yes
  copy:
    src: "/tmp/arial/{{ item.from }}"
    dest: "{{ texpath }}/{{ item.to }}"
  with_items:
  - { from: "map/ua1.map", to: "dvips/config" }
  - { from: "map/ua1.map", to: "fonts/map/dvips/ua1" }
  - { from: "map/ua1.ali", to: "fonts/map/vtex" }
  when: arial.stat.isreg == false
  notify:
  - update latex

- name: copy docu 
  become: yes
  copy:
    src: "/tmp/arial/{{ item }}"
    dest: "{{ texpath }}/doc/fonts/urw"
  with_items:
  - doc/
  - README
  when: arial.stat.isreg == false
  notify:
    - update latex

- name: activate fonts
  become: yes
  environment:
    PATH: "{{ lookup('env', 'PATH') }}"
  command: updmap-sys --enable Map ua1.map
  args:
    chdir: "{{ texpath }}"
  when: arial.stat.isreg == false
  notify:
    - update latex