Here below is ansible playbook to install Open JDK 8 on Ubuntu:
---
- hosts: Java_Group
tasks:
- name: Update APT package manager repositories cache
become: true
apt:
update_cache: yes
- name: Install OpenJDK Java
become: yes
apt:
name: "{{ item }}"
state: present
with_items:
openjdk-8-jdk
---
- hosts: Java_Group
tasks:
- name: Update APT package manager repositories cache
become: true
apt:
update_cache: yes
- name: Install OpenJDK Java
become: yes
apt:
name: "{{ item }}"
state: present
with_items:
openjdk-8-jdk