Artifactory Integration for Installers
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The SPM Middleware collection provides a robust mechanism for integrating with JFrog Artifactory to manage and retrieve software installers. This integration allows for a centralized repository of middleware binaries, such as IBM WebSphere, DB2, Oracle Database, and WebLogic, ensuring that installation processes are consistent across different environments. The system supports both local file system sourcing and remote downloading via Artifactory, controlled through environment variables and Ansible role parameters.
This integration is primarily used during the converge phase of Molecule testing and within production-ready Ansible roles to fetch large binary archives only when needed, reducing the size of the repository itself.
Sources: README.md:28-35, CONTRIBUTING.md:10-14
Configuration and Environment
To enable Artifactory integration, specific environment variables must be defined. These variables are typically injected into the development container via a .env file or exported in the shell environment.
Required Variables
| Variable | Description |
|---|---|
ARTIFACTORY_URL | The base URL of the Artifactory instance. |
ARTIFACTORY_REPO | The specific repository containing software installers. |
ARTIFACTORY_TOKEN | The authentication token (e.g., API Key) for Artifactory access. |
download_url | The full constructed URL used within Ansible tasks to point to the binary location. |
Sources: README.md:38-42, CONTRIBUTING.md:12-14, CONTRIBUTING.md:104-106
Authentication Header
The integration utilizes the download_header variable to pass authentication credentials. A common pattern involves using the X-JFrog-Art-Api header populated by a token stored in the environment.
Sources: ohs/defaults/main.yml:29-30
Download Logic and Data Flow
The middleware roles implement a conditional logic flow to determine whether to copy an installer from a local path or download it from Artifactory. This is primarily controlled by the presence of the download_url variable.
Installer Retrieval Flow
The following diagram illustrates the decision logic used across roles like websphere, ihs, and db2 to obtain binaries.
The workflow ensures that if a remote URL is provided, the get_url module is invoked with specific headers for secure communication with Artifactory.
Sources: roles/websphere/tasks/v90_base_install.yml:12-25, roles/db2/tasks/install.yml:14-25
Role-Specific Implementations
IBM WebSphere and IHS
For IBM products, the integration often involves downloading multiple zip archives that form a single repository for the IBM Installation Manager (IIM).
- Tasks: The tasks loop through a list of archives (e.g.,
websphere_base_archive_list) to download them to a temporary location/tmp/repo-zips. - Module: Uses
ansible.builtin.get_urlwith theheadersparameter.
Sources: roles/websphere/tasks/v90_base_install.yml:12-32, roles/ihs/tasks/v90_base_install.yml:11-30
Oracle Database and WebLogic
Oracle-related roles follow a similar pattern but often target different destination paths like /tmp/ or specific middleware installer folders.
- WebLogic: Downloads Java and WebLogic
.jarinstallers tomw_installer_folder. - Oracle 12c: Downloads base installers to
/tmp/and extracts them to/tmp/OracleInstaller.
Sources: roles/weblogic/tasks/prereqs.yml:76-83, roles/oracle/tasks/12c_install.yml:138-146
Sequence Diagram: Artifactory Retrieval
This diagram depicts the interaction between the Ansible Controller and the Artifactory server during a deployment.
Summary of Integration Parameters
All roles that support Artifactory integration share a consistent set of parameters for retrieval.
| Parameter | Task Module | Usage Example |
|---|---|---|
url | get_url | "{{ download_url }}/{{ path }}/{{ item }}" |
dest | get_url | "/tmp/repo-zips/{{ item }}" |
headers | get_url | "{{ download_header }}" |
force | get_url | no (to prevent re-downloading existing files) |
Sources: roles/oracle/tasks/12c_install.yml:141-144, roles/ohs/tasks/base_install.yml:61-64
Conclusion
Artifactory integration is a critical component of the spm-middleware project, enabling efficient management of large middleware binaries. By abstracting the source of installers behind the download_url and download_header variables, the project maintains flexibility between air-gapped local installations and cloud-based automated deployments. This approach is standardized across all major middleware roles, ensuring a uniform experience for developers and system administrators.