The playbook is going to cover and automate all the tasks of weblogic installation.
before that let us create below response file and copy at software location.
vi wls_install.rsp
[ENGINE]
Response File Version=1.0.0.0.0
[GENERIC]
ORACLE_HOME=/u01/fmw/oracle/middleware
INSTALL_TYPE=Fusion Middleware Infrastructure
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
DECLINE_SECURITY_UPDATES=true
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
COLLECTOR_SUPPORTHUB_URL=
You can see the work flow of FMW installation.
cat wls_install.yml
---
#Install Weblogic
- hosts: all
remote_user: oracle
vars:
java_dir: /u01/fmw/java/jdk1.8.0_291
hibernate_dir: /u01/fmw/hibernate-4.1.0
mw_dir: /tmp
mw_installer: fmw_12.2.1.3.0_infrastructure.jar
oracle_home: /u01/fmw/oracle/middleware
mw_oraInv: /scratch/oracle/oraInventory
tasks:
- name: Install Weblogic
command: "{{ java_dir }}/bin/java -jar {{ mw_dir }}/{{ mw_installer }} -silent -responseFile {{ mw_dir }}/wls_install.rsp -invPtrLoc {{ mw_oraInv }}/oraInst.loc"
register: command_result
- debug: msg={{ command_result.stdout.split('\n')[:-1]}}
- name: Wait for installation complete
pause:
minutes: 3
Syntax check:
# ansible-playbook wls_install.yml --syntax-check
playbook: wls_install.yml
Call ansible play book :
# ansible-playbook wls_install.yml
PLAY [all] *************************************************************************************
TASK [Gathering Facts] *************************************************************************************
ok: [ 192.168.100.2]
ok: [ 192.168.100.1]
TASK [Install Weblogic] *************************************************************************************
changed: [ 192.168.100.2]
changed: [ 192.168.100.1]
TASK [debug] *************************************************************************************
ok: [ 192.168.100.1] => {
"msg": [
"Launcher log file is /tmp/OraInstall2021-11-16_03-37-14PM/launcher2021-11-16_03-37-14PM.log.",
"Extracting the installer . . . . . . . . . . . Done",
"Checking if CPU speed is above 300 MHz. Actual 1995.312 MHz Passed",
"Checking swap space: must be greater than 512 MB. Actual 16191 MB Passed",
"Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)",
"Checking temp space: must be greater than 300 MB. Actual 21984 MB Passed",
"Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2021-11-16_03-37-14PM",
"Log: /tmp/OraInstall2021-11-16_03-37-14PM/install2021-11-16_03-37-14PM.log",
"Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.",
"Reading response file..",
"Skipping Software Updates",
"Starting check : CertifiedVersions",
"Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12",
"Actual Result: oracle-7.8",
"Check complete. The overall result of this check is: Passed",
"CertifiedVersions Check: Success.",
"",
"",
"Starting check : CheckJDKVersion",
"Expected result: 1.8.0_131",
"Actual Result: 1.8.0_291",
"Check complete. The overall result of this check is: Passed",
"CheckJDKVersion Check: Success.",
"",
"",
"Validations are enabled for this session.",
"Verifying data",
"Copying Files",
"Percent Complete : 10",
"Percent Complete : 20",
"Percent Complete : 30",
"Percent Complete : 40",
"Percent Complete : 50",
"Percent Complete : 60",
"Percent Complete : 70",
"Percent Complete : 80",
"Percent Complete : 90",
"Percent Complete : 100",
"",
"The installation of Oracle Fusion Middleware 12c Infrastructure 12.2.1.3.0 completed successfully."
]
}
ok: [ 192.168.100.2] => {
"msg": [
"Launcher log file is /tmp/OraInstall2021-11-16_03-37-14PM/launcher2021-11-16_03-37-14PM.log.",
"Extracting the installer . . . . . . . . Done",
"Checking if CPU speed is above 300 MHz. Actual 1995.312 MHz Passed",
"Checking swap space: must be greater than 512 MB. Actual 16191 MB Passed",
"Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)",
"Checking temp space: must be greater than 300 MB. Actual 22337 MB Passed",
"Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2021-11-16_03-37-14PM",
"Log: /tmp/OraInstall2021-11-16_03-37-14PM/install2021-11-16_03-37-14PM.log",
"Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.",
"Reading response file..",
"Skipping Software Updates",
"Starting check : CertifiedVersions",
"Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12",
"Actual Result: oracle-7.8",
"Check complete. The overall result of this check is: Passed",
"CertifiedVersions Check: Success.",
"",
"",
"Starting check : CheckJDKVersion",
"Expected result: 1.8.0_131",
"Actual Result: 1.8.0_291",
"Check complete. The overall result of this check is: Passed",
"CheckJDKVersion Check: Success.",
"",
"",
"Validations are enabled for this session.",
"Verifying data",
"Copying Files",
"Percent Complete : 10",
"Percent Complete : 20",
"Percent Complete : 30",
"Percent Complete : 40",
"Percent Complete : 50",
"Percent Complete : 60",
"Percent Complete : 70",
"Percent Complete : 80",
"Percent Complete : 90",
"Percent Complete : 100",
"",
"The installation of Oracle Fusion Middleware 12c Infrastructure 12.2.1.3.0 completed successfully."
]
}
TASK [Wait for installation complete] *************************************************************************************
Pausing for 180 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
ok: [ 192.168.100.1]
PLAY RECAP **************************************************************************************************************************************************
192.168.100.1 : ok=4 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
192.168.100.2 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
#