forked from codio/stacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add java 17 * new line
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
- hosts: 127.0.0.1 | ||
become: true | ||
tasks: | ||
|
||
- name: Add Repository Key by ID | ||
apt_key: | ||
id: "0xB1998361219BD9C9" | ||
keyserver: "keyserver.ubuntu.com" | ||
state: present | ||
|
||
- name: Ensure the zulu apt repository is present | ||
apt_repository: | ||
repo: 'deb https://repos.azul.com/zulu/deb stable main' | ||
state: present | ||
|
||
- name: Install java 17 | ||
apt: | ||
name: zulu17 | ||
state: latest | ||
update_cache: true | ||
|
||
- name: correct java version selected | ||
alternatives: | ||
name: java | ||
path: /usr/lib/jvm/zulu17-ca-amd64/bin/java | ||
|
||
- name: Install Maven | ||
apt: name=maven state=present | ||
|
||
- name: Install zip and unzip | ||
apt: | ||
name: | ||
- zip | ||
- unzip | ||
state: present | ||
|
||
- name: Ensure gradle directory exists | ||
file: | ||
path: /opt/gradle | ||
state: directory | ||
|
||
- name: Download and install Gradle | ||
unarchive: | ||
src: https://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
dest: /opt/gradle | ||
remote_src: yes | ||
|
||
- name: Setup environment variables | ||
shell: | | ||
echo "export GRADLE_HOME=/opt/gradle/gradle-8.1.1 | ||
export PATH=\${GRADLE_HOME}/bin:\${PATH}" > /etc/profile.d/gradle.sh | ||
- name: Make the script executable | ||
shell: chmod +x /etc/profile.d/gradle.sh | ||
- name: Load the environment variables | ||
shell: source /etc/profile.d/gradle.sh | ||
args: | ||
executable: /bin/bash |