Files
dc-deployments-automation/roles/product_common/tasks/ubuntu.yml
Lee Goolsbee 529df0cafd fix tests
2020-08-27 11:49:27 -05:00

58 lines
1.6 KiB
YAML

---
- name: Add AdoptOpenJDK repo and install if necessary on Ubuntu
block:
- name: Create translation matrix for ansible_architecture values to Ubuntu/Debian nomenclature
set_fact:
debian_architecture_translations:
x86_64: amd64
aarch64: arm64
- name: Set debian_architecture based on ansible_architecture
set_fact:
debian_architecture: >-
{%- if ansible_architecture in debian_architecture_translations -%}
{{ debian_architecture_translations[ansible_architecture] }}
{%- else -%}
{{ ansible_architecture }}
{%- endif %}
- name: Install gnupg
apt:
name: gnupg
state: present
- name: Add AdoptOpenJDK debian repo public key
apt_key:
url: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
state: present
- name: Add AdoptOpenJDK debian repository
apt_repository:
repo: "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb {{ ansible_distribution_release }} main"
state: present
filename: adoptopenjdk
- name: Install AdoptOpenJDK
apt:
name: "adoptopenjdk-{{ java_major_version }}-hotspot"
update_cache: yes
state: present
- name: Ensure common JDK symlink exists
alternatives:
link: "/usr/lib/jvm/java"
name: "java_sdk"
path: "/usr/lib/jvm/adoptopenjdk-{{ java_major_version }}-hotspot-{{ debian_architecture }}"
priority: 99
when: atl_use_system_jdk
tags:
- runtime_pkg
- name: Install other base packages on Ubuntu
package:
name:
- fonts-dejavu-core # Required by installer