Skip to content

Commit

Permalink
Merge pull request geerlingguy#143 from samh241/AmazonLinux
Browse files Browse the repository at this point in the history
Amazon linux
  • Loading branch information
geerlingguy authored Feb 5, 2024
2 parents 31f332e + a5dd009 commit 6d160a4
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
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

0 comments on commit 6d160a4

Please sign in to comment.