Commit 2c22ff46 authored by julian.gethmann's avatar julian.gethmann

Make LaTeX fonts more stateless and work with `su`

* LaTeXfonts' tasks only run if necessary
* They run with 'sudo su -c ' so the problem with sudo and su is worked
around.
*
parent 04a27706
---
# should be more stateless...
- name: Check for getnonfreefonts
command: /usr/local/bin/getnonfreefonts-sys --version
register: gnff_available
changed_when: gnff_available.rc != 0
ignore_errors: yes
- name: Download common MS fonts
get_url: dest=/tmp/ url=https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts mode=777
get_url:
dest: /tmp/
url: "https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts"
mode: 777
register: tex_fonts_dl_ok
when: gnff_available.changed
- name: Install getnonfreefonts
environment:
PATH: "{{ lookup('env', 'PATH') }}"
become: yes
command: /tmp/install-getnonfreefonts
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
- name: Install all TeX fonts
environment:
PATH: "{{ lookup('env', 'PATH') }}"
become: yes
command: getnonfreefonts-sys -a
command: sudo su -c "/usr/local/bin/getnonfreefonts-sys -a"
when: all_fonts.changed
- name: Register all TeX fonts
environment:
PATH: "{{ lookup('env', 'PATH') }}"
become: yes
command: getnonfreefonts-sys -r
command: sudo su -c "/usr/local/bin/getnonfreefonts-sys -r"
when: all_fonts.changed
- name: cleanup
file:
......@@ -28,3 +48,4 @@
dest: "/tmp/{{ item }}"
with_items:
- install-getnonfreefonts
when: gnff_downloaded.changed
......@@ -3,15 +3,17 @@
# not tested yet
- name: Install Fedora's LaTeX
dnf: name=texlive state=installed
become: yes
dnf:
name: texlive
state: installed
tags: latex
- name: Install LaTeX subpackages
become: yes
dnf:
name: "{{ item }}"
state: latest
become: yes
state: installed
with_items: "{{ texlivepackages }}"
when: ansible_distribution == "Fedora"
......
---
- name: create destination directories
become: yes
file:
path: "/usr/share/texlive/texmf-local/{{ item }}/latex/uniinput"
state: directory
mode: 0755
with_items:
- tex
- doc
register: uniinputdir
- name: download uniinput
get_url:
url: "{{ item }}"
......@@ -6,11 +17,13 @@
with_items:
- "http://wiki.neo-layout.org/export/HEAD/latex/Standard-LaTeX/uniinput.dtx"
- "http://wiki.neo-layout.org/export/HEAD/latex/Standard-LaTeX/uniinput.ins"
when: uniinputdir.changed
- name: compile package docu
command: pdflatex -interaction=nonstopmode uniinput.dtx
args:
chdir: /tmp
creates: /tmp/uniinput.pdf
ignore_errors: yes
- name: compile package
......@@ -19,16 +32,6 @@
chdir: /tmp
creates: /tmp/uniinput.sty
- name: create destination directories
file:
path: "/usr/share/texlive/texmf-local/{{ item }}/latex/uniinput"
state: directory
mode: 0755
with_items:
- tex
- doc
become: yes
- name: move style to LaTeX dir
become: yes
copy:
......@@ -39,7 +42,7 @@
- name: move docu to LaTeX dir
become: yes
copy:
copy:
src: /tmp/uniinput.pdf
dest: "/usr/share/texlive/texmf-local/doc/latex/uniinput/"
remote_src: yes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment