Skip to content

Commit 4976897

Browse files
authored
Merge pull request #209 from idealista/develop
release 8.1.0
2 parents 9dd870c + f886c01 commit 4976897

27 files changed

+255
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ env:
5454
- DOCKER_IMAGE_BASE=quay.io/centos/centos:stream8 JDK_MAJOR=11 JDK_VERSION=11.0.13.0.8
5555
DOCKER_TAG_TO_PUBLISH=11.0.13.0.8-centos8-openjdk-headless
5656

57+
# SSL certificates scenario
58+
- DOCKER_IMAGE_BASE=debian:buster-slim JDK_VENDOR=openjdk-certs
59+
5760
# Java 17
5861
- DOCKER_IMAGE_BASE=debian:bullseye-slim DOCKER_TAG_TO_PUBLISH=17-bullseye-openjdk-headless
5962
- DOCKER_IMAGE_BASE=debian:bullseye-slim JDK_MAJOR=17 JDK_VERSION=17.0.6+10-1~deb11u1

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
44

55
## [Unreleased](https://github.com/idealista/java_role/tree/develop)
66

7+
## [8.1.0](https://github.com/idealista/java_role/tree/8.1.0) (2023-06-22)
8+
### Added
9+
- *[#207](https://github.com/idealista/java_role/issues/207) Add support for import SSL certificates into Java's truststore* @emepege
10+
711
## [8.0.0](https://github.com/idealista/java_role/tree/8.0.0) (2022-08-10)
812
[Full Changelog](https://github.com/idealista/java_role/compare/7.1.0...8.0.0)
913
### Added

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ CentOS 8 | `1.8.0`
124124
CentOS 8 | `11` (default)
125125

126126
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).
127+
128+
### Adding certificates into Java's truststore
129+
130+
This role supports adding certificates into Java's truststore. Truststore location may change depending on Java version:
131+
132+
- Truststore location for Java 9 onwards: $JAVA_HOME/lib/security/cacerts
133+
- Truststore location for Java prior to 9: $JAVA_HOME/jre/lib/security/cacerts
134+
135+
A specific truststore location should be selected overriding `java_keystore_dir` variable using group vars/host vars. In addition, you must to set which certificates you want to add setting `java_certs` variable and the truststore password setting `java_cert_keystore_pass`
136+
127137
## Testing
128138

129139
```sh

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ java_jdk_vendor: openjdk
33

44
java_open_jdk_apt_extra_packages: []
55
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }}
6+
7+
# java_certs:
8+
# - java_cert_path: /path/to/cert/ssl.crt
9+
# java_cert_alias: ssl
10+
#
11+
# java_cert_keystore_pass: changeit

molecule/openjdk-certs/Dockerfile.j2

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Molecule managed
2+
3+
{% if item.registry is defined %}
4+
FROM {{ item.registry.url }}/{{ item.image }}
5+
{% else %}
6+
FROM {{ item.image }}
7+
{% endif %}
8+
9+
RUN mkdir -p /usr/share/man/man1
10+
RUN if [ $(command -v apt-get) ]; then sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' /etc/apt/apt.conf.d/docker-clean; fi
11+
12+
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 sudo bash ca-certificates && apt-get clean; \
13+
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \
14+
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
15+
elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \
16+
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi

molecule/openjdk-certs/converge.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
3+
- name: Converge
4+
hosts: openjdk
5+
roles:
6+
- java_role

molecule/openjdk-certs/files/ssl.crt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIDETCCAfkCFCDQip+sJfpHN2tcLCd8SgKRWlcEMA0GCSqGSIb3DQEBCwUAMEUx
3+
CzAJBgNVBAYTAkVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
4+
cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjMwNjA1MTEwNTE3WhcNMjMwNzA1MTEw
5+
NTE3WjBFMQswCQYDVQQGEwJFUzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE
6+
CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOC
7+
AQ8AMIIBCgKCAQEAsZotx9CdrUH2SwzmKlRQJVeD40tvnP/tX66i2gNgkFy4hpac
8+
kl9fcdTKNkLdLpl5hola+FJNQpDnUGToQRY2x2XtmnqKA/vGpXZVLizH6rxy5YAj
9+
5cjR2tYt89P2URXGVU5+8AJWANh1bONln4Qu8UOP6/AVlTrWl79nlOBqj+6rsVOW
10+
HgzdqE0hJnoKcVlTGb0OPnYNjDcsfLz9FJYgbPognhDk4EBD3GqJt5+J9ijXaiWh
11+
Q4rJ8/vInJt6Boqdz7KtCfD/VeWwLJDmtihJ6lseyo9WU2umPdOPz20Thk1k+VkN
12+
zpUvDS+bmQqQxlOiZi+1Z7OZaTNRfxVytEy3IwIDAQABMA0GCSqGSIb3DQEBCwUA
13+
A4IBAQA85o3erbRCnqJg70E7z19+F/o8Tg0cnl3oHU1GbAOrkzcxzcHLH05dN+BT
14+
bUGr//E+hgICeh14bDBCwtO3K2oDBRC82pYnTsDIK1my90fEQmvDMi+K/o4xw0pM
15+
yQBYmpnggS5+NJExx+MNBUUnAdQ0eH/wTyABz9PJL8MT8VR5K5/XIQCZYLwxyWYb
16+
4ga5ZQN5Jg9J2Dc/BIfLUXJavkIT2TINYDB6uhu6XeT5Qa0l+n621bMTle8ygleP
17+
CjasBNJsjgYNJi/1rO2DChKCPAAiObqHL+Wu0fdcHk+H5bDxoHXqil7s9l9hhv74
18+
oZFRmw2LG75mEonyXB90R2e9ZPXi
19+
-----END CERTIFICATE-----
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
java_certs:
4+
- java_cert_path: /tmp/ssl.crt
5+
java_cert_alias: ssl
6+
7+
java_cert_keystore_pass: changeit

molecule/openjdk-certs/molecule.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
7+
lint: |
8+
yamllint .
9+
ansible-lint .
10+
11+
platforms:
12+
- name: openjdktest
13+
groups:
14+
- openjdk
15+
image: ${DOCKER_IMAGE_BASE:-debian:buster-slim}
16+
17+
provisioner:
18+
name: ansible
19+
inventory:
20+
group_vars:
21+
openjdk:
22+
java_jdk_vendor: openjdk
23+
java_open_jdk_version: ${JDK_VERSION}
24+
java_open_jdk_version_major: ${JDK_MAJOR}
25+
scenario:
26+
name: openjdk-certs
27+
verifier:
28+
name: ansible

molecule/openjdk-certs/prepare.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- name: Prepare
3+
hosts: openjdktest
4+
gather_facts: false
5+
tasks:
6+
- name: Copy SSL certificate
7+
copy:
8+
src: "{{ playbook_dir }}/files/ssl.crt"
9+
dest: /tmp/ssl.crt

0 commit comments

Comments
 (0)