mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-16 01:43:06 -06:00
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
---
|
|
|
|
- name: install jdk via tzg if atl_jdk_tgz_url set
|
|
block:
|
|
- name: ensure /usr/lib/jvm exists
|
|
ansible.builtin.file:
|
|
path: "/usr/lib/jvm"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: fetch jdk via tgz to /tmp
|
|
ansible.builtin.get_url:
|
|
url: "{{ atl_jdk_tgz_url }}"
|
|
dest: "/tmp/"
|
|
mode: 0755
|
|
force: true
|
|
timeout: 600
|
|
register: atl_tgz_completed
|
|
|
|
- name: Unpack the product packages to like /usr/lib/jvm/jdk-something
|
|
ansible.builtin.unarchive:
|
|
remote_src: true
|
|
src: "/tmp/{{ atl_jdk_tgz | basename }}"
|
|
dest: "/usr/lib/jvm"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: 0755
|
|
# extra_opts:
|
|
# creates: "/usr/lib/jvm/jdk-something"
|
|
|
|
- name: Find /var/log all directories, exclude nginx and mysql
|
|
ansible.builtin.find:
|
|
paths: "/usr/lib/jvm"
|
|
patterns: 'jdk*'
|
|
recurse: no
|
|
file_type: directory
|
|
register: atl_tgz_unpacked
|
|
|
|
|
|
- name: Ensure common JDK symlink exists
|
|
community.general.alternatives:
|
|
link: "/usr/lib/jvm/java"
|
|
name: "java_sdk"
|
|
path: "{{ atl_tgz_unpacked.files[0].path }}"
|
|
priority: 99
|
|
|
|
when: atl_jdk_tgz_url
|
|
|
|
- name: Add Adoptium repo and install Eclipse Temurin JDK if necessary on Amazon Linux
|
|
block:
|
|
|
|
- name: Add Adoptium yum repository
|
|
ansible.builtin.yum_repository:
|
|
name: Adoptium
|
|
file: adoptium
|
|
description: Adoptium Repo
|
|
baseurl: "https://packages.adoptium.net/artifactory/rpm/amazonlinux/{{ ansible_distribution_version }}/{{ ansible_architecture }}"
|
|
gpgkey: https://packages.adoptium.net/artifactory/api/gpg/key/public
|
|
gpgcheck: yes
|
|
state: present
|
|
|
|
- name: Install Eclipse Temurin JDK
|
|
ansible.builtin.yum:
|
|
name: "temurin-{{ java_major_version }}-jdk"
|
|
state: present
|
|
vars:
|
|
ansible_python_interpreter: /usr/bin/python2
|
|
|
|
- name: Ensure common JDK symlink exists
|
|
community.general.alternatives:
|
|
link: "/usr/lib/jvm/java"
|
|
name: "java_sdk"
|
|
path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk"
|
|
priority: 99
|
|
|
|
when:
|
|
- atl_use_system_jdk | bool
|
|
- not atl_jdk_tgz_url
|
|
tags:
|
|
- runtime_pkg
|
|
|
|
- name: Install other base packages on Amazon Linux
|
|
ansible.builtin.yum:
|
|
name:
|
|
- dejavu-fonts-common # Required by the installer
|
|
vars:
|
|
ansible_python_interpreter: /usr/bin/python2
|