From 4d15a5e3582f5f16a8df7b3ba33d853ef57f625c Mon Sep 17 00:00:00 2001 From: sandhya Gandalwar Date: Wed, 1 Nov 2023 08:38:22 +0000 Subject: [PATCH] Updated BIP code --- ansible/roles/oasys-bip/defaults/main.yml | 1 + .../oasys-bip/tasks/clone_bip_software.yml | 439 +++++++++--------- ansible/roles/oasys-bip/tasks/install-jdk.yml | 7 +- .../templates/bi_config_moveplan.xml | 2 +- 4 files changed, 238 insertions(+), 211 deletions(-) diff --git a/ansible/roles/oasys-bip/defaults/main.yml b/ansible/roles/oasys-bip/defaults/main.yml index 1f10cadb6..179d22c49 100644 --- a/ansible/roles/oasys-bip/defaults/main.yml +++ b/ansible/roles/oasys-bip/defaults/main.yml @@ -17,3 +17,4 @@ weblogic_password_file: "{{ stage }}/weblogic_password.txt" admin_password_file: "{{ stage }}/weblogic_password.txt" bip_repository_file: bip_repository_12Oct2023.tar oasys_db: T2OASYS +oasys_db_server: t2-oasys-db-a \ No newline at end of file diff --git a/ansible/roles/oasys-bip/tasks/clone_bip_software.yml b/ansible/roles/oasys-bip/tasks/clone_bip_software.yml index 253e5cd14..41f747f5b 100644 --- a/ansible/roles/oasys-bip/tasks/clone_bip_software.yml +++ b/ansible/roles/oasys-bip/tasks/clone_bip_software.yml @@ -6,228 +6,253 @@ - block: - - name: Download software for Oracle BI Publisher cloning for Oasys - amazon.aws.aws_s3: - bucket: "{{ image_builder_s3_bucket_name }}" - object: "oasys-bip/bipclone/{{ item }}" - dest: "{{ stage}}/{{ item }}" - mode: get - overwrite: latest - loop: - - test_mw_copy.jar - - bi_config_copy.jar - - cloningclient.jar - - nm.jar - - pasteBinary.sh - - "{{ bip_repository_file}}" - when: image_builder_s3_bucket_name is defined - - - name: Change file ownership, group and permissions - ansible.builtin.file: - path: "{{ item }}" - owner: oracle - group: oinstall - mode: '0700' - loop: - - "{{ stage }}/pasteBinary.sh" - - "{{ stage }}/cloningclient.jar" - - - name: Create directories for moveplan and bip repository - ansible.builtin.file: - path: "{{ item }}" - state: directory - owner: oracle - group: oinstall - mode: "0755" - loop: - - "{{ stage }}/nm" - - "{{ stage }}/bi_config" - - "{{ stage }}/logs" - - /u01/oracle - - - name: Create a symbolic link - ansible.builtin.file: - src: /u01/oracle - dest: /oracle - owner: oracle - group: oinstall - state: link - - - name: Extract bip_repository - ansible.builtin.unarchive: - owner: oracle - group: oinstall - src: "{{ stage }}/{{ bip_repository_file }}" - dest: /u01/oracle - remote_src: true - keep_newer: true - - - - name: Copy BIP plans for config and nodemanager - ansible.builtin.template: - src: "{{ item }}_moveplan.xml" - dest: "{{ stage }}/{{ item }}/moveplan.xml" - owner: oracle - group: oinstall - mode: "0700" - loop: - - nm - - bi_config - - - name: Copy script templates to obfuscate password and to add Privileges for Application Roles - ansible.builtin.template: - src: "{{ item }}.j2" - dest: "{{ stage }}/{{ item }}" - owner: oracle - group: oinstall - mode: "0700" - loop: - - obfuscatePassword.exp - - addBIPCodeGrants.py - - bip_paste_binary.sh - - password.txt - - - name: Copy oraInst.loc - ansible.builtin.template: - src: "oraInst.loc.j2" - dest: "/etc/oraInst.loc" - owner: root - group: root - mode: "0755" - - - name: Oracle BI Publisher paste binary from jar file - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - echo "# pasteBinary.sh " - {{ stage }}/pasteBinary.sh -javahome /usr/java/jdk1.7.0_80 -archiveLoc {{ stage }}/test_mw_copy.jar -targetMWHomeLoc {{ middleware_home }} -invPtrLoc /etc/oraInst.loc -logDirLoc {{ stage }}/logs -executeSysPrereqs false - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip - async: 86400 - poll: 60 - when: not ansible_check_mode + # - name: Create directories for moveplan and bip repository + # ansible.builtin.file: + # path: "{{ item }}" + # state: directory + # owner: oracle + # group: oinstall + # mode: "0755" + # loop: + # - "{{ stage }}" + # - "{{ stage }}/nm" + # - "{{ stage }}/bi_config" + # - "{{ stage }}/logs" + # - /u01/oracle + # - /u01/app - - name: Execute oracleRoot.sh as root - ansible.builtin.shell: | - set -eo pipefail - main() { - echo "# oracleRoot.sh " - {{ middleware_home }}/Oracle_BI1/oracleRoot.sh - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip - when: not ansible_check_mode + # - name: Download software for Oracle BI Publisher cloning for Oasys + # amazon.aws.aws_s3: + # bucket: "{{ image_builder_s3_bucket_name }}" + # object: "oasys-bip/bipclone/{{ item }}" + # dest: "{{ stage}}/{{ item }}" + # mode: get + # overwrite: latest + # loop: + # - test_mw_copy.jar + # - bi_config_copy.jar + # - cloningclient.jar + # - nm.jar + # - pasteBinary.sh + # - "{{ bip_repository_file}}" + # when: image_builder_s3_bucket_name is defined - - name: Collect file details for cleanup from nodemanager - ansible.builtin.find: - path: "{{ wl_home }}/common/nodemanager/" - hidden: True - register: collected_files - - - name: remove collected files from nodemenager directory - ansible.builtin.file: - path: "{{ item.path }}" - state: absent - with_items: > - {{ - collected_files.files - }} - - - name: Generate obfuscate password files for OMS_MDS - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" - echo "# Create obfuscated password file for OAS_MDS " - {{ stage }}/obfuscatePassword.exp {{ bipdb_mds_password }} {{ oas_mds_password_file }} - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # - name: Change file ownership, group and permissions + # ansible.builtin.file: + # path: "{{ item }}" + # owner: oracle + # group: oinstall + # mode: '0700' + # loop: + # - "{{ stage }}/pasteBinary.sh" + # - "{{ stage }}/cloningclient.jar" - - name: Generate obfuscate password files for OAS_BIPLATFORM - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" - echo "# Create obfuscated password file for OAS_BIPLATFORM " - {{ stage }}/obfuscatePassword.exp {{ bipdb_biplatform_password }} {{ oas_biplatform_password_file }} - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # - name: Create a symbolic link + # ansible.builtin.file: + # src: /u01/oracle + # dest: /oracle + # owner: oracle + # group: oinstall + # state: link - - name: Generate obfuscate password files for weblogic - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" - echo "# Create obfuscated password file for WEBLOGIC " - {{ stage }}/obfuscatePassword.exp {{ weblogic_admin_password }} {{ weblogic_password_file }} - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # - name: Extract bip_repository + # ansible.builtin.unarchive: + # owner: oracle + # group: oinstall + # src: "{{ stage }}/{{ bip_repository_file }}" + # dest: /u01/oracle + # remote_src: true + # keep_newer: true - - name: Oracle BIP config cloning - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - {{ middleware_home }}/oracle_common/bin/pasteConfig.sh \ - -javahome /usr/java/jdk1.7.0_80 \ - -archiveLoc {{ stage }}/bi_config_copy.jar \ - -targetDomainLoc {{ domain_home }}/{{ domain_name }} \ - -targetMWHomeLoc {{ middleware_home }} \ - -domainAdminPasswordFile {{ stage }}/password.txt \ - -movePlanLoc {{ stage }}/bi_config/moveplan.xml - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip - async: 86400 - poll: 60 - when: not ansible_check_mode - - name: Collect file details for cleanup from nodemanager - ansible.builtin.find: - path: "{{ wl_home }}/common/nodemanager/" - hidden: True - register: collected_files - - - name: remove collected files from nodemenager directory - ansible.builtin.file: - path: "{{ item.path }}" - state: absent - with_items: > - {{ - collected_files.files - }} - - - name: Oracle BIP NodeManager config cloning - become_user: oracle - ansible.builtin.shell: | - set -eo pipefail - main() { - {{ middleware_home }}/oracle_common/bin/pasteConfig.sh \ - -javahome /usr/java/jdk1.7.0_80 \ - -archiveLoc {{ stage }}/nm.jar \ - -targetnmhomeloc {{ wl_home }}/common/nodemanager \ - -targetmwhomeloc {{ middleware_home }} \ - -movePlanLoc {{ stage }}/nm/moveplan.xml \ - -silent true - } - main 2>&1 | logger -p local3.info -t ansible-oracle-bip - async: 86400 - poll: 60 - when: not ansible_check_mode + # - name: Copy BIP plans for config and nodemanager + # ansible.builtin.template: + # src: "{{ item }}_moveplan.xml" + # dest: "{{ stage }}/{{ item }}/moveplan.xml" + # owner: oracle + # group: oinstall + # mode: "0700" + # loop: + # - nm + # - bi_config + + # - name: Copy script templates to obfuscate password and to add Privileges for Application Roles + # ansible.builtin.template: + # src: "{{ item }}.j2" + # dest: "{{ stage }}/{{ item }}" + # owner: oracle + # group: oinstall + # mode: "0700" + # loop: + # - obfuscatePassword.exp + # - addBIPCodeGrants.py + # - bip_paste_binary.sh + # - addApplicationPrivileges.exp + # - password.txt + + # - name: Copy oraInst.loc + # ansible.builtin.template: + # src: "oraInst.loc.j2" + # dest: "/etc/oraInst.loc" + # owner: root + # group: root + # mode: "0755" + + # - name: Oracle BI Publisher paste binary from jar file + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # echo "# pasteBinary.sh " + # {{ stage }}/pasteBinary.sh -javahome /usr/java/jdk1.7.0_80 -archiveLoc {{ stage }}/test_mw_copy.jar -targetMWHomeLoc {{ middleware_home }} -invPtrLoc /etc/oraInst.loc -logDirLoc {{ stage }}/logs -executeSysPrereqs false + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # async: 86400 + # poll: 60 + # when: not ansible_check_mode + + # - name: Execute oracleRoot.sh as root + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # echo "# oracleRoot.sh " + # {{ middleware_home }}/Oracle_BI1/oracleRoot.sh + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # when: not ansible_check_mode + + # - name: Collect file details for cleanup from nodemanager + # ansible.builtin.find: + # path: "{{ wl_home }}/common/nodemanager/" + # hidden: True + # register: collected_files + + # - name: remove collected files from nodemenager directory + # ansible.builtin.file: + # path: "{{ item.path }}" + # state: absent + # with_items: > + # {{ + # collected_files.files + # }} + + # - name: Generate obfuscate password files for OMS_MDS + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" + # echo "# Create obfuscated password file for OAS_MDS " + # {{ stage }}/obfuscatePassword.exp {{ bipdb_mds_password }} {{ oas_mds_password_file }} + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + + # - name: Generate obfuscate password files for OAS_BIPLATFORM + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" + # echo "# Create obfuscated password file for OAS_BIPLATFORM " + # {{ stage }}/obfuscatePassword.exp {{ bipdb_biplatform_password }} {{ oas_biplatform_password_file }} + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + + # - name: Generate obfuscate password files for weblogic + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # export CONFIG_JVM_ARGS="-Xmx2048M -Xms2048M" + # echo "# Create obfuscated password file for WEBLOGIC " + # {{ stage }}/obfuscatePassword.exp {{ weblogic_admin_password }} {{ weblogic_password_file }} + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + + # - name: Oracle BIP config cloning + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # {{ middleware_home }}/oracle_common/bin/pasteConfig.sh \ + # -javahome /usr/java/jdk1.7.0_80 \ + # -archiveLoc {{ stage }}/bi_config_copy.jar \ + # -targetDomainLoc {{ domain_home }}/{{ domain_name }} \ + # -targetMWHomeLoc {{ middleware_home }} \ + # -domainAdminPasswordFile {{ stage }}/password.txt \ + # -movePlanLoc {{ stage }}/bi_config/moveplan.xml + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # async: 86400 + # poll: 60 + # when: not ansible_check_mode + + # - name: Collect file details for cleanup for mbase.bin and mbase.lck files + # ansible.builtin.find: + # path: "{{ domain_home }}/bifoundation_domain/config/bipublisher/repository/meta/" + # hidden: True + # register: collected_files + + # - name: remove collected files from nodemenager directory + # ansible.builtin.file: + # path: "{{ item.path }}" + # state: absent + # with_items: > + # {{ + # collected_files.files + # }} + + # - name: Collect file details for cleanup for mbase.bin and mbase.lck files + # ansible.builtin.find: + # path: "{{ wl_home }}/common/nodemanager/" + # hidden: True + # register: collected_files + + # - name: remove collected files from nodemenager directory + # ansible.builtin.file: + # path: "{{ item.path }}" + # state: absent + # with_items: > + # {{ + # collected_files.files + # }} + + # - name: Pause for 15 minutes to let admin server start properly in few cases even though it was running connecting to it was causing issues for few mins + # ansible.builtin.pause: + # minutes: 15 + + # - name: Oracle BIP NodeManager config cloning + # become_user: oracle + # ansible.builtin.shell: | + # set -eo pipefail + # main() { + # {{ middleware_home }}/oracle_common/bin/pasteConfig.sh \ + # -javahome /usr/java/jdk1.7.0_80 \ + # -archiveLoc {{ stage }}/nm.jar \ + # -targetnmhomeloc {{ wl_home }}/common/nodemanager \ + # -targetmwhomeloc {{ middleware_home }} \ + # -movePlanLoc {{ stage }}/nm/moveplan.xml \ + # -silent true + # } + # main 2>&1 | logger -p local3.info -t ansible-oracle-bip + # async: 86400 + # poll: 30 + # when: not ansible_check_mode - name: Start nodemanager become_user: oracle ansible.builtin.shell: | nohup /u01/app/oracle/Middleware/wlserver_10.3/server/bin/startNodeManager.sh & - - name: Start Adminserver + - name: Boot.properties file creation for bi_server1 + + + - name: Start BI_SERVER1 become_user: oracle ansible.builtin.shell: | - nohup /u01/app/oracle/Middleware/user_projects/domains/bifoundation_domain/bin/startWebLogic.sh & + nohup /u01/app/oracle/Middleware/user_projects/domains/bifoundation_domain/bin/startManagedWebLogic.sh bi_server1 & - - name: Pause for 5 minutes to let admin server start properly . + - name: Pause for 15 minutes to let admin server start properly . ansible.builtin.pause: minutes: 5 diff --git a/ansible/roles/oasys-bip/tasks/install-jdk.yml b/ansible/roles/oasys-bip/tasks/install-jdk.yml index 5e6639b6b..1e0961019 100644 --- a/ansible/roles/oasys-bip/tasks/install-jdk.yml +++ b/ansible/roles/oasys-bip/tasks/install-jdk.yml @@ -11,13 +11,14 @@ group: oinstall mode: "0755" loop: - - /u01/software/jdk + - "{{ stage }}" + - "{{ stage }}/jdk" - name: Get jdk rpm binary from S3 bucket amazon.aws.aws_s3: bucket: "{{ image_builder_s3_bucket_name }}" object: "oasys-bip{{ item }}" - dest: "{{ item }}" + dest: "{{ stage }}" mode: get overwrite: latest loop: @@ -26,7 +27,7 @@ - name: Install jdk rpm binary yum: - name: /u01/software/jdk/jdk-7u80-linux-x64.rpm + name: "{{ stage}}/jdk/jdk-7u80-linux-x64.rpm" state: present # block diff --git a/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml b/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml index b8544004f..38ddedd52 100644 --- a/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml +++ b/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml @@ -530,7 +530,7 @@ connection url - jdbc:oracle:thin:@{{ weblogic_db_hostname_a }}:1521:{{ oasys_db }} + jdbc:oracle:thin:@{{ oasys_db_server }}:1521:{{ oasys_db }} STRING READ_WRITE