Skip to content

Commit

Permalink
WAS - Optional Download ( alternative to copy ) (#19)
Browse files Browse the repository at this point in the history
* add compose to our molecule test image

* first try - optio to download

* update readme

* remove db2 downloads from script

* refactor db2 11.1

* remove blank line from Travis

* add line to readme

* add new vars to readme

* follow on

* update galaxy version

* update readme

* update 8.5.5 molecule to also use download

* fix download script
  • Loading branch information
salob authored Oct 11, 2021
1 parent 40738df commit 90c629d
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 80 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace: ibm
name: spm_middleware

# The version of the collection. Must be compatible with semantic versioning
version: 1.0.6
version: 1.0.7

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
2 changes: 2 additions & 0 deletions molecule/__websphere-v85/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

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

roles:
- iim
Expand Down
2 changes: 2 additions & 0 deletions molecule/__websphere-v90/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

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

roles:
- iim
Expand Down
10 changes: 5 additions & 5 deletions roles/db2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ Ensure you update / override password variables prior to using the role.
| ------------------------- | --------------------------------------------------- |
| `db2_db_create` | `True` |
| `db2_db_name` | `DATABASE` |
| `db2_db_username` | `db2admin` |
| `db2_db_password` | `db2admin` |
| `db2_db_spm_enc` | `dummyPassword` |
| `db2_db_username` | `db2admin` |
| `db2_db_password` | `db2admin` |
| `db2_db_spm_enc` | `dummyPassword` |
| `db2_db_drop_required` | `False` |
| ------------------------- | --------------------------------------------------- |
| `bootstrap_dateformat` | `dd MM yyyy` |
| `bootstrap_dateseparator` | `/` |
| `bootstrap_dmx_locale` | `en_US` |
| ------------------------- | --------------------------------------------------- |
| `download_url` | # set this if license and installer is being downloaded from a http server |
| `download_header` | # Use this in conjunction with `download_url` |
| `download_url` | # set this if license and installer is being downloaded from a http server|
| `download_header` | # Use this in conjunction with `download_url` |
| ------------------------- | --------------------------------------------------- |


Expand Down
23 changes: 19 additions & 4 deletions roles/websphere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,33 @@ IBM Installation Manager (1.9.x) must already be installed in the target environ
| ------------------------ | --------------------------------------------------- |
| `iim_install_path` | `/opt/IBM/InstallationManager` |
| `profiled_path` | `/opt/profile.d` |
| ------------------------- | --------------------------------------------------- |
| `download_url` | # set this if license and installer is being downloaded from a http server|
| `download_header` | # Use this in conjunction with `download_url` |
| ------------------------- | --------------------------------------------------- |

## Dependencies

None
ibm.spm_middleware.iim

## Example Playbook

```
- hosts: servers
---
- name: Converge
hosts: all
collections:
- ibm.spm_middleware
vars:
websphere_version: 9.0.5.8
download_url: "https://myserver.com/was/repos"
download_header: { 'Authorization': 'Basic EncodedString'}
roles:
- role: spm_middleware.websphere
websphere_version: 9.0.5.7
- ibm.spm_middleware.iim
- ibm.spm_middleware.websphere
```

## License
Expand Down
8 changes: 5 additions & 3 deletions roles/websphere/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
# iim
iim_install_path: /opt/IBM/InstallationManager

# websphere
websphere_install_path: /opt/IBM/WebSphere/AppServer

websphere_version: 9.0.5.8

# Common
profiled_path: /opt/profile.d
# Server info for downloading installers / repos directly, leave blank to copy
download_url: # e.g. https://artifactory/repo
download_header: # e.g. X-JFrog-Art-Api: "{{ lookup('env', 'MYTOKEN') }}"
4 changes: 2 additions & 2 deletions roles/websphere/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Patch JspBatchCompiler
- name: Increase JspBatchCompiler Memory
replace:
path: "{{ websphere_install_path }}/bin/JspBatchCompiler.{{ 'bat' if ansible_os_family == 'Windows' else 'sh' }}"
path: "{{ websphere_install_path }}/bin/JspBatchCompiler.sh"
regexp: "-Xmx256m"
replace: "-Xmx1024m"
mode: 0755
3 changes: 0 additions & 3 deletions roles/websphere/tasks/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
path: "{{ profiled_path }}"
mode: 0755
state: directory
when: ansible_os_family != "Windows"

- name: "Create {{ profiled_path }}/websphere.sh"
copy:
Expand All @@ -21,7 +20,6 @@
J2EE_JAR=$WAS_HOME/lib/j2ee.jar
export J2EE_JAR
mode: 0755
when: ansible_os_family != "Windows"

- name: Create /opt/.profile
copy:
Expand All @@ -42,4 +40,3 @@
LANG=en_US.ISO-8859-1
umask 002
mode: 0755
when: ansible_os_family != "Windows"
32 changes: 30 additions & 2 deletions roles/websphere/tasks/fixpack_install.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
---
- name: Create zip directory
file:
path: /tmp/repo-zips
state: directory

- name: Copy WAS repo
copy:
src: "{{ websphere_fp_path }}/{{ item }}"
dest: "/tmp/repo-zips/{{ item }}"
loop: "{{ websphere_fp_archive_list }}"
when: download_url is not defined

- name: Download repo
get_url:
dest: "/tmp/repo-zips/{{ item }}"
url: "{{ download_url }}/{{ websphere_fp_path }}/{{ item }}"
headers: "{{ download_header }}"
loop: "{{ websphere_fp_archive_list }}"
when: download_url is defined

- name: Create repo directories
file:
path: /tmp/repo
Expand All @@ -9,12 +29,20 @@
src: "/tmp/repo-zips/{{ item }}"
dest: /tmp/repo
remote_src: yes
loop: "{{ zip_list }}"
loop: "{{ websphere_fp_archive_list }}"

- name: Install package
iim_package:
iim_path: "{{ iim_install_path }}"
product_id: "{{ pack_id }}"
product_id: "com.ibm.websphere.ND.{{ websphere_pid }}"
path: "{{ websphere_install_path }}"
repo: /tmp/repo
state: present

- name: Cleanup
file:
path: "{{ item }}"
state: absent
loop:
- /tmp/repo
- /tmp/repo-zips
4 changes: 0 additions & 4 deletions roles/websphere/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

- name: Install Fixpack version
include_tasks: fixpack_install.yml
vars:
zip_path: "{{ websphere_fp_path }}"
zip_list: "{{ websphere_fp_archive_list }}"
pack_id: "com.ibm.websphere.ND.{{ websphere_pid }}"
when: not iim_info.exact_installed

- name: Setup environment variables
Expand Down
33 changes: 27 additions & 6 deletions roles/websphere/tasks/v85_base_install.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
---
- name: Copy installers
- name: Create zip directory
file:
path: /tmp/repo-zips
state: directory

- name: Copy WAS repo
copy:
directory_mode: yes
remote_src: no
src: "/tmp/repo-zips/"
dest: "/tmp/repo-zips/"
src: "{{ websphere_base_path }}/{{ item }}"
dest: "/tmp/repo-zips/{{ item }}"
loop: "{{ websphere_base_archive_list }}"
when: download_url is not defined

- name: Download WAS repo
get_url:
dest: "/tmp/repo-zips/{{ item }}"
url: "{{ download_url }}/{{ websphere_base_path }}/{{ item }}"
headers: "{{ download_header }}"
loop: "{{ websphere_base_archive_list }}"
when: download_url is defined

- name: Create WAS repo directory
file:
Expand All @@ -24,8 +37,16 @@
- name: Install WAS
iim_package:
iim_path: "{{ iim_install_path }}"
product_id: com.ibm.websphere.ND.v85
product_id: "{{ websphere_base_pid }}"
path: "{{ websphere_install_path }}"
repo: /tmp/repo
state: present
when: "iim_info.packages | select('match', 'com.ibm.websphere.ND.*') | list | length == 0"

- name: Cleanup
file:
path: "{{ item }}"
state: absent
loop:
- /tmp/repo
- /tmp/repo-zips
49 changes: 38 additions & 11 deletions roles/websphere/tasks/v90_base_install.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
---
- name: Create temporary directory
- name: Create zip directory
file:
path: /tmp/repo-zips/
recurse: yes
mode: 0755
path: /tmp/repo-zips
state: directory

- name: Copy installers
- name: Copy WAS repo
copy:
directory_mode: yes
remote_src: no
src: "/tmp/repo-zips/"
dest: "/tmp/repo-zips/"
src: "{{ websphere_base_path }}/{{ item }}"
dest: "/tmp/repo-zips/{{ item }}"
loop: "{{ websphere_base_archive_list }}"
when: download_url is not defined

- name: Download WAS repo
get_url:
dest: "/tmp/repo-zips/{{ item }}"
url: "{{ download_url }}/{{ websphere_base_path }}/{{ item }}"
headers: "{{ download_header }}"
loop: "{{ websphere_base_archive_list }}"
when: download_url is defined

- name: Copy Java repo
copy:
src: "{{ websphere_java_path }}"
dest: "/tmp/repo-zips/java-repo.zip"
when: download_url is not defined

- name: Download Java repo
get_url:
url: "{{ download_url }}/{{ websphere_java_path }}"
dest: "/tmp/repo-zips/java-repo.zip"
headers: "{{ download_header }}"
when: download_url is defined

- name: Create WAS repo directories
file:
Expand Down Expand Up @@ -54,9 +73,17 @@
iim_package:
iim_path: "{{ iim_install_path }}"
product_id:
- com.ibm.websphere.ND.v90
- com.ibm.java.jdk.v8
- "{{ websphere_base_pid }}"
- "{{ websphere_java_pid }}"
path: "{{ websphere_install_path }}"
repo: "{{ repo_list }}"
state: present
when: "iim_info.packages | select('match', 'com.ibm.websphere.ND.*') | list | length == 0"

- name: Cleanup
file:
path: "{{ item }}"
state: absent
loop:
- /tmp/repo
- /tmp/repo-zips
1 change: 1 addition & 0 deletions roles/websphere/vars/v8.5.5.17.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
websphere_pid: v85_8.5.5017.20200205_1450

websphere_base_pid: com.ibm.websphere.ND.v85
websphere_base_path: WAS/8.5.5ND
websphere_base_archive_list:
- WAS_ND_V8.5.5_1_OF_3.zip
Expand Down
14 changes: 8 additions & 6 deletions roles/websphere/vars/v9.0.5.3.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
# FP Vars
websphere_pid: v90_9.0.5003.20200226_0941
websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP003.zip

# Base Vars
websphere_base_pid: com.ibm.websphere.ND.v90
websphere_base_path: WAS/9.0.5ND
websphere_base_archive_list:
- was.repo.90500.nd.zip

websphere_java_path: Java/IBM
websphere_java_version: 8.0-6.15
# Java Vars
websphere_java_path: Java/IBM/ibm-java-sdk-8.0-6.26-linux-x64-installmgr.zip
websphere_java_pid: com.ibm.java.jdk.v8
websphere_java_home: java/8.0

websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP003.zip
14 changes: 8 additions & 6 deletions roles/websphere/vars/v9.0.5.7.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
# FP Vars
websphere_pid: v90_9.0.5007.20210301_1241
websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP007.zip

# Base Vars
websphere_base_pid: com.ibm.websphere.ND.v90
websphere_base_path: WAS/9.0.5ND
websphere_base_archive_list:
- was.repo.90500.nd.zip

websphere_java_path: Java/IBM
websphere_java_version: 8.0-6.26
# Java Vars
websphere_java_path: Java/IBM/ibm-java-sdk-8.0-6.26-linux-x64-installmgr.zip
websphere_java_pid: com.ibm.java.jdk.v8
websphere_java_home: java/8.0

websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP007.zip
14 changes: 8 additions & 6 deletions roles/websphere/vars/v9.0.5.8.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
# FP Vars
websphere_pid: v90_9.0.5008.20210525_1601
websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP008.zip

# Base Vars
websphere_base_pid: com.ibm.websphere.ND.v90
websphere_base_path: WAS/9.0.5ND
websphere_base_archive_list:
- was.repo.90500.nd.zip

websphere_java_path: Java/IBM
websphere_java_version: 8.0-6.26
# Java Vars
websphere_java_path: Java/IBM/ibm-java-sdk-8.0-6.26-linux-x64-installmgr.zip
websphere_java_pid: com.ibm.java.jdk.v8
websphere_java_home: java/8.0

websphere_fp_path: WAS/9.0.5Fixpacks
websphere_fp_archive_list:
- 9.0.5-WS-WAS-FP008.zip
Loading

0 comments on commit 90c629d

Please sign in to comment.