Ansible Role: IBM WebSphere (WAS)
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The websphere role is a core component of the spm-middleware collection, designed to automate the installation and configuration of IBM WebSphere Application Server Network Deployment (ND). It serves as a critical middleware layer for hosting Cúram Social Program Management (SPM) applications. The role handles the lifecycle of the WebSphere installation, including base software deployment, fixpack application, and environment variable setup.
This role operates within the merative.spm_middleware namespace and is specifically tailored for internal test and development environments. It relies heavily on the IBM Installation Manager (IIM) for package management and supports Enterprise Linux (EL) platforms, specifically versions 7 and 8.
Sources: roles/websphere/README.md:1-5, roles/websphere/meta/main.yml:23-28, README.md:3-5
Role Architecture and Lifecycle
The role follows a structured execution path that first verifies the presence of prerequisites and then proceeds through installation and configuration phases. It utilizes the iim_info module to detect existing installations before attempting to apply changes.
Installation Workflow
The workflow is divided into base installation and fixpack updates. The logic branches based on the major version of WebSphere being installed (e.g., v8.5 or v9.0).
Sources: roles/websphere/tasks/main.yml:2-42
Version-Specific Implementation
- WebSphere v9.0: Involves downloading/copying both the WAS ND repo and the Java SDK repo. It creates separate directories for each repository and uses
iim_packageto install both simultaneously. - WebSphere v8.5: Focuses on the WAS ND repository, extracting installers into a single directory structure before invoking the Installation Manager.
Sources: roles/websphere/tasks/v90_base_install.yml:5-65, roles/websphere/tasks/v85_base_install.yml:5-45
Role Variables and Configuration
The role's behavior is governed by a set of variables defining paths, versions, and source locations for installers.
Default Variables
| Property Name | Default Value | Description |
|---|---|---|
websphere_install_path | /opt/IBM/WebSphere/AppServer | Target directory for WAS installation. |
websphere_version | 9.0.5.22 | The specific version of WAS to be deployed. |
iim_install_path | /opt/IBM/InstallationManager | Path to the required IBM Installation Manager. |
profiled_path | /opt/profile.d | Directory for environment shell scripts. |
download_url | (Undefined) | HTTP URL for downloading installers/licenses. |
download_header | (Undefined) | Authorization headers for the download_url. |
Sources: roles/websphere/README.md:9-21
Environment and Property Files
The role ensures that the WebSphere environment is integrated into the system by:
- Creating the
/opt/Propsdirectory. - Deploying the
AppServer.propertiesfile from a J2 template. - Configuring system-wide environment variables (e.g.,
WAS_HOMEandJAVA_HOME) within/opt/profile.d/websphere.sh.
Sources: roles/websphere/tasks/main.yml:26-37, molecule/__websphere-v90/verify.yml:32-38
Dependencies and Requirements
The websphere role has strict dependencies on other roles within the collection and specific software on the target host.
- Primary Dependency:
merative.spm_middleware.iim. IBM Installation Manager (1.9.x or higher) must be installed prior to running the WebSphere role. - Platform Support: The role is validated for EL (Enterprise Linux) versions 7 and 8.
- Python Requirement: The
iim_infoandiim_packagemodules require the Ansible controller and target to meet minimum version standards.
Sources: roles/websphere/README.md:7-8, 23-24, roles/websphere/meta/main.yml:13, 23-28
Implementation Details
The following YAML snippet illustrates how the role is typically invoked within a playbook, ensuring the prerequisite IIM role is executed first.
- name: Converge
hosts: all
collections:
- merative.spm_middleware
vars:
websphere_version: 9.0.5.22
download_url: "https://myserver.com/was/repos"
download_header: { 'Authorization': 'Basic EncodedString'}
roles:
- merative.spm_middleware.iim
- merative.spm_middleware.websphere
Sources: roles/websphere/README.md:28-42
Summary
The Ansible Role for IBM WebSphere (WAS) provides a standardized, repeatable method for deploying the application server infrastructure required by SPM. By encapsulating version-specific logic and leveraging IBM Installation Manager, it ensures that base installations and fixpacks are applied consistently across development and testing environments. The role further integrates WebSphere into the host environment through automated property file generation and environment variable configuration.