-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.yml
62 lines (62 loc) · 1.69 KB
/
main.yml
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
---
- name: Install unarchivedeps
ansible.builtin.include_role:
name: andrewrothstein.unarchivedeps
- name: Install temurin
ansible.builtin.include_role:
name: andrewrothstein.temurin
vars:
openjdk_app: jdk
- name: Check for spark installation at {{ spark_target_dir }}
become: true
ansible.builtin.stat:
path: '{{ spark_target_dir }}'
changed_when: false
register: spark_binary
- when: not spark_binary.stat.exists
block:
- name: Downloading spark from {{ spark_url }}
become: true
become_user: root
ansible.builtin.get_url:
url: '{{ spark_url }}'
dest: '{{ spark_tmp_tgz }}'
mode: '644'
checksum: '{{ spark_checksum }}'
timeout: '{{ spark_timeout }}'
- name: Unarchive {{ spark_tmp_tgz }}
become: true
become_user: root
ansible.builtin.unarchive:
remote_src: true
dest: '{{ spark_parent_dir }}'
src: '{{ spark_tmp_tgz }}'
creates: '{{ spark_target_dir }}'
always:
- name: Rm {{ spark_tmp_tgz }}
become: true
become_user: root
ansible.builtin.file:
path: '{{ spark_tmp_tgz }}'
state: absent
- name: Linking {{ spark_link_dir }} to {{ spark_target_dir }}
become: true
become_user: root
ansible.builtin.file:
src: '{{ spark_target_dir }}'
dest: '{{ spark_link_dir }}'
state: link
- name: Include spark in the default login path...
become: true
become_user: root
with_items:
- f: spark.sh
d: /etc/profile.d
m: '644'
- f: spark.env
d: '{{ spark_target_dir }}'
m: '644'
ansible.builtin.template:
src: '{{ item.f }}.j2'
dest: '{{ item.d }}/{{ item.f }}'
mode: '{{ item.m }}'