diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index 4f8cb77..9db7661 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -35,12 +35,11 @@ atl_product_installation_current: "{{ atl_product_installation_base }}/current" atl_installer_temp: "{{ atl_installation_base }}/tmp" # NOTE: If using the non-installer java we expect to have the full JDK -# installed and linked to `/usr/lib/jvm/java` and # `/usr/lib/jvm/jre`. +# installed and linked to `/usr/lib/jvm/java`. # See product_common/task/ubuntu.yml for an example of apropriate # linking using `alternatives`. atl_java_home: "{{ '/usr/lib/jvm/java' if atl_use_system_jdk else (atl_product_installation_current + '/jre') }}" -atl_jre_home: "{{ '/usr/lib/jvm/jre' if atl_use_system_jdk else atl_java_home }}" -atl_java_binary: "{{ atl_jre_home }}/bin/java" +atl_java_binary: "{{ atl_java_home }}/bin/java" atl_product_logs_default: &logs_default - path: "{{ atl_product_installation_current }}/logs/*" diff --git a/roles/confluence_config/defaults/main.yml b/roles/confluence_config/defaults/main.yml index 4bd4d10..d39d683 100644 --- a/roles/confluence_config/defaults/main.yml +++ b/roles/confluence_config/defaults/main.yml @@ -2,9 +2,7 @@ atl_jvm_heap: "2048m" atl_fonts_fallback_dirs: - - "{{ atl_java_home }}/lib/fonts/fallback/" - - "{{ atl_jre_home }}/lib/fonts/fallback/" - + - "{{ atl_java_home }}/lib/fonts/fallback/" atl_autologin_cookie_age: "{{ lookup('env', 'ATL_AUTOLOGIN_COOKIE_AGE') }}" diff --git a/roles/confluence_config/molecule/default/tests/test_default.py b/roles/confluence_config/molecule/default/tests/test_default.py index d3ff80e..337240b 100644 --- a/roles/confluence_config/molecule/default/tests/test_default.py +++ b/roles/confluence_config/molecule/default/tests/test_default.py @@ -81,8 +81,7 @@ def test_confluence_config_file(host): assert f.contains('select 1;') @pytest.mark.parametrize('font', [ -# '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf', -# '/usr/lib/jvm/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf' +# '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf' '/opt/atlassian/confluence/current/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf' ]) def test_fonts_installed_and_linked(host, font): diff --git a/roles/confluence_config/molecule/system_jdk/tests/test_default.py b/roles/confluence_config/molecule/system_jdk/tests/test_default.py index 7cb395e..600b059 100644 --- a/roles/confluence_config/molecule/system_jdk/tests/test_default.py +++ b/roles/confluence_config/molecule/system_jdk/tests/test_default.py @@ -12,8 +12,7 @@ def test_seraph_file(host): assert f.contains('COOKIEAGE') @pytest.mark.parametrize('font', [ - '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf', - '/usr/lib/jvm/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf' + '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf' ]) def test_fonts_installed_and_linked(host, font): f = host.file(font) diff --git a/roles/confluence_config/tasks/amazon_fonts.yml b/roles/confluence_config/tasks/amazon_fonts.yml index 4fc5302..8fa2bda 100644 --- a/roles/confluence_config/tasks/amazon_fonts.yml +++ b/roles/confluence_config/tasks/amazon_fonts.yml @@ -5,8 +5,8 @@ name: - "google-noto-*" -- name: Link the language fonts into the JDK/JRE - # Not idiomatic, but cleaner that messing with nested lookups... +- name: Link the language fonts into the JDK + # Not idiomatic, but cleaner than messing with nested lookups... shell: cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/" creates: "{{ item }}/NotoSansJavanese-Regular.ttf" diff --git a/roles/confluence_config/tasks/main.yml b/roles/confluence_config/tasks/main.yml index 07b202c..ea807bb 100644 --- a/roles/confluence_config/tasks/main.yml +++ b/roles/confluence_config/tasks/main.yml @@ -52,7 +52,6 @@ insertafter: "EOF" line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"' - - name: Configure login properties template: src: seraph-config.xml.j2 diff --git a/roles/confluence_config/tasks/ubuntu_fonts.yml b/roles/confluence_config/tasks/ubuntu_fonts.yml index 084aa3f..20fcbb1 100644 --- a/roles/confluence_config/tasks/ubuntu_fonts.yml +++ b/roles/confluence_config/tasks/ubuntu_fonts.yml @@ -5,8 +5,8 @@ name: - "fonts-noto" -- name: Link the language fonts into the JDK/JRE - # Not idiomatic, but cleaner that messing with nested lookups... +- name: Link the language fonts into the JDK + # Not idiomatic, but cleaner than messing with nested lookups... shell: cmd: "ln -sf /usr/share/fonts/truetype/noto/* {{ item }}/" creates: "{{ item }}/NotoSansJavanese-Regular.ttf" diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index e3b7c72..87aea58 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -148,7 +148,7 @@ xpath: "/application-configuration/properties/property[@name='hibernate.connection.url']" value: "{{ atl_jdbc_url }}?reWriteBatchedInserts=true" when: crowd_cfg_stat_result.stat.exists - + - name: Remove crowd.xml to prevent duplicates from appearing in cluster reporting file: path: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/Catalina/localhost/crowd.xml" diff --git a/roles/product_common/defaults/main.yml b/roles/product_common/defaults/main.yml index 4e9f728..f8a46fd 100644 --- a/roles/product_common/defaults/main.yml +++ b/roles/product_common/defaults/main.yml @@ -5,3 +5,11 @@ postgres_version: "9.6" # Disable these when using the product installer, otherwise we end up # fighting with it. atl_use_system_jdk: false + +# Ubuntu and Ansible use different architecture nomenclature; provide +# an easy method for translating between them +debian_architecture_translations: + x86_64: amd64 + aarch64: arm64 + +debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}" diff --git a/roles/product_common/molecule/system_jdk/tests/test_default.py b/roles/product_common/molecule/system_jdk/tests/test_default.py index e615c9f..39a5436 100644 --- a/roles/product_common/molecule/system_jdk/tests/test_default.py +++ b/roles/product_common/molecule/system_jdk/tests/test_default.py @@ -15,8 +15,7 @@ def test_user_created(host): @pytest.mark.parametrize('exe', [ '/usr/bin/git', '/usr/bin/javac', - '/usr/lib/jvm/java/bin/java', - '/usr/lib/jvm/java/jre/bin/java' + '/usr/lib/jvm/java/bin/java' ]) def test_package_exes(host, exe): assert host.file(exe).exists diff --git a/roles/product_common/tasks/amazon.yml b/roles/product_common/tasks/amazon.yml index 4d33f79..fad01a6 100644 --- a/roles/product_common/tasks/amazon.yml +++ b/roles/product_common/tasks/amazon.yml @@ -1,10 +1,33 @@ --- -- name: Install JDK if necessary on Amazon Linux - yum: - name: - - java-1.{{ java_major_version }}.0-openjdk-devel +- name: Add AdoptOpenJDK repo and install if necessary on Amazon Linux + block: + + - name: Add AdoptOpenJDK yum repository + yum_repository: + name: AdoptOpenJDK + file: adoptopenjdk + description: AdoptOpenJDK Repo + baseurl: "https://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/amazonlinux/{{ ansible_distribution_version }}/{{ ansible_architecture }}/" + gpgkey: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public + gpgcheck: yes + state: present + + - name: Install AdoptOpenJDK + yum: + name: "adoptopenjdk-{{ java_major_version }}-hotspot" + 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" + priority: 99 + when: atl_use_system_jdk + tags: + - runtime_pkg - name: Install other base packages on Amazon Linux yum: diff --git a/roles/product_common/tasks/ubuntu.yml b/roles/product_common/tasks/ubuntu.yml index 0b033c5..c90b6bc 100644 --- a/roles/product_common/tasks/ubuntu.yml +++ b/roles/product_common/tasks/ubuntu.yml @@ -1,25 +1,35 @@ --- -- name: Install JDK if necessary on Ubuntu +- name: Add AdoptOpenJDK repo and install if necessary on Ubuntu block: - - name: Install JDK package - package: - name: - - openjdk-{{ java_major_version }}-jdk-headless + - 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/java-8-openjdk-amd64" - priority: 99 - - - name: Ensure common JRE symlink exists - alternatives: - link: "/usr/lib/jvm/jre" - name: "jre" - path: "/usr/lib/jvm/java-8-openjdk-amd64/jre" + path: "/usr/lib/jvm/adoptopenjdk-{{ java_major_version }}-hotspot-{{ debian_architecture }}" priority: 99 when: atl_use_system_jdk