Skip to content

Commit

Permalink
Java mod (#71)
Browse files Browse the repository at this point in the history
* add open-liberty folders

* passed molecule test

* remove iim verify

* cleanup

* no clean up

* ibm jdk 17 tested

* delete open-liberty

* verify v17

* update readme

* remove hardcode version
  • Loading branch information
huangjien authored Feb 27, 2024
1 parent 21ef9a3 commit b16b702
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- ihs-v90-rockylinux8
- ohs-v12.2.1-rockylinux8
- liberty-rockylinux8
- liberty-jdk17-rockylinux8
- weblogic-rockylinux8
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: spm_middleware

# The version of the collection. Must be compatible with semantic versioning
# Please note. version also exists in /github/workflows/release.yml and will need to be update also
version: 1.4.5
version: 1.5.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
1 change: 1 addition & 0 deletions molecule/__liberty/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- merative.spm_middleware

vars:
liberty_version: "23.0.0.12"
download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers"
download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"}

Expand Down
15 changes: 15 additions & 0 deletions molecule/__liberty17/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Converge
hosts: all

collections:
- merative.spm_middleware

vars:
liberty_version: "23.0.0.12-JDK17"
download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers"
download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"}

roles:
- iim
- liberty
31 changes: 31 additions & 0 deletions molecule/__liberty17/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
# The pre_tasks section is used to perform some tasks before the main tasks run.
# It's a good place for setup tasks or data collection.
pre_tasks:
- name: Check packages
# Assuming 'iim_info' module is part of the 'iim' role or a custom module.
# If it's a custom module, ensure that it's properly located in the 'library' directory inside the role.
iim_info:
iim_path: /opt/IBM/InstallationManager
register: iim_info
- name: Get jvm.options
slurp:
src: /opt/IBM/WebSphere/Liberty/usr/shared/jvm.options
register: jvm_options

tasks:
- name: Check that the correct packages are installed
# Using 'assert' module to validate conditions.
assert:
that:
- "iim_info.packages | select('match', 'com.ibm.websphere.liberty.ND.*') | list | length > 0"
- "iim_info.packages | select('match', 'com.ibm.java.jdk.v17.*') | list | length > 0"
- name: Check that jvm.options contains the expected content
# Using 'assert' module to check if '-Xmx1024m' is present in 'jvm.options' file.
assert:
that:
- "'-Xmx1024m' in (jvm_options['content'] | b64decode)"
34 changes: 34 additions & 0 deletions molecule/liberty-jdk17-rockylinux8/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
driver:
name: docker
provider:
name: docker

lint: |
set -e
yamllint .
platforms:
- name: rockylinux8
image: rockylinux:8
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: False
privileged: True
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
environment:
container: docker

provisioner:
name: ansible
log: true
config_options:
defaults:
stderr_callback: debug
stdout_callback: debug
env:
ANSIBLE_FORCE_COLOR: 'true'
playbooks:
converge: ../__liberty17/converge.yml
verify: ../__liberty17/verify.yml
4 changes: 2 additions & 2 deletions roles/liberty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IBM Installation Manager (1.9.x) must already be installed in the target environ
| Property Name | Default value |
| ----------------------- | --------------------------------------------------- |
| `liberty_install_path` | `/opt/IBM/WebSphere/Liberty` |
| `liberty_version` | `23.0.0.12` |
| `liberty_version` | `23.0.0.12`, `23.0.0.12-JDK17` |
| `liberty_default_heapsize` | `1024m` |
| `liberty_enable_verbose_gc` | `false` |
| `liberty_extra_jvm_options` | `[]` |
Expand All @@ -37,7 +37,7 @@ None
- hosts: servers
roles:
- role: merative.spm_middleware.liberty
liberty_version: 19.0.0.12
liberty_version: 23.0.0.12
```

## License
Expand Down
2 changes: 2 additions & 0 deletions roles/liberty/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ liberty_install_path: /opt/IBM/WebSphere/Liberty

liberty_version: 23.0.0.12

jdk_version: 8.0

# Default JVM Options
liberty_default_heapsize: 1024m
liberty_enable_verbose_gc: false
Expand Down
2 changes: 1 addition & 1 deletion roles/liberty/tasks/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
WLP_HOME={{ liberty_install_path }}
export WLP_HOME
JAVA_HOME={{ liberty_install_path }}/java/8.0
JAVA_HOME={{ liberty_install_path }}/java/{{ jdk_version }}
export JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH:$WLP_HOME/bin
mode: 0755
Expand Down
8 changes: 8 additions & 0 deletions roles/liberty/vars/v23.0.0.12-JDK17.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
liberty_fp_path: WLP/23.0.0.12-WS-LIBERTY-ND-FP.zip
liberty_installers_path: WLP/was.repo.16002.liberty.nd.zip
liberty_pid: 23.0.12.20231127_1901
jdk_version: 17.0

liberty_java_zip_path: Java/IBM/ibm-semeru-certified-jdk_x64_linux_17.0.10.0-installmgr.zip
liberty_java_pid: com.ibm.java.jdk.v17_17.0.10000.20240208_1032

0 comments on commit b16b702

Please sign in to comment.