agaric-coop/box/provisioning/roles/geerlingguy.java/tasks/main.yml

38 lines
1.1 KiB
YAML

---
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
when: ansible_distribution != 'Ubuntu' or ansible_distribution != 'Fedora'
- name: Include OS-specific variables for Fedora.
include_vars: "{{ ansible_distribution }}.yml"
when: ansible_distribution == 'Fedora'
- name: Include version-specific variables for Ubuntu.
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
when: ansible_distribution == 'Ubuntu'
- name: Define java_packages.
set_fact:
java_packages: "{{ __java_packages | list }}"
when: java_packages is not defined
# Setup/install tasks.
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
static: no
- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
static: no
- include: setup-FreeBSD.yml
when: ansible_os_family == 'FreeBSD'
static: no
# Environment setup.
- name: Set JAVA_HOME if configured.
template:
src: java_home.sh.j2
dest: /etc/profile.d/java_home.sh
mode: 0644
when: java_home is defined and java_home != ''