-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b23d47
commit 1a03238
Showing
4 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,62 @@ | ||
--- | ||
- include_role: | ||
- name: Install unarchivedeps | ||
ansible.builtin.include_role: | ||
name: andrewrothstein.unarchivedeps | ||
- include_role: | ||
- name: Install temurin | ||
ansible.builtin.include_role: | ||
name: andrewrothstein.temurin | ||
vars: | ||
openjdk_app: jdk | ||
- name: check for spark installation | ||
- name: Check for spark installation at {{ spark_target_dir }} | ||
become: true | ||
stat: | ||
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 }} | ||
- name: Downloading spark from {{ spark_url }} | ||
become: true | ||
become_user: root | ||
get_url: | ||
ansible.builtin.get_url: | ||
url: '{{ spark_url }}' | ||
dest: '{{ spark_tmp_tgz }}' | ||
mode: 0644 | ||
mode: '644' | ||
checksum: '{{ spark_checksum }}' | ||
timeout: '{{ spark_timeout }}' | ||
- name: unarchive {{ spark_tmp_tgz }} | ||
- name: Unarchive {{ spark_tmp_tgz }} | ||
become: true | ||
become_user: root | ||
unarchive: | ||
ansible.builtin.unarchive: | ||
remote_src: true | ||
dest: '{{ spark_parent_dir }}' | ||
src: '{{ spark_tmp_tgz }}' | ||
creates: '{{ spark_target_dir }}' | ||
always: | ||
- name: rm {{ spark_tmp_tgz }} | ||
- name: Rm {{ spark_tmp_tgz }} | ||
become: true | ||
become_user: root | ||
file: | ||
ansible.builtin.file: | ||
path: '{{ spark_tmp_tgz }}' | ||
state: absent | ||
- name: linking {{ spark_link_dir }} to {{ spark_target_dir }} | ||
- name: Linking {{ spark_link_dir }} to {{ spark_target_dir }} | ||
become: true | ||
become_user: root | ||
file: | ||
ansible.builtin.file: | ||
src: '{{ spark_target_dir }}' | ||
dest: '{{ spark_link_dir }}' | ||
state: link | ||
- name: include spark in the default path... | ||
- name: Include spark in the default login path... | ||
become: true | ||
become_user: root | ||
with_items: | ||
- f: spark.sh | ||
d: /etc/profile.d | ||
m: '0644' | ||
m: '644' | ||
- f: spark.env | ||
d: '{{ spark_target_dir }}' | ||
m: '0644' | ||
template: | ||
m: '644' | ||
ansible.builtin.template: | ||
src: '{{ item.f }}.j2' | ||
dest: '{{ item.d }}/{{ item.f }}' | ||
mode: '{{ item.m }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
SPARK_HOME={{spark_parent_dir}}/spark | ||
{% if spark_envs is defined %}{% for key, value in spark_envs.iteritems() %} | ||
{{key}}={{value}} | ||
{% endfor %}{% endif %} | ||
SPARK_HOME={{ spark_parent_dir }}/spark | ||
{% if spark_envs is defined -%} | ||
{%- for key, value in spark_envs | dictsort -%} | ||
{{ key }}={{ value }} | ||
{% endfor -%} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export SPARK_HOME={{spark_parent_dir}}/spark | ||
export SPARK_HOME={{ spark_parent_dir }}/spark | ||
export PATH=$PATH:$SPARK_HOME/bin | ||
{% if spark_envs is defined %}{% for key, value in spark_envs.iteritems() %} | ||
export {{key}}={{value}} | ||
{% endfor %}{% endif %} | ||
{% if spark_envs is defined -%} | ||
{%- for key, value in spark_envs | dictsort -%} | ||
export {{ key }}={{ value }} | ||
{% endfor -%} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
spark_name: spark-{{spark_ver}} | ||
spark_hadoop_name: '{{spark_name}}-bin-{{spark_hadoop_ver}}' | ||
spark_tgz: '{{spark_hadoop_name}}.tgz' | ||
spark_tmp_tgz: /tmp/{{ spark_tgz }} | ||
spark_name: spark-{{ spark_ver }} | ||
spark_hadoop_name: '{{ spark_name }}-bin-{{ spark_hadoop_ver }}' | ||
spark_tgz: '{{ spark_hadoop_name }}.tgz' | ||
spark_tmp_tgz: /tmp/{{ spark_tgz }} | ||
|
||
spark_url: '{{spark_mirror_url}}/{{spark_name}}/{{spark_tgz}}' | ||
spark_checksum: '{{spark_checksums[spark_ver][spark_hadoop_ver]}}' | ||
spark_url: '{{ spark_mirror_url }}/{{ spark_name }}/{{ spark_tgz }}' | ||
spark_checksum: '{{ spark_checksums[spark_ver][spark_hadoop_ver] }}' | ||
|
||
spark_target_dir: '{{spark_parent_dir}}/{{spark_hadoop_name}}' | ||
spark_link_dir: '{{spark_parent_dir}}/spark' | ||
spark_target_dir: '{{ spark_parent_dir }}/{{ spark_hadoop_name }}' | ||
spark_link_dir: '{{ spark_parent_dir }}/spark' |