Commit dd345bae authored by julian.gethmann's avatar julian.gethmann

Add LaTeX role that works, mostly

* Add texlive-latexdiff for producing LaTeX documents as a diff of
LaTeX-documents (a bit like trackchanges
* Add a4wide
* Add systemdocu LaTeX dependencies
* Arial probably not working (no testcase)
* Fix issue #16 and #17
* Make rule idempotent

* Add las122
parent f318dea2
......@@ -3,7 +3,6 @@ You need to have access to this repository (you need to add your public ssh-key
Then you can clone the git repository to work on in locally.
`git clone git@git.scc.kit.edu:las/ansible.git`
## How to use ansible for software installation/computer *setup*
Add your computer to the hosts file or if you are just testing add it to the local file.
Add your hostname under each role name (the name in the square brackets) you want to be run on your computer.
Also create a new file which is named
......@@ -37,7 +36,7 @@ Open an issue in the GitLab issue tracker with the label: softwarerequest
* lasarchiv: client side mount las126/las-archiv1
* opera.yml: Cobham's Opera3d (client) ^2 ^3
* admin.yml: tools for administrators
* latex.yml: basic LaTeX installation (KIT classes not yet) ^1
* latex.yml: basic LaTeX installation (Arial not yet) ^1
* kdev.yml: KDevelope (with Python PlugIn) ^1
* jabref.yml: Cross platform BibTeX bibilography software [JabRef](http://www.jabref.org/)
* pycharm.yml: Cross platform Python IDE: [PyCharm](https://www.jetbrains.com/pycharm/) IDE
......
[defaults]
inventory=hosts
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
remote_user=gethmann
roles_path=roles
become=False
......
......@@ -228,4 +228,10 @@ texlivepackages:
- texlive-gitinfo2.noarch
- texlive-fncychap # e. g. Sphinx
- texlive-tabulary
# to be continued
- texlive-latexdiff
# - texlive-latexdiff-bin
- texlive-a4wide
# systemdocu
- texlive-koma-script
- texlive-ctablestack
# to be continued
......@@ -17,6 +17,7 @@ las118.las.kit.edu
las120.las.kit.edu
las122.las.kit.edu
las-gethmann.las.kit.edu
las122.las.kit.edu
[lasarchiv]
las113.las.kit.edu
......@@ -37,6 +38,7 @@ las122.las.kit.edu
[ipynb] # Jupyter notebook
las-gethmann.las.kit.edu
las120.las.kit.edu
las122.las.kit.edu
[kdev] # KDevelope
......
......@@ -30,3 +30,9 @@
- name: lock root user
become: yes
command: passwd -l root
- name: Register all TeX fonts
environment:
PATH: "{{ lookup('env', 'PATH') }}"
become: yes
shell: getnonfreefonts-sys -r
---
- name: create bst dir
become: yes
file:
path: "{{ texpath }}/bibtex/bst"
state: directory
- name: install Axel Bernhard's BibTeX-class for poster kurz.bst
become: yes
copy:
src: kurz.bst
dest: /usr/local/texlive/texmf-local/bibtex/bst/
dest: "{{ texpath }}/bibtex/bst/kurz.bst"
backup: yes
notify: hash latex
notify:
- hash latex
tags: kurzbst
......@@ -20,83 +20,68 @@
- texlive-lettrine
- texlive-mathpazo
- texlive-rcs
# - texlive-refcount
- texlive-sciposter
- texlive-shadow
- texlive-pgf
- texlive-xcolor
- "{{ kit_tikz }}"
# ansible 2.0
#- download current zip files
# unarchive: src="{{item}}" dest=~/ansible/roles/latex/files/ copy=no
# delegate_to: 127.0.0.1
# with_items:
# - "https://intranet.kit.edu/downloads/KIT-Vorlagen-Folien.zip"
# - "https://intranet.kit.edu/downloads/KIT-Vorlagen-Poster.zip"
# - name: Unzip KIT-Classes
# become: yes
# #shell: ls /tmp > /tmp/list
# unarchive: src={{ item }}.zip dest=/usr/share/texlive/texmf-local/
# with_items:
# - KITbase
# - KITbeamer
# - KITbrief
# - KITposter
# notify: update latex
# tags: kit
- name: make tmpdir
tempfile:
prefix: ansi
state: directory
register: tmpdir
- name: clone git repo
git:
repo: https://git.scc.kit.edu/las/templates/KITlatex.git
dest: "{{ texpath }}/KIT"
dest: "{{ tmpdir.path }}"
clone: yes
key_file: "{{ lookup('file', '/home/gethmann/.ssh/id_rsa.pub') }}"
version: HEAD
update: yes
become: yes
register: kit_git
# This causes status change (because of the recursive copy I think)
- name: copy files
- name: create tex dir
become: yes
file:
path: "{{ texpath }}/tex/latex/KIT"
state: directory
- name: copy tex files
copy:
src: "{{ texpath }}/KIT/"
dest: "{{ texpath }}"
src: "{{ item }}"
dest: "{{ texpath }}/tex/latex/KIT/"
become: yes
remote_src: yes
notify:
- update latex
when: kit_git|changed
with_fileglob:
- "{{ tmpdir.path }}/KIT/tex/latex/KIT/*"
# - name: cleanup
# file: state=absent dest=/tmp/{{item}}
# with_items:
# - Install-En.pdf
# - Install-De.pdf
# - Install-En.txt
# - Install-De.txt
# - KITbase.zip
# - KITbeamerXmpl.zip
# - KITbeamer.zip
# - KIT_Briefvorlagen_LaTeX.zip
# - KITbriefXmpl.zip
# - KITbrief.zip
# - KITmanualD.pdf
# - KITmanualE.pdf
# - KITposterXmpl.zip
# - KITposter.zip
# - KIT-Vorlagen-Folien-LaTeX_06-12.zip
# - KIT-Vorlagen-Poster-LaTeX_06-12.zip
# - KIT-Vorlagen-Folien.zip
# - KIT-Vorlagen-Poster.zip
# tags:
# - latex
# - kit
- name: create doc dir
become: yes
file:
path: "{{ texpath }}/doc/latex/KIT"
state: directory
- name: copy pdf files
become: yes
copy:
src: "{{ item }}"
dest: "{{ texpath }}/doc/latex/KIT/"
remote_src: yes
notify:
- update latex
with_fileglob:
- "{{ tmpdir.path }}/KIT/doc/latex/KIT/*"
# This should be deleted when the Arial task is working
- name: hack Helvetica into KIT styles due to broken font installation
lineinfile:
line: "\\RequirePackage{helvet}"
regexp: "\\RequirePackage{uarial}"
dest: "{{ texpath }}/tex/latex/KIT/{{item}}"
regexp: "\\RequirePackage{(uarial|helvet)}"
dest: "{{ texpath }}/tex/latex/KIT/{{ item }}"
backup: yes
become: yes
with_items:
......@@ -107,66 +92,3 @@
tags:
- latex
- kit
when: kit_git|changed
# TODO
# - name: download uarial
# unarchive: src="ftp://ftp.dante.de/tex-archive/fonts/urw/arial.zip" dest={{ texpath }}/KIT/arial creates={{ texpath }}/KIT/arial
# become: yes
#
# - name: create missing directories
# 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
# become: yes
# notify:
# - update latex local
# - update fonts
# - update latex
#
# - name: move afm, tfm, type1, vf dirs
# copy: src={{ item }} dest={{ texpath }}/fonts/{{ item }}/arial
# with_items:
# - afm
# - tfm
# - type1
# - vf
# become: yes
# notify:
# - update latex local
# - update fonts
# - update latex
#
# - name: copy latex dir
# copy: src=latex dest={{ texpath }}/tex/latex/ua1
# become: yes
# notify:
# - update latex local
# - update fonts
# - update latex
#
# - name: copy map dir
# copy: src={{ 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"}
# become: yes
# notify:
# - update latex local
# - update fonts
# - update latex
#
# - name: copy docu 1/2
# copy: src={{ item }} dest={{ texpath }}/doc/fonts/urw
# with_items:
# - doc
# - README
# become: yes
......@@ -5,32 +5,34 @@
changed_when: gnff_available.rc != 0
ignore_errors: yes
- 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: Download common MS fonts
become: yes
get_url:
dest: /tmp/
url: https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts
dest: "{{ texpath }}"
url: "https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts"
mode: 0777
register: tex_fonts_dl_ok
when: gnff_available.changed
- name: Install getnonfreefonts
become: yes
environment:
PATH: "{{ lookup('env', 'PATH') }}"
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
command: "{{ texpath }}/install-getnonfreefonts"
args:
creates: /usr/local/bin/getnonfreefonts
- name: Install all TeX fonts
become: yes
environment:
PATH: "{{ lookup('env', 'PATH') }}"
become: yes
command: sudo su -c "/usr/local/bin/getnonfreefonts-sys -a"
when: all_fonts.changed
......@@ -41,10 +43,5 @@
command: sudo su -c "/usr/local/bin/getnonfreefonts-sys -r"
when: all_fonts.changed
- name: cleanup
file:
state: absent
dest: "/tmp/{{ item }}"
with_items:
- install-getnonfreefonts
when: gnff_downloaded.changed
- name: flush handlers
meta: flush_handlers
---
# Install LaTeX and KIT classes on host
# not tested yet
# Install LaTeX
- name: Install Fedora's LaTeX
become: yes
dnf:
name: texlive
state: present
state: installed
when: ansible_distribution == "Fedora"
tags: latex
- name: Install LaTeX subpackages
become: yes
dnf:
name: "{{ item }}"
state: present
state: installed
with_items: "{{ texlivepackages }}"
when: ansible_distribution == "Fedora"
# - name: profile.d (for TL {{tlyear}})
# copy: src=latex.sh dest=/etc/profile.d/latex.sh owner=root group=root mode=744
# become: yes
# tags: latex
# register: latexsh
#
# - name: run latex.sh (for TL {{tlyear}})
# action: shell bash /etc/profile.d/latex.sh
# become: yes
# tags: latex
# notify: update latex
# when: latexsh|changed
---
- 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
---
- name: create tex dir
become: yes
file:
path: "{{ texpath }}/tex/latex"
state: directory
- name: Install DPG-Tagungen document class
become: yes
copy:
src: scdpg.cls
dest: "{{ texpath }}/tex/latex/"
notify: hash latex
notify:
- hash latex
tags: latex
- name: Install JACoW-Tagungen document class
......@@ -12,5 +19,6 @@
copy:
src: jacow.cls
dest: "{{ texpath }}/tex/latex/"
notify: hash latex
notify:
- hash latex
tags: latex
......@@ -2,7 +2,7 @@
- name: create destination directories
become: yes
file:
path: "/usr/share/texlive/texmf-local/{{ item }}/latex/uniinput"
path: "{{ texpath }}/{{ item }}/latex/uniinput"
state: directory
mode: 0755
with_items:
......@@ -25,12 +25,16 @@
chdir: /tmp
creates: /tmp/uniinput.pdf
ignore_errors: yes
when: uniinputdir.changed
register: pdf_file
- name: compile package
command: latex uniinput.ins
args:
chdir: /tmp
creates: /tmp/uniinput.sty
when: uniinputdir.changed
register: sty_file
- name: move style to LaTeX dir
become: yes
......@@ -39,6 +43,7 @@
dest: "{{ texpath }}/tex/latex/uniinput/uniinput.sty"
remote_src: yes
notify: update latex
when: sty_file is defined and sty_file.changed
- name: move docu to LaTeX dir
become: yes
......@@ -47,3 +52,4 @@
dest: "{{ texpath }}/doc/latex/uniinput/uniinput.pdf"
remote_src: yes
notify: update latex
when: pdf_file is defined and pdf_file.changed
---
kit_tex:
- audit_fgh_z_10_rgb_7.jpg
- audit_fgh_z_10_rgb_7_mask.jpg
- audit_fgh_z_10_sw_7.jpg
- audit_fgh_z_10_sw_7_mask.jpg
- beamercolorthemeKIT.sty
- beamerfontthemeKIT.sty
- beamerinnerthemeKIT.sty
- beamerouterthemeKIT.sty
- beamerthemeKIT.sty
- KIT16.clo
- KIT18.clo
- KIT20.clo
- KIT22.clo
- KIT24.clo
- KITbrief.cls
- KITcolors.sty
- KITdefs.sty
- KITfax.cls
- kit_logo_de_1c_schwarz.pdf
- kit_logo_de_4c_positiv.pdf
- kit_logo_de_4c_positiv-rgb.pdf
- kit_logo_en_1c_schwarz.pdf
- kit_logo_en_4c_positiv.pdf
- kit_logo_en_4c_positiv-rgb.pdf
- KITmcfloat.sty
- KITposter.cls
- papera4.cfg
- paperb4.cfg
kit_doc:
- KITmanualD.pdf
- KITmanualE.pdf
......@@ -71,7 +71,7 @@
line: "# add_executable (NAFF main_NAFF.cpp ${SOURCE_FILES} ${HEADER_FILES})"
regexp: "add_executable.*"
path: /tmp/NAFF_cpp/CMakeLists.txt
- name: build
command: cmake ..
args:
......@@ -90,5 +90,5 @@
src: /tmp/NAFF_cpp/NAFF.so
dest: /usr/lib/python2.7/site-packages/NAFF.so
backup: yes
remote_src: True
remote_src: yes
when: not_there.rc == 1
......@@ -10,7 +10,7 @@
copy:
src: /mnt/las-archiv1/system/Opera/18/Opera_RHEL7.tar.bz
dest: /tmp
remote_src: True
remote_src: yes
when: stat_result.stat.exists == False
- name: unzip Opera
......@@ -51,7 +51,7 @@
copy:
src: "/mnt/las-archiv1/system/Opera/18/CentOS7libs/{{ item.src }}"
dest: "{{ opera_path }}/CentOS7libs/{{ item.dest }}"
remote_src: True
remote_src: yes
with_items:
- { dest: 'libicui18n.so.50', src: 'libicui18n.so.50.1.2' }
- { dest: 'libicuuc.so.50', src: 'libicuuc.so.50.1.2' }
......
---
- name: check if PyCharm is installed
stat:
path: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}"
register: pycharm_installation
- name: create temporary download directory
tempfile:
state: directory
register: tmpdir
when: not (pycharm_installation.stat.isdir is defined and pycharm_installation.stat.isdir)
- name: download PyCharm
get_url:
url: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz"
dest: "{{ tmpdir.path }}/pycharm.tar.gz"
when: tmpdir.changed
- name: Create directory
- name: create directory
become: yes
file:
path: /usr/local/pycharm
state: directory
- name: Unarchive
- name: unarchive
become: yes
unarchive:
src: /tmp/pycharm.tar.gz
src: "https://download-cf.jetbrains.com/python/{{ pycharm_name }}.tar.gz"
dest: /usr/local/pycharm
remote_src: yes
creates: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}"
- name: Link PyCharm
- name: link PyCharm
become: yes
file:
mode: o+rx
......@@ -38,7 +21,7 @@
src: "/usr/local/pycharm/{{ pycharm_name | regex_replace('-professional') }}/bin/pycharm.sh"
state: link
- name: Add Desktop-icon
- name: add Desktop-icon
template:
src: PyCharm.desktop.j2
dest: "/home/{{ user_account }}/Desktop/PyCharm.desktop"
......
......@@ -15,8 +15,8 @@
#- import_playbook: update.yml
- import_playbook: desktop.yml
tags: admin
#- import_playbook: latex.yml
# tags: latex
- import_playbook: latex.yml
tags: latex
- import_playbook: kdev.yml
tags: kdev
- import_playbook: pycharm.yml
......
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