Ansible Role: WebSphere Liberty
Relevant source files
The following files were used as context for generating this wiki page:
The WebSphere Liberty role is a component of the merative.spm_middleware collection designed to automate the installation and configuration of IBM WebSphere Liberty. This role is intended for use in internal test and development environments for Cúram Social Program Management (SPM) applications. It leverages the IBM Installation Manager (IIM) to manage software packages and ensures that the middleware environment is correctly provisioned with required fixpacks and Java Development Kits (JDK).
Sources: roles/liberty/README.md:1-5, README.md:1-5, galaxy.yml:21-23
Role Overview and Platform Support
The role is authored by the SPM DevOps Team and is licensed under the MIT license. It supports Enterprise Linux (EL) versions 7 and 8 and requires a minimum Ansible version of 2.9. While it can be run as part of a larger playbook, it has a strict requirement that IBM Installation Manager (1.9.x) is already present on the target host.
Sources: roles/liberty/meta/main.yml:1-30, roles/liberty/README.md:7-9
Installation Logic and Workflow
The installation process is modular, branching based on the current state of the system as detected by the iim_info module. The workflow encompasses base installation, fixpack application, and JDK provisioning.
Execution Flow
The following diagram illustrates the decision logic within the main task execution:
Sources: roles/liberty/tasks/main.yml:2-55
Component Details
- Version Management: The role dynamically includes variables based on the
liberty_versionprovided, allowing for flexible version targeting. - Package Verification: Uses the
iim_infomodule to register the status ofcom.ibm.websphere.liberty.NDproducts. - JDK Installation: Supports two methods: using IIM repositories or manually unarchiving a JDK zip file into the
java/subdirectory of the installation path. - System Configuration: Creates a standardized
/opt/Propsdirectory and deploysAppServer.propertiesandjvm.optionstemplates.
Sources: roles/liberty/tasks/main.yml:2-10, roles/liberty/tasks/main.yml:23-45
Configuration and Variables
The role's behavior is governed by several variables that define installation paths, memory settings, and download locations.
| Property Name | Default Value | Description |
|---|---|---|
liberty_install_path | /opt/IBM/WebSphere/Liberty | Directory where Liberty will be installed. |
liberty_version | 24.0.0.12 | Target version of WebSphere Liberty. |
liberty_default_heapsize | 1024m | Default JVM heap size setting. |
liberty_enable_verbose_gc | false | Toggles verbose Garbage Collection logging. |
liberty_extra_jvm_options | [] | List of additional JVM arguments. |
iim_install_path | /opt/IBM/InstallationManager | Path to the existing IBM Installation Manager. |
download_url | N/A | HTTP server URL for downloading installation media. |
Sources: roles/liberty/README.md:11-25
Environment Provisioning
Post-installation, the role configures the environment to ensure the Liberty server is ready for SPM workloads. This includes rendering the jvm.options file which incorporates the heap size and extra options defined in the variables.
- name: Render jvm.options
template:
src: jvm.options.j2
dest: "{{ liberty_install_path }}/usr/shared/jvm.options"
mode: 0644
Sources: roles/liberty/tasks/main.yml:64-68
Additionally, the role establishes environment files via env.yml (included in main tasks) and sets up the global properties file at /opt/Props/AppServer.properties.
Sources: roles/liberty/tasks/main.yml:50-62
Usage Example
The role is typically invoked within a playbook by specifying the merative.spm_middleware.liberty role and the desired version.
- hosts: servers
roles:
- role: merative.spm_middleware.liberty
liberty_version: 24.0.0.12
Sources: roles/liberty/README.md:31-36
Conclusion
The Ansible Role for WebSphere Liberty provides a structured and automated approach to deploying IBM's lightweight application server. By integrating with IBM Installation Manager and providing multiple paths for JDK management, it ensures a consistent environment for Social Program Management middleware stacks.