ansible-role-openjdk/tasks/openjdk_el.yml

28 lines
754 B
YAML

---
- block:
- name: Install the OpenJDK packages
yum: pkg=java-{{ item.0 }}-{{ item[1] }} state={{ openjdk_pkg_state }}
with_nested:
- '{{ openjdk_el_version }}'
- '{{ openjdk_el_pkgs }}'
#notify: Set the default OpenJDK
- name: Set fact jdk_installed
set_fact: jdk_installed=true
- name: Set the correct jdk_home variable
set_fact: jdk_java_home='/usr/lib/jvm/java'
when: openjdk_install | bool
tags: [ 'jdk', 'openjdk' ]
- block:
- name: Remove the OpenJDK packages
yum: pkg=java-{{ item.0 }}-{{ item[1] }} state=absent
with_nested:
- '{{ openjdk_el_version }}'
- '{{ openjdk_el_pkgs }}'
when: not openjdk_install | bool
tags: [ 'jdk', 'openjdk' ]