Skip to content

Commit

Permalink
Add java 17 (codio#14)
Browse files Browse the repository at this point in the history
* Add java 17

* new line
  • Loading branch information
ksimuk authored Jul 10, 2023
1 parent 6c45ad0 commit 0dc32b9
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions java17/playbook.yaml
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

0 comments on commit 0dc32b9

Please sign in to comment.