Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon linux #143

Merged
merged 15 commits into from
Feb 5, 2024
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- ubuntu2004
- debian12
- debian11
- amazonlinux2023

steps:
- name: Check out the codebase.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/geerlingguy/ansible-role-java/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-java/actions?query=workflow%3ACI)

Installs Java for RedHat/CentOS and Debian/Ubuntu linux servers.
Installs Java for RedHat/CentOS, Amazon and Debian/Ubuntu linux servers.

## Requirements

Expand Down
9 changes: 8 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
include_vars: "{{ ansible_distribution }}.yml"
when: ansible_distribution == 'FreeBSD' or ansible_distribution == 'Fedora'

- name: Include OS-specific variables for Amazon.
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version}}.yml"
when: ansible_distribution == 'Amazon'

- name: Include version-specific variables for CentOS/RHEL.
include_vars: "RedHat-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: >-
Expand Down Expand Up @@ -30,7 +34,10 @@

# Setup/install tasks.
- include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat' and ansible_distribution_file_variety == 'RedHat'

- include_tasks: setup-Amazon.yml
when: ansible_distribution == 'Amazon'

- include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian'
Expand Down
5 changes: 5 additions & 0 deletions tasks/setup-Amazon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Ensure Java is installed.
package:
name: "{{ java_packages }}"
state: present
8 changes: 8 additions & 0 deletions vars/Amazon-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# JDK version options include:
# - java-1.7.0-openjdk
# - java-1.8.0-openjdk
# - java-11-amazon-corretto
# - java-17-amazon-corretto
__java_packages:
- java-17-amazon-corretto
8 changes: 8 additions & 0 deletions vars/Amazon-2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# JDK version options include:
# - java-1.8.0-openjdk
# - java-11-amazon-corretto
# - java-17-amazon-corretto
# - java-21-amazon-corretto
__java_packages:
- java-11-amazon-corretto