centos.yml 1.52 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
---
# tasks file for mathematica
- name: install S3 requirements
  become: yes
  yum:
    state: latest
    pkg:
      - unzip
      - python-boto.noarch
      - python-boto3.noarch
      - python2-botocore.noarch

- name: check that {{ mathematica_install_version }}.zip is not already downloaded
  stat:
    path: "/tmp/{{ mathematica_versions[mathematica_install_version]['url'] }}"
  register: mathematica_bundle

- name: Create matlab folder
  file:
    path: "{{ tmp_mathematica }}"
    state: directory
    mode: "0755"

- name: Download {{ mathematica_install_version }}.zip
  amazon.aws.aws_s3:
    access_key: "{{ aws_access_key }}"
    secret_key: "{{ aws_secret_key }}"
    bucket: 10282-70726cc2c34fcfe7d4325ef7ea151411
    object: "/{{ mathematica_versions[mathematica_install_version]['url'] }}"
    dest: "{{ tmp_mathematica }}/{{ mathematica_versions[mathematica_install_version]['url'] }}"
    mode: get
    s3_url: https://s3.epfl.ch/
    validate_certs: no
  when: mathematica_bundle.stat.exists == false

- name: Unzip {{ mathematica_install_version }}.zip
  unarchive:
    dest: /tmp
    src: "{{ tmp_mathematica }}/{{ mathematica_versions[mathematica_install_version]['url'] }}"
    remote_src: yes
    extra_opts:
      - -P
      - "{{ mathematica_versions[mathematica_install_version]['password'] }}"

- name: make mathematica installer executable
  file:
    path: "/tmp/{{ mathematica }}"
    mode: "+x"

- name: silently install mathematica
  become: yes
  command:
    cmd: "./{{ mathematica }} -- -silent"
    chdir: "/tmp"