From 7087ad93ac4f7087ecdf38145207f35373142483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez?= Date: Tue, 18 Aug 2020 14:37:01 +0200 Subject: [PATCH 01/26] #63 Exclude test paths from linter --- .ansible-lint | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ansible-lint b/.ansible-lint index 0c01e2b..3a1ecf1 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,3 +1,7 @@ --- rules: line-length: disable +exclude_paths: + - molecule/adoptopenjdk/tests + - molecule/corretto/tests + - molecule/default/tests \ No newline at end of file From 29b1329c1849a517ac654eb1ea7583661ed9bd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez?= Date: Tue, 18 Aug 2020 15:00:06 +0200 Subject: [PATCH 02/26] #63 Set changed_when to false when tasks do not change host state. --- molecule/adoptopenjdk/verify.yml | 2 ++ molecule/corretto/verify.yml | 2 ++ molecule/default/verify.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/molecule/adoptopenjdk/verify.yml b/molecule/adoptopenjdk/verify.yml index 73660a1..73c8e06 100644 --- a/molecule/adoptopenjdk/verify.yml +++ b/molecule/adoptopenjdk/verify.yml @@ -39,12 +39,14 @@ - name: Register test files shell: "ls {{ goss_test_directory }}/test_*.yml" register: test_files + changed_when: false - name: Execute Goss tests command: "goss -g {{ item }} validate --format {{ goss_format }}" register: test_results with_items: "{{ test_files.stdout_lines }}" ignore_errors: true + changed_when: false - name: Display details about the goss results debug: diff --git a/molecule/corretto/verify.yml b/molecule/corretto/verify.yml index 73660a1..73c8e06 100644 --- a/molecule/corretto/verify.yml +++ b/molecule/corretto/verify.yml @@ -39,12 +39,14 @@ - name: Register test files shell: "ls {{ goss_test_directory }}/test_*.yml" register: test_files + changed_when: false - name: Execute Goss tests command: "goss -g {{ item }} validate --format {{ goss_format }}" register: test_results with_items: "{{ test_files.stdout_lines }}" ignore_errors: true + changed_when: false - name: Display details about the goss results debug: diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 512585e..4d44708 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -61,12 +61,14 @@ - name: Register test files shell: "ls {{ goss_test_directory }}/test_*.yml" register: test_files + changed_when: false - name: Execute Goss tests command: "goss -g {{ item }} validate --format {{ goss_format }}" register: test_results with_items: "{{ test_files.stdout_lines }}" ignore_errors: true + changed_when: false - name: Display details about the goss results debug: From a14686f5ebb4505e1b8ba30226249ec4f0add951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez?= Date: Wed, 19 Aug 2020 08:21:40 +0200 Subject: [PATCH 03/26] Add newline at the end of .ansible-lint --- .ansible-lint | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ansible-lint b/.ansible-lint index 3a1ecf1..a274ee6 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -4,4 +4,5 @@ rules: exclude_paths: - molecule/adoptopenjdk/tests - molecule/corretto/tests - - molecule/default/tests \ No newline at end of file + - molecule/default/tests + \ No newline at end of file From 6f8c0882e89dc59aa556a0bf56452e5ff84dc80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez?= Date: Wed, 19 Aug 2020 11:22:10 +0200 Subject: [PATCH 04/26] #136 Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea5b627..854e636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) +- *[#63](https://github.com/idealista/java_role/issues/63) Solve Ansible Galaxy Warnings* @vicsufer ## [6.0.0](https://github.com/idealista/java_role/tree/6.0.0) (2020-08-13) [Full Changelog](https://github.com/idealista/java_role/compare/5.2.0...6.0.0) From 6fdab4f21f8d61181d5cc165311badad5570d86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Su=C3=A1rez?= Date: Wed, 19 Aug 2020 11:39:31 +0200 Subject: [PATCH 05/26] #136 Add changes to fixed section of changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 854e636..81b0f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) +### Fixed - *[#63](https://github.com/idealista/java_role/issues/63) Solve Ansible Galaxy Warnings* @vicsufer ## [6.0.0](https://github.com/idealista/java_role/tree/6.0.0) (2020-08-13) From 06e3bc3dbf0bbecaabfc05b0b01ed7efcf465624 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Tue, 1 Sep 2020 17:42:32 +0200 Subject: [PATCH 06/26] #138 WIP- New travis job and add var file to packer script --- .travis.yml | 1 + packer/template.json | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0397c67..a46bd6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ env: - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim DOCKER_TAG_TO_PUBLISH=11-buster-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VERSION=11.0.8+10-1~deb10u1 DOCKER_TAG_TO_PUBLISH=11.0.8-buster-openjdk-headless + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=8 DOCKER_TAG_TO_PUBLISH=8-buster-adoptopenjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial DOCKER_TAG_TO_PUBLISH=9-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~16.04 DOCKER_TAG_TO_PUBLISH=8u265-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=9 JDK_VERSION=9~b114-0ubuntu1 DOCKER_TAG_TO_PUBLISH=9b114-xenial-openjdk-headless diff --git a/packer/template.json b/packer/template.json index 1acde4e..eedabf9 100644 --- a/packer/template.json +++ b/packer/template.json @@ -40,8 +40,11 @@ "user": "root", "playbook_file": "{{ template_dir }}/playbook.yml", "extra_arguments": [ + "-vvv", "--extra-vars", - "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" + "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}", + "--extra-vars", + "@./molecule/adoptopenjdk/group_vars/openjdk/main.yml" ] } ], From cc23ac017c6b3defd20f20cb0f091e1e3039dba9 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:25:39 +0200 Subject: [PATCH 07/26] #138 Add correct adoptopenjdk minor version --- .travis.yml | 2 +- packer/template.json | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a46bd6b..30735fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ env: - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim DOCKER_TAG_TO_PUBLISH=11-buster-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VERSION=11.0.8+10-1~deb10u1 DOCKER_TAG_TO_PUBLISH=11.0.8-buster-openjdk-headless - - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=8 DOCKER_TAG_TO_PUBLISH=8-buster-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8-buster-adoptopenjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial DOCKER_TAG_TO_PUBLISH=9-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~16.04 DOCKER_TAG_TO_PUBLISH=8u265-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=9 JDK_VERSION=9~b114-0ubuntu1 DOCKER_TAG_TO_PUBLISH=9b114-xenial-openjdk-headless diff --git a/packer/template.json b/packer/template.json index eedabf9..c6dfef3 100644 --- a/packer/template.json +++ b/packer/template.json @@ -42,9 +42,7 @@ "extra_arguments": [ "-vvv", "--extra-vars", - "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}", - "--extra-vars", - "@./molecule/adoptopenjdk/group_vars/openjdk/main.yml" + "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" ] } ], From 2180e54010595951d433bff236819e1537a02b2b Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:26:33 +0200 Subject: [PATCH 08/26] #138 WIP-Use files to dynamically load jdk build variables --- defaults/main.yml | 3 +-- molecule/adoptopenjdk/group_vars/openjdk/main.yml | 1 + molecule/corretto/group_vars/openjdk/main.yml | 1 + molecule/default/verify.yml | 3 +++ tasks/install_openjdk.yml | 5 +++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3c2d01e..2860091 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,2 @@ --- -java_open_jdk_apt_extra_packages: [] -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} +jdk_build: openjdk diff --git a/molecule/adoptopenjdk/group_vars/openjdk/main.yml b/molecule/adoptopenjdk/group_vars/openjdk/main.yml index 5137274..9091b6f 100644 --- a/molecule/adoptopenjdk/group_vars/openjdk/main.yml +++ b/molecule/adoptopenjdk/group_vars/openjdk/main.yml @@ -1,4 +1,5 @@ --- +jdk_build: adoptopenjdk java_open_jdk_apt_extra_packages: - python-apt - apt-transport-https diff --git a/molecule/corretto/group_vars/openjdk/main.yml b/molecule/corretto/group_vars/openjdk/main.yml index c81b595..3913340 100644 --- a/molecule/corretto/group_vars/openjdk/main.yml +++ b/molecule/corretto/group_vars/openjdk/main.yml @@ -1,4 +1,5 @@ --- +jdk_build: adoptopenjdk java_open_jdk_version_major: 11 # Supported versions: 8 (1.8.0 in RHEL), 11 diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 4d44708..e9a36a9 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -31,6 +31,9 @@ # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars + - name: Java | Gather JDK build variables + include_vars: "../../vars/{{ jdk_build }}.yml" + - name: Java | Setting OS specific variables set_fact: java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index fcfbdec..a706a1c 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -5,6 +5,11 @@ with_first_found: - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" +- name: Java | Gather JDK build specific variables + include_vars: "{{ item }}" + with_first_found: + - "{{ jdk_build }}.yml" + # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars - name: Java | Setting OS specific variables (I) From 5cd02cb530d4909cd3a13039adc6b53e4e564810 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:26:55 +0200 Subject: [PATCH 09/26] Add specific JDK Build variables --- vars/adoptopenjdk.yml | 22 ++++++++++++++++++++++ vars/corretto.yml | 23 +++++++++++++++++++++++ vars/openjdk.yml | 3 +++ 3 files changed, 48 insertions(+) create mode 100644 vars/adoptopenjdk.yml create mode 100644 vars/corretto.yml create mode 100644 vars/openjdk.yml diff --git a/vars/adoptopenjdk.yml b/vars/adoptopenjdk.yml new file mode 100644 index 0000000..5137274 --- /dev/null +++ b/vars/adoptopenjdk.yml @@ -0,0 +1,22 @@ +--- +java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https +java_open_jdk_version_major: 8 +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +java_required_repositories_openjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main +java_required_libs_openjdk: [] +java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 + +# For RHEL family +# java_required_repositories_openjdk: +# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } +# java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot + +java_required_key_repositories_openjdk: + - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public +java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/corretto.yml b/vars/corretto.yml new file mode 100644 index 0000000..c81b595 --- /dev/null +++ b/vars/corretto.yml @@ -0,0 +1,23 @@ +--- + +java_open_jdk_version_major: 11 +# Supported versions: 8 (1.8.0 in RHEL), 11 + +# For RHEL family +java_required_repositories_openjdk: + - { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } +java_required_key_repositories_openjdk: + - https://yum.corretto.aws/corretto.key +java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel + +# For Debian family +# java_required_repositories_openjdk: +# - deb https://apt.corretto.aws stable main +# java_required_key_repositories_openjdk: +# - https://apt.corretto.aws/corretto.key +# java_required_libs_openjdk: +# - apt-transport-https +# java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk + +java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/openjdk.yml b/vars/openjdk.yml new file mode 100644 index 0000000..3c2d01e --- /dev/null +++ b/vars/openjdk.yml @@ -0,0 +1,3 @@ +--- +java_open_jdk_apt_extra_packages: [] +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} From 3e0c2f60d07ec5e224846a5b99f76e46945c5279 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:37:53 +0200 Subject: [PATCH 10/26] #138 WIP-Better directory structure --- molecule/default/verify.yml | 4 ++-- tasks/install_openjdk.yml | 4 ++-- vars/{ => jdk-builds}/adoptopenjdk.yml | 0 vars/{ => jdk-builds}/corretto.yml | 0 vars/{ => jdk-builds}/openjdk.yml | 0 vars/{ => os-distributions}/CentOS-7.yml | 0 vars/{ => os-distributions}/CentOS-8.yml | 0 vars/{ => os-distributions}/Debian-10.yml | 0 vars/{ => os-distributions}/Debian-9.yml | 0 vars/{ => os-distributions}/Ubuntu-16.yml | 0 vars/{ => os-distributions}/Ubuntu-18.yml | 0 vars/{ => os-distributions}/Ubuntu-20.yml | 0 12 files changed, 4 insertions(+), 4 deletions(-) rename vars/{ => jdk-builds}/adoptopenjdk.yml (100%) rename vars/{ => jdk-builds}/corretto.yml (100%) rename vars/{ => jdk-builds}/openjdk.yml (100%) rename vars/{ => os-distributions}/CentOS-7.yml (100%) rename vars/{ => os-distributions}/CentOS-8.yml (100%) rename vars/{ => os-distributions}/Debian-10.yml (100%) rename vars/{ => os-distributions}/Debian-9.yml (100%) rename vars/{ => os-distributions}/Ubuntu-16.yml (100%) rename vars/{ => os-distributions}/Ubuntu-18.yml (100%) rename vars/{ => os-distributions}/Ubuntu-20.yml (100%) diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index e9a36a9..c66cd5d 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -27,12 +27,12 @@ tasks: - name: Java | Gather OS specific variables - include_vars: "../../vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + include_vars: "../../vars/os-distributions/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars - name: Java | Gather JDK build variables - include_vars: "../../vars/{{ jdk_build }}.yml" + include_vars: "../../vars/jdk-builds/{{ jdk_build }}.yml" - name: Java | Setting OS specific variables set_fact: diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index a706a1c..5090892 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -3,12 +3,12 @@ - name: Java | Gather OS specific variables include_vars: "{{ item }}" with_first_found: - - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + - "os-distributions/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" - name: Java | Gather JDK build specific variables include_vars: "{{ item }}" with_first_found: - - "{{ jdk_build }}.yml" + - "jdk-builds/{{ jdk_build }}.yml" # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars diff --git a/vars/adoptopenjdk.yml b/vars/jdk-builds/adoptopenjdk.yml similarity index 100% rename from vars/adoptopenjdk.yml rename to vars/jdk-builds/adoptopenjdk.yml diff --git a/vars/corretto.yml b/vars/jdk-builds/corretto.yml similarity index 100% rename from vars/corretto.yml rename to vars/jdk-builds/corretto.yml diff --git a/vars/openjdk.yml b/vars/jdk-builds/openjdk.yml similarity index 100% rename from vars/openjdk.yml rename to vars/jdk-builds/openjdk.yml diff --git a/vars/CentOS-7.yml b/vars/os-distributions/CentOS-7.yml similarity index 100% rename from vars/CentOS-7.yml rename to vars/os-distributions/CentOS-7.yml diff --git a/vars/CentOS-8.yml b/vars/os-distributions/CentOS-8.yml similarity index 100% rename from vars/CentOS-8.yml rename to vars/os-distributions/CentOS-8.yml diff --git a/vars/Debian-10.yml b/vars/os-distributions/Debian-10.yml similarity index 100% rename from vars/Debian-10.yml rename to vars/os-distributions/Debian-10.yml diff --git a/vars/Debian-9.yml b/vars/os-distributions/Debian-9.yml similarity index 100% rename from vars/Debian-9.yml rename to vars/os-distributions/Debian-9.yml diff --git a/vars/Ubuntu-16.yml b/vars/os-distributions/Ubuntu-16.yml similarity index 100% rename from vars/Ubuntu-16.yml rename to vars/os-distributions/Ubuntu-16.yml diff --git a/vars/Ubuntu-18.yml b/vars/os-distributions/Ubuntu-18.yml similarity index 100% rename from vars/Ubuntu-18.yml rename to vars/os-distributions/Ubuntu-18.yml diff --git a/vars/Ubuntu-20.yml b/vars/os-distributions/Ubuntu-20.yml similarity index 100% rename from vars/Ubuntu-20.yml rename to vars/os-distributions/Ubuntu-20.yml From d1250a89f07895c9c9f5372d86dd2a3f9989d334 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:42:35 +0200 Subject: [PATCH 11/26] #138 Support for JDK_BUILD variable --- .travis.yml | 4 ++-- packer/template.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30735fe..c53003d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ env: - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim DOCKER_TAG_TO_PUBLISH=11-buster-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VERSION=11.0.8+10-1~deb10u1 DOCKER_TAG_TO_PUBLISH=11.0.8-buster-openjdk-headless - - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8-buster-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_BUILD=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial DOCKER_TAG_TO_PUBLISH=9-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~16.04 DOCKER_TAG_TO_PUBLISH=8u265-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=9 JDK_VERSION=9~b114-0ubuntu1 DOCKER_TAG_TO_PUBLISH=9b114-xenial-openjdk-headless @@ -35,7 +35,7 @@ env: - DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos7-openjdk-headless - DOCKER_IMAGE_BASE=centos:8 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos8-openjdk-headless script: -- pipenv run molecule test +- pipenv run molecule test --all notifications: webhooks: - https://galaxy.ansible.com/api/v1/notifications/ diff --git a/packer/template.json b/packer/template.json index c6dfef3..712bdaa 100644 --- a/packer/template.json +++ b/packer/template.json @@ -6,6 +6,7 @@ "docker_username": "{{env `DOCKER_USERNAME`}}", "docker_password": "{{env `DOCKER_PASSWORD`}}", "docker_tag_to_publish": "{{env `DOCKER_TAG_TO_PUBLISH`}}", + "jdk_build": "{{env `JDK_BUILD`}}", "jdk_version": "{{env `JDK_VERSION`}}", "jdk_major": "{{env `JDK_MAJOR`}}" }, @@ -42,7 +43,7 @@ "extra_arguments": [ "-vvv", "--extra-vars", - "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" + "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} jdk_build={{user `jdk_build`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" ] } ], From dd2dd69bd5afb0d42f3b6bf33c4bbed3b171dcfe Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 12:45:20 +0200 Subject: [PATCH 12/26] Disable debug mode --- packer/template.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packer/template.json b/packer/template.json index 712bdaa..b9dce63 100644 --- a/packer/template.json +++ b/packer/template.json @@ -41,7 +41,6 @@ "user": "root", "playbook_file": "{{ template_dir }}/playbook.yml", "extra_arguments": [ - "-vvv", "--extra-vars", "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} jdk_build={{user `jdk_build`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" ] From ae1a76e092e1345f6fb4824247c6515729159a88 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 13:18:41 +0200 Subject: [PATCH 13/26] Typo in molecule test --- molecule/corretto/group_vars/openjdk/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/corretto/group_vars/openjdk/main.yml b/molecule/corretto/group_vars/openjdk/main.yml index 3913340..846a85c 100644 --- a/molecule/corretto/group_vars/openjdk/main.yml +++ b/molecule/corretto/group_vars/openjdk/main.yml @@ -1,5 +1,5 @@ --- -jdk_build: adoptopenjdk +jdk_build: corretto java_open_jdk_version_major: 11 # Supported versions: 8 (1.8.0 in RHEL), 11 From 07b9dc2a4af2ba499b286083ada837f7eb68eaec Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 13:37:03 +0200 Subject: [PATCH 14/26] Remove test --all --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c53003d..a9ac245 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ env: - DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos7-openjdk-headless - DOCKER_IMAGE_BASE=centos:8 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos8-openjdk-headless script: -- pipenv run molecule test --all +- pipenv run molecule test notifications: webhooks: - https://galaxy.ansible.com/api/v1/notifications/ From 195acbb24a8e9cec2ba8551a4415a7edaed97e50 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 14:46:01 +0200 Subject: [PATCH 15/26] Semtantic change --- .travis.yml | 2 +- defaults/main.yml | 2 +- molecule/adoptopenjdk/group_vars/openjdk/main.yml | 2 +- molecule/corretto/group_vars/openjdk/main.yml | 2 +- molecule/default/verify.yml | 2 +- packer/template.json | 4 ++-- tasks/install_openjdk.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9ac245..dda0037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ env: - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim DOCKER_TAG_TO_PUBLISH=11-buster-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VERSION=11.0.8+10-1~deb10u1 DOCKER_TAG_TO_PUBLISH=11.0.8-buster-openjdk-headless - - DOCKER_IMAGE_BASE=debian:buster-slim JDK_BUILD=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial DOCKER_TAG_TO_PUBLISH=9-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~16.04 DOCKER_TAG_TO_PUBLISH=8u265-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=9 JDK_VERSION=9~b114-0ubuntu1 DOCKER_TAG_TO_PUBLISH=9b114-xenial-openjdk-headless diff --git a/defaults/main.yml b/defaults/main.yml index 2860091..35b3f88 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,2 @@ --- -jdk_build: openjdk +java_jdk_vendor: openjdk diff --git a/molecule/adoptopenjdk/group_vars/openjdk/main.yml b/molecule/adoptopenjdk/group_vars/openjdk/main.yml index 9091b6f..9b7634f 100644 --- a/molecule/adoptopenjdk/group_vars/openjdk/main.yml +++ b/molecule/adoptopenjdk/group_vars/openjdk/main.yml @@ -1,5 +1,5 @@ --- -jdk_build: adoptopenjdk +java_jdk_vendor: adoptopenjdk java_open_jdk_apt_extra_packages: - python-apt - apt-transport-https diff --git a/molecule/corretto/group_vars/openjdk/main.yml b/molecule/corretto/group_vars/openjdk/main.yml index 846a85c..f2a06cd 100644 --- a/molecule/corretto/group_vars/openjdk/main.yml +++ b/molecule/corretto/group_vars/openjdk/main.yml @@ -1,5 +1,5 @@ --- -jdk_build: corretto +java_jdk_vendor: corretto java_open_jdk_version_major: 11 # Supported versions: 8 (1.8.0 in RHEL), 11 diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index c66cd5d..a5fa94d 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -32,7 +32,7 @@ # Allowing to 'override' variables that are defined using include_vars - name: Java | Gather JDK build variables - include_vars: "../../vars/jdk-builds/{{ jdk_build }}.yml" + include_vars: "../../vars/jdk-builds/{{ java_jdk_vendor }}.yml" - name: Java | Setting OS specific variables set_fact: diff --git a/packer/template.json b/packer/template.json index b9dce63..3abfa8f 100644 --- a/packer/template.json +++ b/packer/template.json @@ -6,7 +6,7 @@ "docker_username": "{{env `DOCKER_USERNAME`}}", "docker_password": "{{env `DOCKER_PASSWORD`}}", "docker_tag_to_publish": "{{env `DOCKER_TAG_TO_PUBLISH`}}", - "jdk_build": "{{env `JDK_BUILD`}}", + "java_jdk_vendor": "{{env `JDK_VENDOR`}}", "jdk_version": "{{env `JDK_VERSION`}}", "jdk_major": "{{env `JDK_MAJOR`}}" }, @@ -42,7 +42,7 @@ "playbook_file": "{{ template_dir }}/playbook.yml", "extra_arguments": [ "--extra-vars", - "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} jdk_build={{user `jdk_build`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" + "ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} java_jdk_vendor={{user `java_jdk_vendor`}} java_open_jdk_version={{user `jdk_version`}} java_open_jdk_version_major={{user `jdk_major`}}" ] } ], diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 5090892..4db2723 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -8,7 +8,7 @@ - name: Java | Gather JDK build specific variables include_vars: "{{ item }}" with_first_found: - - "jdk-builds/{{ jdk_build }}.yml" + - "jdk-builds/{{ java_jdk_vendor }}.yml" # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars From 19f07b5eb55a7d9f7044babf2a995d4fcfd2afb9 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 14:53:12 +0200 Subject: [PATCH 16/26] Run corresponding vendor scenario --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dda0037..3b433d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ env: - DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos7-openjdk-headless - DOCKER_IMAGE_BASE=centos:8 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos8-openjdk-headless script: -- pipenv run molecule test +- pipenv run molecule test --scenario-name=${JDK_VENDOR:-default} notifications: webhooks: - https://galaxy.ansible.com/api/v1/notifications/ From 22d6003ea5db7f59d346eda22c4467870642f542 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Thu, 3 Sep 2020 16:02:37 +0200 Subject: [PATCH 17/26] Improved vendor support --- defaults/main.yml | 3 +++ molecule/default/verify.yml | 5 +--- tasks/install_openjdk.yml | 7 +----- vars/adoptopenjdk/Centos-8.yml | 15 ++++++++++++ vars/adoptopenjdk/Debian-10.yml | 22 ++++++++++++++++++ vars/corretto/CentOS-8.yml | 13 +++++++++++ vars/corretto/Debian-10.yml | 15 ++++++++++++ vars/jdk-builds/adoptopenjdk.yml | 22 ------------------ vars/jdk-builds/corretto.yml | 23 ------------------- vars/jdk-builds/openjdk.yml | 3 --- .../CentOS-7.yml | 0 .../CentOS-8.yml | 0 .../Debian-10.yml | 0 .../Debian-9.yml | 0 .../Ubuntu-16.yml | 0 .../Ubuntu-18.yml | 0 .../Ubuntu-20.yml | 0 17 files changed, 70 insertions(+), 58 deletions(-) create mode 100644 vars/adoptopenjdk/Centos-8.yml create mode 100644 vars/adoptopenjdk/Debian-10.yml create mode 100644 vars/corretto/CentOS-8.yml create mode 100644 vars/corretto/Debian-10.yml delete mode 100644 vars/jdk-builds/adoptopenjdk.yml delete mode 100644 vars/jdk-builds/corretto.yml delete mode 100644 vars/jdk-builds/openjdk.yml rename vars/{os-distributions => openjdk}/CentOS-7.yml (100%) rename vars/{os-distributions => openjdk}/CentOS-8.yml (100%) rename vars/{os-distributions => openjdk}/Debian-10.yml (100%) rename vars/{os-distributions => openjdk}/Debian-9.yml (100%) rename vars/{os-distributions => openjdk}/Ubuntu-16.yml (100%) rename vars/{os-distributions => openjdk}/Ubuntu-18.yml (100%) rename vars/{os-distributions => openjdk}/Ubuntu-20.yml (100%) diff --git a/defaults/main.yml b/defaults/main.yml index 35b3f88..08f760e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,5 @@ --- java_jdk_vendor: openjdk + +java_open_jdk_apt_extra_packages: [] +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index a5fa94d..eff9003 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -27,13 +27,10 @@ tasks: - name: Java | Gather OS specific variables - include_vars: "../../vars/os-distributions/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars - - name: Java | Gather JDK build variables - include_vars: "../../vars/jdk-builds/{{ java_jdk_vendor }}.yml" - - name: Java | Setting OS specific variables set_fact: java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" diff --git a/tasks/install_openjdk.yml b/tasks/install_openjdk.yml index 4db2723..737692b 100644 --- a/tasks/install_openjdk.yml +++ b/tasks/install_openjdk.yml @@ -3,12 +3,7 @@ - name: Java | Gather OS specific variables include_vars: "{{ item }}" with_first_found: - - "os-distributions/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" - -- name: Java | Gather JDK build specific variables - include_vars: "{{ item }}" - with_first_found: - - "jdk-builds/{{ java_jdk_vendor }}.yml" + - "{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) # Allowing to 'override' variables that are defined using include_vars diff --git a/vars/adoptopenjdk/Centos-8.yml b/vars/adoptopenjdk/Centos-8.yml new file mode 100644 index 0000000..16c0c8b --- /dev/null +++ b/vars/adoptopenjdk/Centos-8.yml @@ -0,0 +1,15 @@ +--- +__java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https +__java_open_jdk_version_major: 8 +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +__java_required_repositories_openjdk: + - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } +__java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot + +__java_required_key_repositories_openjdk: + - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public +__java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot +__java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/adoptopenjdk/Debian-10.yml b/vars/adoptopenjdk/Debian-10.yml new file mode 100644 index 0000000..6d4f3e9 --- /dev/null +++ b/vars/adoptopenjdk/Debian-10.yml @@ -0,0 +1,22 @@ +--- +__java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https +__java_open_jdk_version_major: 8 +# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations + +# For Debian family +__java_required_repositories_openjdk: + - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main +__java_required_libs_openjdk: [] +__java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 + +# For RHEL family +# __java_required_repositories_openjdk: +# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } +# __java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot + +__java_required_key_repositories_openjdk: + - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public +__java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot +__java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/corretto/CentOS-8.yml b/vars/corretto/CentOS-8.yml new file mode 100644 index 0000000..34ca0c0 --- /dev/null +++ b/vars/corretto/CentOS-8.yml @@ -0,0 +1,13 @@ +--- + +__java_open_jdk_version_major: 11 +# Supported versions: 8 (1.8.0 in RHEL), 11 + +__java_required_repositories_openjdk: + - { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } +__java_required_key_repositories_openjdk: + - https://yum.corretto.aws/corretto.key +__java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel + +java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/corretto/Debian-10.yml b/vars/corretto/Debian-10.yml new file mode 100644 index 0000000..456769f --- /dev/null +++ b/vars/corretto/Debian-10.yml @@ -0,0 +1,15 @@ +--- + +__java_open_jdk_version_major: 11 +# Supported versions: 8 (1.8.0 in RHEL), 11 + +__java_required_repositories_openjdk: + - deb https://apt.corretto.aws stable main +__java_required_key_repositories_openjdk: + - https://apt.corretto.aws/corretto.key +__java_required_libs_openjdk: + - apt-transport-https +__java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk + +java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/jdk-builds/adoptopenjdk.yml b/vars/jdk-builds/adoptopenjdk.yml deleted file mode 100644 index 5137274..0000000 --- a/vars/jdk-builds/adoptopenjdk.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: - - python-apt - - apt-transport-https -java_open_jdk_version_major: 8 -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -# For Debian family -java_required_repositories_openjdk: - - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main -java_required_libs_openjdk: [] -java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 - -# For RHEL family -# java_required_repositories_openjdk: -# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } -# java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot - -java_required_key_repositories_openjdk: - - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public -java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/jdk-builds/corretto.yml b/vars/jdk-builds/corretto.yml deleted file mode 100644 index c81b595..0000000 --- a/vars/jdk-builds/corretto.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- - -java_open_jdk_version_major: 11 -# Supported versions: 8 (1.8.0 in RHEL), 11 - -# For RHEL family -java_required_repositories_openjdk: - - { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } -java_required_key_repositories_openjdk: - - https://yum.corretto.aws/corretto.key -java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel - -# For Debian family -# java_required_repositories_openjdk: -# - deb https://apt.corretto.aws stable main -# java_required_key_repositories_openjdk: -# - https://apt.corretto.aws/corretto.key -# java_required_libs_openjdk: -# - apt-transport-https -# java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk - -java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/jdk-builds/openjdk.yml b/vars/jdk-builds/openjdk.yml deleted file mode 100644 index 3c2d01e..0000000 --- a/vars/jdk-builds/openjdk.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -java_open_jdk_apt_extra_packages: [] -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/os-distributions/CentOS-7.yml b/vars/openjdk/CentOS-7.yml similarity index 100% rename from vars/os-distributions/CentOS-7.yml rename to vars/openjdk/CentOS-7.yml diff --git a/vars/os-distributions/CentOS-8.yml b/vars/openjdk/CentOS-8.yml similarity index 100% rename from vars/os-distributions/CentOS-8.yml rename to vars/openjdk/CentOS-8.yml diff --git a/vars/os-distributions/Debian-10.yml b/vars/openjdk/Debian-10.yml similarity index 100% rename from vars/os-distributions/Debian-10.yml rename to vars/openjdk/Debian-10.yml diff --git a/vars/os-distributions/Debian-9.yml b/vars/openjdk/Debian-9.yml similarity index 100% rename from vars/os-distributions/Debian-9.yml rename to vars/openjdk/Debian-9.yml diff --git a/vars/os-distributions/Ubuntu-16.yml b/vars/openjdk/Ubuntu-16.yml similarity index 100% rename from vars/os-distributions/Ubuntu-16.yml rename to vars/openjdk/Ubuntu-16.yml diff --git a/vars/os-distributions/Ubuntu-18.yml b/vars/openjdk/Ubuntu-18.yml similarity index 100% rename from vars/os-distributions/Ubuntu-18.yml rename to vars/openjdk/Ubuntu-18.yml diff --git a/vars/os-distributions/Ubuntu-20.yml b/vars/openjdk/Ubuntu-20.yml similarity index 100% rename from vars/os-distributions/Ubuntu-20.yml rename to vars/openjdk/Ubuntu-20.yml From 837148aad328ff0708e85038830835d73f3abacc Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 09:19:43 +0200 Subject: [PATCH 18/26] Set adoptopenjdk and corretto tests --- .../adoptopenjdk/group_vars/openjdk/main.yml | 23 ------------------ molecule/adoptopenjdk/molecule.yml | 9 +++++-- molecule/adoptopenjdk/verify.yml | 23 ++++++++++++++++++ molecule/corretto/group_vars/openjdk/main.yml | 24 ------------------- molecule/corretto/molecule.yml | 9 +++++-- molecule/corretto/verify.yml | 18 ++++++++++++++ molecule/default/molecule.yml | 1 + .../{Centos-8.yml => CentOS-8.yml} | 4 ++-- vars/adoptopenjdk/Debian-10.yml | 10 ++------ vars/corretto/CentOS-8.yml | 7 +++--- vars/corretto/Debian-10.yml | 6 ++--- 11 files changed, 66 insertions(+), 68 deletions(-) delete mode 100644 molecule/adoptopenjdk/group_vars/openjdk/main.yml delete mode 100644 molecule/corretto/group_vars/openjdk/main.yml rename vars/adoptopenjdk/{Centos-8.yml => CentOS-8.yml} (85%) diff --git a/molecule/adoptopenjdk/group_vars/openjdk/main.yml b/molecule/adoptopenjdk/group_vars/openjdk/main.yml deleted file mode 100644 index 9b7634f..0000000 --- a/molecule/adoptopenjdk/group_vars/openjdk/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -java_jdk_vendor: adoptopenjdk -java_open_jdk_apt_extra_packages: - - python-apt - - apt-transport-https -java_open_jdk_version_major: 8 -# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations - -# For Debian family -java_required_repositories_openjdk: - - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main -java_required_libs_openjdk: [] -java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 - -# For RHEL family -# java_required_repositories_openjdk: -# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } -# java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot - -java_required_key_repositories_openjdk: - - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public -java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/molecule/adoptopenjdk/molecule.yml b/molecule/adoptopenjdk/molecule.yml index d56a0aa..7251d4c 100644 --- a/molecule/adoptopenjdk/molecule.yml +++ b/molecule/adoptopenjdk/molecule.yml @@ -17,8 +17,13 @@ platforms: provisioner: name: ansible inventory: - links: - group_vars: ./group_vars + group_vars: + openjdk: + java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} + java_jdk_vendor: adoptopenjdk + java_open_jdk_version: ${JDK_VERSION} + java_open_jdk_version_major: ${JDK_MAJOR} + scenario: name: adoptopenjdk verifier: diff --git a/molecule/adoptopenjdk/verify.yml b/molecule/adoptopenjdk/verify.yml index 73c8e06..09cfb82 100644 --- a/molecule/adoptopenjdk/verify.yml +++ b/molecule/adoptopenjdk/verify.yml @@ -23,6 +23,29 @@ molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" tasks: + - name: Set JDK Vendor + set_fact: + java_jdk_vendor: adoptopenjdk + + - name: Gather OS specific variables + include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) + # Allowing to 'override' variables that are defined using include_vars + + - name: Setting OS specific variables + set_fact: + java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" + java_open_jdk_version_major: "{{ java_open_jdk_version_major if java_open_jdk_version_major is defined and java_open_jdk_version_major is not sameas None and java_open_jdk_version_major else __java_open_jdk_version_major }}" # noqa 204 + + - name: Setting OS specific variables (II) + set_fact: + java_open_jdk_home_dir: "{{ java_open_jdk_home_dir if java_open_jdk_home_dir is defined and java_open_jdk_home_dir is not sameas None and java_open_jdk_home_dir else __java_open_jdk_home_dir }}" # noqa 204 + java_open_jdk_package: "{{ java_open_jdk_package if java_open_jdk_package is defined and java_open_jdk_package is not sameas None and java_open_jdk_package else __java_open_jdk_package }}" # noqa 204 + + - name: Setting specific variables + set_fact: + java_home: "{{ java_open_jdk_home }}" + - name: Download and install goss get_url: url: "{{ goss_url }}" diff --git a/molecule/corretto/group_vars/openjdk/main.yml b/molecule/corretto/group_vars/openjdk/main.yml deleted file mode 100644 index f2a06cd..0000000 --- a/molecule/corretto/group_vars/openjdk/main.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -java_jdk_vendor: corretto - -java_open_jdk_version_major: 11 -# Supported versions: 8 (1.8.0 in RHEL), 11 - -# For RHEL family -java_required_repositories_openjdk: - - { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } -java_required_key_repositories_openjdk: - - https://yum.corretto.aws/corretto.key -java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel - -# For Debian family -# java_required_repositories_openjdk: -# - deb https://apt.corretto.aws stable main -# java_required_key_repositories_openjdk: -# - https://apt.corretto.aws/corretto.key -# java_required_libs_openjdk: -# - apt-transport-https -# java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk - -java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/molecule/corretto/molecule.yml b/molecule/corretto/molecule.yml index 71110df..cc69a55 100644 --- a/molecule/corretto/molecule.yml +++ b/molecule/corretto/molecule.yml @@ -17,8 +17,13 @@ platforms: provisioner: name: ansible inventory: - links: - group_vars: ./group_vars + group_vars: + openjdk: + java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} + java_jdk_vendor: corretto + java_open_jdk_version: ${JDK_VERSION} + java_open_jdk_version_major: ${JDK_MAJOR} + scenario: name: corretto verifier: diff --git a/molecule/corretto/verify.yml b/molecule/corretto/verify.yml index 73c8e06..791e1dc 100644 --- a/molecule/corretto/verify.yml +++ b/molecule/corretto/verify.yml @@ -23,6 +23,24 @@ molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" tasks: + - name: Java | Gather OS specific variables + include_vars: "../../vars/{{ java_jdk_vendor }}/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + # Using pattern described in Ansible Best Practices and Conventions (Appendix B), Ansible for Devops (p. 406) + # Allowing to 'override' variables that are defined using include_vars + + - name: Java | Setting OS specific variables + set_fact: + java_open_jdk_version: "{{ java_open_jdk_version if java_open_jdk_version is defined and java_open_jdk_version is not sameas None }}" + java_open_jdk_version_major: "{{ java_open_jdk_version_major if java_open_jdk_version_major is defined and java_open_jdk_version_major is not sameas None and java_open_jdk_version_major else __java_open_jdk_version_major }}" # noqa 204 + + - name: Java | Setting OS specific variables (II) + set_fact: + java_open_jdk_home_dir: "{{ java_open_jdk_home_dir if java_open_jdk_home_dir is defined and java_open_jdk_home_dir is not sameas None and java_open_jdk_home_dir else __java_open_jdk_home_dir }}" # noqa 204 + java_open_jdk_package: "{{ java_open_jdk_package if java_open_jdk_package is defined and java_open_jdk_package is not sameas None and java_open_jdk_package else __java_open_jdk_package }}" # noqa 204 + + - name: Java | Setting specific variables + set_fact: + java_home: "{{ java_open_jdk_home }}" - name: Download and install goss get_url: url: "{{ goss_url }}" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 006b6c7..ef6f7d8 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -19,6 +19,7 @@ provisioner: inventory: group_vars: openjdk: + java_jdk_vendor: openjdk java_open_jdk_version: ${JDK_VERSION} java_open_jdk_version_major: ${JDK_MAJOR} scenario: diff --git a/vars/adoptopenjdk/Centos-8.yml b/vars/adoptopenjdk/CentOS-8.yml similarity index 85% rename from vars/adoptopenjdk/Centos-8.yml rename to vars/adoptopenjdk/CentOS-8.yml index 16c0c8b..cb32624 100644 --- a/vars/adoptopenjdk/Centos-8.yml +++ b/vars/adoptopenjdk/CentOS-8.yml @@ -1,5 +1,5 @@ --- -__java_open_jdk_apt_extra_packages: +java_open_jdk_apt_extra_packages: - python-apt - apt-transport-https __java_open_jdk_version_major: 8 @@ -7,9 +7,9 @@ __java_open_jdk_version_major: 8 __java_required_repositories_openjdk: - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } +__java_required_libs_openjdk: [] __java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot __java_required_key_repositories_openjdk: - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public __java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot -__java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/adoptopenjdk/Debian-10.yml b/vars/adoptopenjdk/Debian-10.yml index 6d4f3e9..abfa907 100644 --- a/vars/adoptopenjdk/Debian-10.yml +++ b/vars/adoptopenjdk/Debian-10.yml @@ -1,22 +1,16 @@ --- -__java_open_jdk_apt_extra_packages: +java_open_jdk_apt_extra_packages: - python-apt - apt-transport-https __java_open_jdk_version_major: 8 # Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations # For Debian family +__java_required_libs_openjdk: [] __java_required_repositories_openjdk: - deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main -__java_required_libs_openjdk: [] __java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 -# For RHEL family -# __java_required_repositories_openjdk: -# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } -# __java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot - __java_required_key_repositories_openjdk: - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public __java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot -__java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/corretto/CentOS-8.yml b/vars/corretto/CentOS-8.yml index 34ca0c0..c8f71fb 100644 --- a/vars/corretto/CentOS-8.yml +++ b/vars/corretto/CentOS-8.yml @@ -1,5 +1,5 @@ --- - +java_jdk_vendor: adoptopenjdk __java_open_jdk_version_major: 11 # Supported versions: 8 (1.8.0 in RHEL), 11 @@ -7,7 +7,8 @@ __java_required_repositories_openjdk: - { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } __java_required_key_repositories_openjdk: - https://yum.corretto.aws/corretto.key +__java_required_libs_openjdk: [] __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel -java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} +__java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto +__java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} diff --git a/vars/corretto/Debian-10.yml b/vars/corretto/Debian-10.yml index 456769f..c7f75cf 100644 --- a/vars/corretto/Debian-10.yml +++ b/vars/corretto/Debian-10.yml @@ -1,15 +1,13 @@ --- - __java_open_jdk_version_major: 11 # Supported versions: 8 (1.8.0 in RHEL), 11 __java_required_repositories_openjdk: - - deb https://apt.corretto.aws stable main + - deb https://apt.corretto.aws stable main __java_required_key_repositories_openjdk: - https://apt.corretto.aws/corretto.key __java_required_libs_openjdk: - apt-transport-https __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk -java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto -java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} +__java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto From e84762533002dc1feb721d56ab6b663d6ebcafe8 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 10:20:53 +0200 Subject: [PATCH 19/26] Fix vars files --- vars/corretto/CentOS-8.yml | 3 +-- vars/corretto/Debian-10.yml | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/vars/corretto/CentOS-8.yml b/vars/corretto/CentOS-8.yml index c8f71fb..c9c4c78 100644 --- a/vars/corretto/CentOS-8.yml +++ b/vars/corretto/CentOS-8.yml @@ -1,6 +1,5 @@ --- -java_jdk_vendor: adoptopenjdk -__java_open_jdk_version_major: 11 +__java_open_jdk_version_major: 1.8.0 # Supported versions: 8 (1.8.0 in RHEL), 11 __java_required_repositories_openjdk: diff --git a/vars/corretto/Debian-10.yml b/vars/corretto/Debian-10.yml index c7f75cf..12d180a 100644 --- a/vars/corretto/Debian-10.yml +++ b/vars/corretto/Debian-10.yml @@ -1,13 +1,16 @@ --- -__java_open_jdk_version_major: 11 -# Supported versions: 8 (1.8.0 in RHEL), 11 +java_open_jdk_apt_extra_packages: + - python-apt + - apt-transport-https + +__java_open_jdk_version_major: 1.8.0 +# Supported versions: 8 (1.8.0L), 11 __java_required_repositories_openjdk: - deb https://apt.corretto.aws stable main __java_required_key_repositories_openjdk: - https://apt.corretto.aws/corretto.key -__java_required_libs_openjdk: - - apt-transport-https +__java_required_libs_openjdk: [] __java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk __java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto From 7e4aafdadc222bb55a5177c216220bb7c8c31d01 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 10:21:03 +0200 Subject: [PATCH 20/26] Add corretto jobs --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3b433d2..4e47cf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,12 +17,12 @@ env: - secure: WuOSbycFJIECLpysMXvNOYckr004ufS10PoboOldE/7yJPtAwKE6KIVdHLNQ942j70+GU3y18/UErMyY0mjyZl9zzQRhvQKpyGuKniTCCIDgxydhMP/Ik3+DHslG3szfTmbjo1bJ2+uRFLOxTgY7pnxebJbW3i7AKSEpK9XQY0GzGhJzazqJJeylMsC/gTOQFza2clPe1so5b5CoedbK3/Ued82dlDgb/bqY5rlyYvx/qdbNRl5kVdH/YWLWR2xdl1WffL91Lbh/YtqgLAeZuJJsza6dHvjKlFAiVFMuWxX3GBYgcdmxnL+vzy9Ldp4FiFi1B+amSjCQsQ8HB3vJqCAhWBs1pvHE4xlM7Pxaoz+Zz5Iwnb0LwQvwu+ehitHBpHTmKG1s3wVVPAx0xArZuN5fsn9vW/HAyoVM3AkI6jOjlgTEYVMCJSr/+fLvGwjzuhYoHLQfI8R6S4A71xz6n6xU8LoLrbg9V6ypfyNSuEsBD/W+H9cE8cmqiJftMnExj0dQMXDGp0b6gpFLgPo4L5d5szPgcLGTpmwcyRTTGDymjS5veDxIhwVtUQif78PlwIJ/Ky+2M/qREnSkt8OcAtv8msqvfTGfiQIHsWu/kHsRFctVfidBmLTU6KRSxwXhe+br67HsBuYKp6aGtubYE0QGwM+gn5UnIzAy6+5OmTo= - secure: jnMLyXO4BXHo5OWGDsgtTnKBoiV+EG5Qd7w+a0RfkJu/SeqW/pm7NOnGqWDxKUdf9UREtKvCO26ZdciC2DwmjOVsSH5KVnvS7fr2QvPalHNJhi8IHkSOi5BP4DUIFlJowBKCGMTftNUJCiZq5tq8GnnwR9eaQg0WqhqcSmRA/dIyN4MycayGhqt/+9gaTiOaiKrun7esAUnizszXOj8P0QBLxjAiXIfDmwUfe6z7vHRaf96L/T5tpDcRd00jxm+QYlsN8zIxYK5CguPwl/ip2jRAdkq2KA8MT5tL7qaqkqAKzzaetHKbSigzuzER8Wua5Qc3JZajI9YMayvJSrow3fXDmGg+T4XYJgRe87HtIO3IwHclvtfsYgrD1kYhLm+jo2czm8uQIKdQZqVkZ8lJxhV24yZ76Xa0ysEzmHXbV2HHmNYud2Kuh8CYPA+M9yB8icwoc58IqOOfj7/N8Siv5oypSuWmEHZdkhPVkPBY4Qq7aDMGy4/Uzy+yu4V++6oJrXZMAKKlDnuMayZylEaN+CLjZnDFDjusYDkTZRoNo1Bt5EiEb0AZQ19caVW0kRD0rseRa/Af/DYJswTo6AyXs4Tk2B4Mm/0XYGhku4QKZw6In3/FxTHxF16y9GZMv1T/0xRXpkmFYYHJE/4vhhsN0shTRNe+9b+tc/zvd5a3/3g= jobs: + # openjdk - DOCKER_IMAGE_BASE=debian:stretch-slim DOCKER_TAG_TO_PUBLISH=8-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=8 JDK_VERSION=8u265-b01-0+deb9u1 DOCKER_TAG_TO_PUBLISH=8u265-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:stretch-slim JDK_MAJOR=11 JDK_VERSION=11.0.6+10-1~bpo9+1 DOCKER_TAG_TO_PUBLISH=11.0.6-stretch-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim DOCKER_TAG_TO_PUBLISH=11-buster-openjdk-headless - DOCKER_IMAGE_BASE=debian:buster-slim JDK_MAJOR=11 JDK_VERSION=11.0.8+10-1~deb10u1 DOCKER_TAG_TO_PUBLISH=11.0.8-buster-openjdk-headless - - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial DOCKER_TAG_TO_PUBLISH=9-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~16.04 DOCKER_TAG_TO_PUBLISH=8u265-xenial-openjdk-headless - DOCKER_IMAGE_BASE=amd64/ubuntu:xenial JDK_MAJOR=9 JDK_VERSION=9~b114-0ubuntu1 DOCKER_TAG_TO_PUBLISH=9b114-xenial-openjdk-headless @@ -34,6 +34,12 @@ env: - DOCKER_IMAGE_BASE=amd64/ubuntu:focal JDK_MAJOR=8 JDK_VERSION=8u265-b01-0ubuntu2~20.04 DOCKER_TAG_TO_PUBLISH=8u265-focal-openjdk-headless - DOCKER_IMAGE_BASE=centos:7 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos7-openjdk-headless - DOCKER_IMAGE_BASE=centos:8 JDK_MAJOR=11 JDK_VERSION=11.0.8.10 DOCKER_TAG_TO_PUBLISH=11.0.8.10-centos8-openjdk-headless + # adoptopenjdk + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265-b01-3 DOCKER_TAG_TO_PUBLISH=8u265-buster-adoptopenjdk-headless + - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265_b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-adoptopenjdk-headless + # corretto + - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.265.01-1 DOCKER_TAG_TO_PUBLISH=8u265-buster-corretto-headless + - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=0.265 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless script: - pipenv run molecule test --scenario-name=${JDK_VENDOR:-default} notifications: From 7cab6a8dc825243cf6029e069db67e9056e6704e Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 10:57:12 +0200 Subject: [PATCH 21/26] Fix corretto centos jdk_version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e47cf7..0cf5e1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ env: - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265_b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-adoptopenjdk-headless # corretto - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.265.01-1 DOCKER_TAG_TO_PUBLISH=8u265-buster-corretto-headless - - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=0.265 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless + - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:1.8.0_265.b01-1 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless script: - pipenv run molecule test --scenario-name=${JDK_VENDOR:-default} notifications: From 2648b9a87681c3c2752f8594a808ee72d485fbf1 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 11:15:27 +0200 Subject: [PATCH 22/26] Update readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e83dc3f..3099e62 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,12 @@ We publish every role version as a Docker image in Docker Hub: https://hub.docke You can pull our images by executing: ```bash -docker pull idealista/jdk:${JDK_VERSION}-${DOCKER_IMAGE_BASE}-(openjdk-headless) +docker pull idealista/jdk:${JDK_VERSION}-${DOCKER_IMAGE_BASE}-${JDK_VENDOR}headless) ``` `JDK_VERSION:` Preferred JDK version. `DOCKER_IMAGE`: Currently supporting: `stretch`/`buster` to select between Debian versions, `xenial`/`bionic`/`focal` to select between Ubuntu versions, and `7`/`8` to select a CentOS version. +`JDK_VENDOR`: Currently supporting `openjdk`/ `adoptopenjdk`/`corretto` For instance: @@ -122,13 +123,14 @@ CentOS 7 | `11` (default) CentOS 8 | `1.8.0` CentOS 8 | `11` (default) -Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see group vars in AdoptOpenJDK and Corretto molecule tests). +Other OpenJDK implementations out of GNU/Linux distributions streams are not officially supported, but it's easy use this role too adding extra repositories (see vars/ in AdoptOpenJDK and Corretto directories). ## Testing ```sh $ pipenv sync -$ DOCKER_IMAGE_BASE=(debian:stretch-slim|debian:buster-slim|amd64/ubuntu:xenial|amd64/ubuntu:bionic|amd64/ubuntu:focal|centos:7|centos:8) JDK_MAJOR=(`java_open_jdk_version_major` see [.travis.yml](.travis.yml) file to check supported versions) JDK_VERSION=(`java_open_jdk_version` see [.travis.yml](.travis.yml) file to check supported versions) pipenv run molecule test +$ DOCKER_IMAGE_BASE=(debian:stretch-slim|debian:buster-slim|amd64/ubuntu:xenial|amd64/ubuntu:bionic|amd64/ubuntu:focal|centos:7|centos:8) JDK_VENDOR=(`java_jdk_version` openjdk|adoptopenjdk|corretto) JDK_MAJOR=(`java_open_jdk_version_major` see [.travis.yml](.travis.yml) file to check supported versions) JDK_VERSION=(`java_open_jdk_version` see [.travis.yml](.travis.yml) file to check supported versions) pipenv run molecule test ``` +**Note:** JDK_VENDOR is an optional parameter, if not defined this role will use openjdk. **Note:** JDK_VERSION is an optional parameter, if not defined this role will install the latest available package for the selected Java major release. **Note:** debian9 (Debian Stretch) will be used as default linux distro if none is provided. From 8e3aa41bb092240d32936db4dea1e08f7722f56f Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 11:15:37 +0200 Subject: [PATCH 23/26] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b0f5a..56633e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) +### Added +- *[#138](https://github.com/idealista/java_role/issues/138) Support for adoptopenjdk and corretto for buster/centos8* @vicsufer +- *[#138](https://github.com/idealista/java_role/issues/138) Create images at dockerhub for adoptopenjdk and corretto* @vicsufer +### Changed +- *[#138](https://github.com/idealista/java_role/issues/138) Adapt adoptopenjdk and corretto test scenarios for future supported platforms. ### Fixed - *[#63](https://github.com/idealista/java_role/issues/63) Solve Ansible Galaxy Warnings* @vicsufer From b349e175acad509fb1d6fcfaac3ebeb0131fe7ba Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 4 Sep 2020 11:46:38 +0200 Subject: [PATCH 24/26] Adjust travis coretto version for test compatibility --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0cf5e1b..b89eb62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ env: - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=adoptopenjdk JDK_MAJOR=8 JDK_VERSION=8u265_b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-adoptopenjdk-headless # corretto - DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:8.265.01-1 DOCKER_TAG_TO_PUBLISH=8u265-buster-corretto-headless - - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1:1.8.0_265.b01-1 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless + - DOCKER_IMAGE_BASE=centos:8 JDK_VENDOR=corretto JDK_MAJOR=1.8.0 JDK_VERSION=1.8.0_265.b01 DOCKER_TAG_TO_PUBLISH=8u265-centos8-corretto-headless script: - pipenv run molecule test --scenario-name=${JDK_VENDOR:-default} notifications: From 0d843af1bcb46a25f4741625c37bebce21557859 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 11 Sep 2020 11:14:28 +0200 Subject: [PATCH 25/26] Update changelog for release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56633e5..18d1f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/java_role/tree/develop) + + +## [6.0.0](https://github.com/idealista/java_role/tree/6.1.0) (2020-09-11) +[Full Changelog](https://github.com/idealista/java_role/compare/6.0.0...6.1.0) ### Added - *[#138](https://github.com/idealista/java_role/issues/138) Support for adoptopenjdk and corretto for buster/centos8* @vicsufer - *[#138](https://github.com/idealista/java_role/issues/138) Create images at dockerhub for adoptopenjdk and corretto* @vicsufer From 60dd031c722b9ae472f9ce6aca346be3648fb0d5 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Fri, 11 Sep 2020 11:24:20 +0200 Subject: [PATCH 26/26] Fix changelog version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18d1f4f..cd1ee0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [Unreleased](https://github.com/idealista/java_role/tree/develop) -## [6.0.0](https://github.com/idealista/java_role/tree/6.1.0) (2020-09-11) +## [6.1.0](https://github.com/idealista/java_role/tree/6.1.0) (2020-09-11) [Full Changelog](https://github.com/idealista/java_role/compare/6.0.0...6.1.0) ### Added - *[#138](https://github.com/idealista/java_role/issues/138) Support for adoptopenjdk and corretto for buster/centos8* @vicsufer