-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Liberty role migration+alternative download (#25)
* Liberty v1 * add liberty to tests * change header * fix java path * return other tests * Update README.md * clean up * sian review READMEs/comments Co-authored-by: Roman Muntean <[email protected]>
- Loading branch information
Showing
20 changed files
with
460 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
|
||
collections: | ||
- ibm.spm_middleware | ||
|
||
vars: | ||
download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" | ||
download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} | ||
|
||
roles: | ||
- iim | ||
- liberty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# This is an example playbook to execute Ansible tests. | ||
|
||
- name: Verify | ||
hosts: all | ||
pre_tasks: | ||
- name: Check packages | ||
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 | ||
assert: | ||
that: | ||
- "iim_info.packages | select('match', 'com.ibm.websphere.liberty.ND.*') | list | length > 0" | ||
- "iim_info.packages | select('match', 'com.ibm.java.jdk.v8.*') | list | length > 0" | ||
- name: Check that jvm.options contains the expected content | ||
assert: | ||
that: | ||
- "'-Xmx1024m' in (jvm_options['content'] | b64decode)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: centos-7 | ||
image: centos:7 | ||
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: ../__liberty/converge.yml | ||
verify: ../__liberty/verify.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: centos-8 | ||
image: centos: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: ../__liberty/converge.yml | ||
verify: ../__liberty/verify.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# liberty | ||
|
||
The `liberty` role will install IBM WebSphere Liberty. | ||
|
||
## Requirements | ||
|
||
IBM Installation Manager (1.9.x) must already be installed in the target environment. | ||
|
||
## Role Variables | ||
|
||
| Property Name | Default value | | ||
| ----------------------- | --------------------------------------------------- | | ||
| `liberty_install_path` | `/opt/IBM/WebSphere/Liberty` | | ||
| `liberty_version` | `21.0.0.9` | | ||
| `liberty_default_heapsize` | `1024m` | | ||
| `liberty_enable_verbose_gc` | `false` | | ||
| `liberty_extra_jvm_options` | `[]` | | ||
| ----------------------- | --------------------------------------------------- | | ||
| `iim_install_path` | `/opt/IBM/InstallationManager` | | ||
| `profiled_path` | `/opt/profile.d` | | ||
|
||
| `download_url` | # Set this if installation zips are being downloaded from a http server| | ||
| `download_header` | # Use this in conjunction with `download_url` | | ||
|
||
| `liberty_installers_path`| # Set these to your downloaded zip filepath if copying from local| | ||
| `liberty_fp_path` | # Set to remote filepath if downloading | | ||
| `liberty_java_zip_path` | | | ||
| ------------------------ | -----------------------------------------------------------------| | ||
|
||
## Dependencies | ||
|
||
None | ||
|
||
## Example Playbook | ||
|
||
``` | ||
- hosts: servers | ||
roles: | ||
- role: ibm.spm_middleware.liberty | ||
liberty_version: 19.0.0.12 | ||
``` | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
iim_install_path: /opt/IBM/InstallationManager | ||
|
||
liberty_install_path: /opt/IBM/WebSphere/Liberty | ||
|
||
liberty_version: 21.0.0.9 | ||
|
||
# Default JVM Options | ||
liberty_default_heapsize: 1024m | ||
liberty_enable_verbose_gc: false | ||
liberty_extra_jvm_options: [] | ||
|
||
# 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') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## APPLICATION SERVER PROPERTIES | ||
|
||
## IT IS VERY IMPORTANT TO USE '/' FOR DIRECTORY PATHS. ## | ||
|
||
# Property to indicate whether WLS/SAP or WAS is installed. | ||
as.vendor=WLP | ||
|
||
# The username and password for admin server. | ||
security.username=websphere | ||
# Encrypt the plain-text password using 'build encrypt -Dpassword=<password>' | ||
# Below is the encryption for the default password ("websphere") | ||
security.password=XOVRjjVTebM8gV953LGMLQ== | ||
|
||
# The name of the WebSphere Node or WebLogic Domain Name. | ||
node.name=liberty | ||
|
||
# The name of the server on which the application will be hosted. | ||
curam.server.name=CuramServer | ||
curam.server.port=2809 | ||
|
||
############################################### | ||
## THE FOLLOWING PROPERTIES ARE FOR WAS ONLY ## | ||
############################################### | ||
# The alias that should be used for the database authorization | ||
curam.db.auth.alias=databaseAlias | ||
|
||
# HTTP Port for the server on which the client | ||
# will be accessed | ||
curam.client.httpport=10101 | ||
|
||
# HTTP Port for the server on which the Web services | ||
# will be accessed | ||
curam.webservices.httpport=10102 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
galaxy_info: | ||
author: SPM DevOps Team | ||
description: Install WebSphere Liberty. | ||
company: Watson Health SPM | ||
|
||
# If the issue tracker for your role is not on github, uncomment the | ||
# next line and provide a value | ||
# issue_tracker_url: http://example.com/issue/tracker | ||
|
||
license: MIT | ||
|
||
min_ansible_version: 2.9 | ||
|
||
# | ||
# Provide a list of supported platforms, and for each platform a list of versions. | ||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
# To view available platforms and versions (or releases), visit: | ||
# https://galaxy.ansible.com/api/v1/platforms/ | ||
# | ||
platforms: | ||
- name: EL | ||
versions: | ||
- 7 | ||
- 8 | ||
|
||
galaxy_tags: | ||
[] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
|
||
dependencies: | ||
[] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
- name: Download Liberty repo | ||
get_url: | ||
dest: /tmp/repo.zip | ||
url: "{{ download_url }}/{{ liberty_installers_path }}" | ||
headers: "{{ download_header }}" | ||
when: download_url is defined | ||
|
||
- name: Create repo directory | ||
file: | ||
path: /tmp/repo | ||
state: directory | ||
|
||
- name: Copy Liberty installer repo | ||
copy: | ||
src: "{{ liberty_installers_path }}" | ||
dest: "/tmp/repo.zip" | ||
when: download_url is not defined | ||
|
||
- name: Extract Liberty installers | ||
unarchive: | ||
src: /tmp/repo.zip | ||
dest: /tmp/repo | ||
remote_src: yes | ||
creates: /tmp/repo/repository.config | ||
|
||
- name: Install Liberty | ||
iim_package: | ||
iim_path: "{{ iim_install_path }}" | ||
product_id: com.ibm.websphere.liberty.ND | ||
path: "{{ liberty_install_path }}" | ||
repo: /tmp/repo | ||
state: present | ||
|
||
- name: Cleanup | ||
file: | ||
path: "{{ item }}" | ||
state: absent | ||
loop: | ||
- /tmp/repo | ||
- /tmp/repo.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
- name: "Create {{ profiled_path }}" | ||
file: | ||
path: "{{ profiled_path }}" | ||
mode: 0755 | ||
state: directory | ||
when: ansible_os_family != "Windows" | ||
|
||
- name: "Create {{ profiled_path }}/liberty.sh" | ||
copy: | ||
dest: "{{ profiled_path }}/liberty.sh" | ||
content: | | ||
#!/bin/bash | ||
WLP_HOME={{ liberty_install_path }} | ||
export WLP_HOME | ||
JAVA_HOME={{ liberty_install_path }}/java/8.0 | ||
export JAVA_HOME | ||
export PATH=$JAVA_HOME/bin:$PATH:$WLP_HOME/bin | ||
mode: 0755 | ||
when: ansible_os_family != "Windows" | ||
|
||
- name: Create /opt/.profile | ||
copy: | ||
dest: /opt/.profile | ||
content: | | ||
#!/bin/bash | ||
PATH=.:$PATH | ||
if [ -e {{ profiled_path }} ]; then | ||
if [ "$PS1" ]; then | ||
ls -l {{ profiled_path }}/*.sh | ||
fi | ||
for lizard in {{ profiled_path }}/*.sh ; do | ||
. $lizard | ||
done | ||
fi | ||
LANG=en_US.ISO-8859-1 | ||
umask 002 | ||
mode: 0755 | ||
when: ansible_os_family != "Windows" |
Oops, something went wrong.