-
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.
* weblogic * add weblogic scenario * inc galaxy yaml version * after review * remove artifactory_url * remove artifactory_url * update vars * after review and test * remove unnecessary var Co-authored-by: root <[email protected]> Co-authored-by: salob <[email protected]>
- Loading branch information
1 parent
bdf93f5
commit 93b49c8
Showing
29 changed files
with
905 additions
and
1 deletion.
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: | ||
weblogic_version: "12.1.3.0.210720" | ||
# weblogic_installer_path: /opt/IBM/weblogic/WLS | ||
download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" | ||
download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} | ||
roles: | ||
- weblogic |
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 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
pre_tasks: | ||
- name: include defaults | ||
include_vars: "../../roles/weblogic/defaults/main.yml" | ||
- name: include vars | ||
include_vars: "../../roles/weblogic/vars/v12.1.3.0.210720.yml" | ||
- stat: | ||
path: /opt/Props/AppServer.properties | ||
register: boot_props | ||
- name: Slurp profile.d | ||
slurp: | ||
src: /opt/profile.d/weblogic.sh | ||
register: env_oracle_sh | ||
- name: Slurp registry.xml | ||
slurp: | ||
src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml | ||
register: registry_xml | ||
- name: Check OPatch version | ||
shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" | ||
ignore_errors: True | ||
register: opatch_version_flag | ||
when: opatch_version is defined | ||
- name: Check if patched with correct patch | ||
become: yes | ||
become_user: "{{ weblogic_user }}" | ||
shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" | ||
changed_when: False | ||
when: patch_number is defined | ||
|
||
tasks: | ||
- name: Check that AppServer.properties exists | ||
assert: | ||
that: boot_props.stat.exists | ||
- name: Check that environment file has been created correctly | ||
assert: | ||
that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" | ||
- name: Check Weblogic Installed | ||
assert: | ||
that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" | ||
- name: Check OPatch version | ||
assert: | ||
that: opatch_version_flag.rc == 0 | ||
when: opatch_version is defined |
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: | ||
weblogic_version: "12.2.1.4.210716" | ||
# weblogic_installer_path: /opt/IBM/weblogic/WLS | ||
download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" | ||
download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} | ||
roles: | ||
- weblogic |
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 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
pre_tasks: | ||
- name: include defaults | ||
include_vars: "../../roles/weblogic/defaults/main.yml" | ||
- name: include vars | ||
include_vars: "../../roles/weblogic/vars/v12.2.1.4.210716.yml" | ||
- stat: | ||
path: /opt/Props/AppServer.properties | ||
register: boot_props | ||
- name: Slurp profile.d | ||
slurp: | ||
src: /opt/profile.d/weblogic.sh | ||
register: env_oracle_sh | ||
- name: Slurp registry.xml | ||
slurp: | ||
src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml | ||
register: registry_xml | ||
- name: Check OPatch version | ||
shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" | ||
ignore_errors: True | ||
register: opatch_version_flag | ||
when: opatch_version is defined | ||
- name: Check if patched with correct patch | ||
become: yes | ||
become_user: "{{ weblogic_user }}" | ||
shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" | ||
changed_when: False | ||
when: patch_number is defined | ||
|
||
tasks: | ||
- name: Check that AppServer.properties exists | ||
assert: | ||
that: boot_props.stat.exists | ||
- name: Check that environment file has been created correctly | ||
assert: | ||
that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" | ||
- name: Check Weblogic Installed | ||
assert: | ||
that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" | ||
- name: Check OPatch version | ||
assert: | ||
that: opatch_version_flag.rc == 0 | ||
when: opatch_version is defined |
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: | ||
weblogic_version: "14.1.1.0.210716" | ||
# weblogic_installer_path: /opt/IBM/weblogic/WLS | ||
download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" | ||
download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} | ||
roles: | ||
- weblogic |
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,44 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
pre_tasks: | ||
- name: include defaults | ||
include_vars: "../../roles/weblogic/defaults/main.yml" | ||
- name: include vars | ||
include_vars: "../../roles/weblogic/vars/v14.1.1.0.210716.yml" | ||
- stat: | ||
path: /opt/Props/AppServer.properties | ||
register: boot_props | ||
- name: Slurp profile.d | ||
slurp: | ||
src: /opt/profile.d/weblogic.sh | ||
register: env_oracle_sh | ||
- name: Slurp registry.xml | ||
slurp: | ||
src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml | ||
register: registry_xml | ||
- name: Check OPatch version | ||
shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" | ||
ignore_errors: True | ||
register: opatch_version_flag | ||
when: opatch_version is defined | ||
- name: Check if patched with correct patch | ||
become: yes | ||
become_user: "{{ weblogic_user }}" | ||
shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" | ||
changed_when: False | ||
when: patch_number is defined | ||
tasks: | ||
- name: Check that AppServer.properties exists | ||
assert: | ||
that: boot_props.stat.exists | ||
- name: Check that environment file has been created correctly | ||
assert: | ||
that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" | ||
- name: Check Weblogic Installed | ||
assert: | ||
that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" | ||
- name: Check OPatch version | ||
assert: | ||
that: opatch_version_flag.rc == 0 | ||
when: opatch_version is defined |
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: ../__weblogic-v12.1/converge.yml | ||
verify: ../__weblogic-v12.1/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: ../__weblogic-v14.1/converge.yml | ||
verify: ../__weblogic-v14.1/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,62 @@ | ||
# Weblogic | ||
|
||
The `weblogc` role will install Weblogic. | ||
|
||
## Requirements | ||
|
||
* CentOS-7/8, Redhat 7.x/8.x | ||
|
||
## Role Variables | ||
|
||
| Property Name | Default value | | ||
| ------------------------- | --------------------------------------------------- | | ||
| `weblogic_base` | `/home/oracle` | | ||
| `weblogic_home` | `/home/oracle/Oracle/Middleware/Oracle_Home` | | ||
| `server_port` | `7001` | | ||
| `download_url` | # Set this if license and installer is being downloaded from a http server| | ||
| `download_header` | # Use this in conjunction with `download_url` | | ||
| `weblogic_installer_path` | Controller local path or relative to download_url | | ||
| `weblogic_patch_path` | Controller local path or relative to download_url | | ||
| `java_zip_path` | Controller local path or relative to download_url | | ||
|
||
| ------------------------- | --------------------------------------------------- | | ||
| ** `weblogic_version` ** | `12.1.3.0.2` | | ||
| | `12.1.3.0.210720` | | ||
| | `12.2.1.4.210716` | | ||
| | `14.1.1.0.210716` | | ||
|
||
... | ||
|
||
## Dependencies | ||
|
||
Download WebLogic Server Installation packages and patch packages, and upload it to: wh-spmdevops-generic-local/SoftwareInstallers/WLS/ . | ||
|
||
## Example Playbook | ||
|
||
The following explains the structure of this role. | ||
tasks/main.yml | ||
- defaults/main.yml vars file is included (default weblogic_version is '14.1.1.0.210716' if no alternative is passed in with your ansible-playbook command) | ||
- runs: prereqs.yml | ||
- runs: install.yml | ||
- runs: patch.yml | ||
|
||
If the version specific var file includes a "opatch_file" variable is set an Opatch | ||
will be installed by including the run_opatch.yml task file. | ||
|
||
The version of the OPatch tool itself is also handed by the above tasks file. | ||
|
||
``` | ||
- hosts: servers | ||
roles: | ||
- role: ibm.spm_middleware.weblogic | ||
weblogic_version: 14.1.1.0.210716 | ||
``` | ||
|
||
## Note | ||
|
||
1. Default JDK version is 1.8.0_191. Required by Dev Team. | ||
2. We keep 12.1.3.0.2. This is not the latest version. Required by Dev Team. | ||
|
||
## 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,30 @@ | ||
--- | ||
weblogic_home: '/home/oracle/Oracle/Middleware/Oracle_Home' | ||
weblogic_user: 'oracle' | ||
weblogic_group: 'oinstall' | ||
weblogic_os_user_pass: 'oracle' | ||
weblogic_base: '/home/oracle' | ||
# If not passed in, use this default value | ||
weblogic_version: '14.1.1.0.210716' | ||
inv_loc: '/opt/Oracle/oraInventory' | ||
jdk_folder: '/usr/java' | ||
# Common paths and names | ||
domains_home: '{{ weblogic_base }}/config/Domains' | ||
applications_home: '{{ weblogic_base }}/config/applications' | ||
mw_installer_folder: '{{ weblogic_base }}/installer' | ||
domain_username: 'weblogic' | ||
domain_password: 'weblogic' | ||
encrypted_password: 'dummypassword' | ||
server_name: 'CuramServer' | ||
server_port: 7001 | ||
|
||
# To download installer, patches, opatch and java from http server set download_url | ||
# download_url: # e.g. https://artifactory/repo | ||
# download_header: # e.g. X-JFrog-Art-Api: "{{ lookup('env', 'MYTOKEN') }}" | ||
|
||
# Local controller path OR relative path to download_url | ||
weblogic_installer_path: WLS | ||
# Local controller path relative to weblogic_installer_path OR relative path to download_url/weblogic_installer_path | ||
weblogic_patch_path: Patches | ||
# Local controller path OR relative path to download_url | ||
java_zip_path: 'Java' |
Oops, something went wrong.