Ansible Playbook to install OpenJDK JRE

---
- name: Install OpenJDK
  hosts: all
  become: true
  tasks:
    - name: Update apt cache
      apt:
        update_cache: yes
        cache_valid_time: 3600

    - name: Install OpenJDK
      apt:
        name: openjdk-11-jdk
        state: present

    - name: Verify Java installation
      command: java -version
      register: java_version
      changed_when: false