src.dualinventive.com/devops/ansible/roles/development/tasks/texlive.yml

50 lines
1.6 KiB
YAML

- include_vars: texlive.yml
- name: Create texlive base directory
file: path={{ base }} state=directory owner=root group=root mode=0755
- name: Check if installation exists
stat: path={{ path }}
register: texlive
ignore_errors: yes
- name: Install texlive profile
template: src=di-texlive.profile.j2 dest={{ base }}/di-texlive.profile mode=0644 owner=root group=root
- name: Create directory for mount
file: path=/home/ansible/texlive-installer state=directory owner=root group=root mode=0755
when: texlive.stat.exists == False
- name: Check if iso file is already downloaded exists
stat: path=/home/ansible/{{ archive }}
when: texlive.stat.exists == False
register: texlive_dl
- name: Download texlive iso
get_url:
checksum="{{ checksum }}"
url="{{ url }}"
dest="/home/ansible/{{ archive }}"
tmp_dest=/home/ansible/
when:
- texlive.stat.exists == False
- texlive_dl.stat.exists == False
- name: Mount texlive iso
mount: name=/home/ansible/texlive-installer src=/home/ansible/{{ archive }} fstype=iso9660 opts=ro,loop,noauto state=mounted
when: texlive.stat.exists == False
- command: bash -c "cd /home/ansible/texlive-installer && ./install-tl -profile={{ base }}/di-texlive.profile"
when: texlive.stat.exists == False
- name: Verify installation
stat: path={{ path }}
register: texlive_install
when: texlive.stat.exists == False
- name: Unmount texlive iso
mount: name=/home/ansible/texlive-installer src=/home/ansible/{{ archive }} fstype=iso9660 opts=ro,loop,noauto state=absent
- name: Remove texlive iso
file: path=/home/ansible/{{ archive }} state=absent