ansible-role-openjdk/tasks/openjdk_el.yml

25 lines
656 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
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' ]