diff --git a/ansible/group_vars/environment_name_oasys_test.yml b/ansible/group_vars/environment_name_oasys_test.yml index d948143fe..5fb2cc767 100644 --- a/ansible/group_vars/environment_name_oasys_test.yml +++ b/ansible/group_vars/environment_name_oasys_test.yml @@ -204,3 +204,22 @@ db_configs: RCVCAT: rcvcat_db_name: TRCVCAT + + T2BIPINF: + parameters: + - { name: "_allow_insert_with_update_check", value: TRUE, db_restart_required: 0, scope: both } + - { name: session_cached_cursors, value: 300, db_restart_required: 0, scope: spfile } + - { name: processes, value: 500, db_restart_required: 1, scope: spfile } + - { name: pga_aggregate_target, value: 800M, db_restart_required: 0, scope: both } + - { name: db_recovery_file_dest_size, value: 40G, db_restart_required: 0, scope: both } + - { name: shared_pool_size, value: 300M, db_restart_required: 0, scope: both } + - { name: open_cursors, value: 800, db_restart_required: 0, scope: both } + - { name: db_files, value: 600, db_restart_required: 0, scope: both } + - { + name: log_archive_dest_1, + value: '"''location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=emrep''"', + db_restart_required: 0, + scope: both, + } + service: + - { name: BIPINF_TAF, role: PRIMARY } diff --git a/ansible/roles/oasys-bip/defaults/main.yml b/ansible/roles/oasys-bip/defaults/main.yml new file mode 100644 index 000000000..f44949582 --- /dev/null +++ b/ansible/roles/oasys-bip/defaults/main.yml @@ -0,0 +1,59 @@ +--- +# Following tags must be set on the ASG +# oasys-environment: t2 +# bip-db-name: T2BIPINF +# bip-db-hostname: t2-oasys-db-a +# oasys-db-name: T2OASYS +# oasys-db-hostname: t2-oasys-db-a +# +# Following tags must be set on the DB +# bip-db-name: T2BIPINF + +oasys_environment: "{{ ec2.tags['oasys-environment'] }}" +bip_db_name: "{{ ec2.tags['bip-db-name'] }}" +bip_db_server: "{{ ec2.tags['bip-db-hostname'] }}" +oasys_db_name: "{{ ec2.tags['oasys-db-name'] }}" +oasys_db_server: "{{ ec2.tags['oasys-db-hostname'] }}" + +weblogic_domain_hostname: "{{ ansible_facts.hostname }}" +weblogic_servername: "{{ ansible_facts.hostname }}" +middleware_home: /u01/app/oracle/Middleware +wl_home: /u01/app/oracle/Middleware/wlserver_10.3 +stage: /u01/stage +oracle_install_user: oracle +oracle_install_group: oinstall +domain_name: bifoundation_domain +domain_home: /u01/app/oracle/Middleware/user_projects/domains +oas_mds_password_file: "{{ stage }}/oas_mds_password.txt" +oas_biplatform_password_file: "{{ stage }}/oas_biplatform_password.txt" +weblogic_password_file: "{{ stage }}/weblogic_password.txt" +admin_password_file: "{{ stage }}/weblogic_password.txt" +bip_repository_file: bip_repository_12Oct2023.tar +weblogic_admin_username: weblogic +managed_server: bi_server1 +scripts_dir: /home/oracle/admin/scripts +weblogic_servers: + - { name: bi_server1 } + - { name: AdminServer } + +bip_weblogic_secretsmanager_secrets: + bipweb: + secret: "/oracle/bip/{{ oasys_environment }}/passwords" + users: + - weblogic: + bipdbshared: + secret: "/oracle/database/{{ bip_db_name }}/bip-passwords" + users: + - sys: + - mds: + - biplatform: + +bip_db_secretsmanager_secrets: + bipdbshared: + secret: "/oracle/database/{{ bip_db_name }}/bip-passwords" + users: + - sys: + bipdb: + secret: "/oracle/database/{{ bip_db_name }}/passwords" + users: + - system: diff --git a/ansible/roles/oasys-bip/meta/main.yml b/ansible/roles/oasys-bip/meta/main.yml new file mode 100644 index 000000000..abf94477c --- /dev/null +++ b/ansible/roles/oasys-bip/meta/main.yml @@ -0,0 +1,6 @@ +--- +dependencies: + - role: get-ec2-facts + # - role: ansible-requirements + # - role: disable-ipv6 + # - role: disable-firewall diff --git a/ansible/roles/oasys-bip/tasks/cleanup.yml b/ansible/roles/oasys-bip/tasks/cleanup.yml new file mode 100644 index 000000000..8199aa5de --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/cleanup.yml @@ -0,0 +1,23 @@ +--- +- name: Collect file details for cleanup from {{ stage }} + ansible.builtin.find: + path: "{{ stage }}" + hidden: True + register: collected_files + +- name: Collect directory details for cleanup from {{ stage }} + ansible.builtin.find: + paths: "{{ stage }}" + hidden: True + file_type: directory + register: collected_directories + +- name: remove collected files and directories + ansible.builtin.file: + path: "{{ item.path }}" + state: absent + with_items: > + {{ + collected_files.files + + collected_directories.files + }} diff --git a/ansible/roles/oasys-bip/tasks/clone_bip_software.yml b/ansible/roles/oasys-bip/tasks/clone_bip_software.yml new file mode 100644 index 000000000..e74a8f3e8 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/clone_bip_software.yml @@ -0,0 +1,266 @@ +--- +- name: Check Oracle BIP Software installed + ansible.builtin.stat: + path: ". {{ wl_home }}/server/bin/setWLSEnv.sh" + register: BIP_software_installed + +- block: + - 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: 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 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 + - addApplicationPrivileges.exp + - password.txt + - boot.properties + + - 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: 10 + + - 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: Boot.properties file creation for bi_server1 + ansible.builtin.copy: + src: "{{ domain_home }}/{{ domain_name }}/servers/AdminServer/security/boot.properties" + dest: "{{ domain_home }}/{{ domain_name }}/servers/bi_server1/security/boot.properties" + owner: oracle + group: oinstall + mode: "0600" + remote_src: true + + - 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: 10 + + - name: Enable Standalone BI Publisher to Add Privileges for Application Roles + become_user: oracle + ansible.builtin.shell: | + set -eo pipefail + main() { + . {{ wl_home }}/server/bin/setWLSEnv.sh + {{ stage }}/addApplicationPrivileges.exp {{ weblogic_admin_password }} + } + main 2>&1 | logger -p local3.info -t ansible-oracle-bip + when: not ansible_check_mode + + # block + when: not BIP_software_installed.stat.exists diff --git a/ansible/roles/oasys-bip/tasks/create_bip_database.yml b/ansible/roles/oasys-bip/tasks/create_bip_database.yml new file mode 100644 index 000000000..cf91b20d4 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/create_bip_database.yml @@ -0,0 +1,34 @@ +--- +- name: Create stage directory + ansible.builtin.file: + path: "{{ stage }}" + state: directory + owner: oracle + group: oinstall + mode: "0755" + +- name: Copy BIP database creation scripts + template: + src: "{{ item }}.j2" + dest: "{{ stage }}/{{ item }}" + owner: oracle + group: oinstall + mode: "0700" + loop: + - create_bip_db.sh + - add_hidden_parameter.sql + +- name: Create BIP database + become_user: oracle + ansible.builtin.shell: | + set -eo pipefail + main() { + echo "# create_recovery_catalog_db.sh " + {{ stage }}/create_bip_db.sh {{ bip_db_name }} {{ bipdb_sys_password }} {{ bipdb_system_password }} + . oraenv <<< {{ bip_db_name }} + sqlplus / as sysdba @add_hidden_parameter.sql + } + main 2>&1 | logger -p local3.info -t ansible-oracle-db + async: 86400 + poll: 60 + when: not ansible_check_mode diff --git a/ansible/roles/oasys-bip/tasks/get-db-facts.yml b/ansible/roles/oasys-bip/tasks/get-db-facts.yml new file mode 100644 index 000000000..21a4efe2a --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/get-db-facts.yml @@ -0,0 +1,28 @@ +--- +- name: Get secrets + import_role: + name: secretsmanager-passwords + vars: + secretsmanager_passwords: "{{ bip_db_secretsmanager_secrets }}" + +- name: Set secret facts + set_fact: + bipdb_sys_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['sys'] }}" + bipdb_system_password: "{{ secretsmanager_passwords_dict['bipdb'].passwords['system'] }}" + +- name: Fail if missing parameters + fail: + msg: "Ensure {{ bip_db_name }} variable is defined in db_configs fact" + when: db_configs[bip_db_name] is not defined + +- name: Check parameters + set_fact: + db_all_variables_set: true + when: + - bipdb_sys_password|length > 0 + - bipdb_system_password| length > 0 + +- name: Fail if missing parameters + fail: + msg: Ensure all required parameters are set + when: not db_all_variables_set|default(false) diff --git a/ansible/roles/oasys-bip/tasks/get-facts.yml b/ansible/roles/oasys-bip/tasks/get-facts.yml new file mode 100644 index 000000000..2b56c2dae --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/get-facts.yml @@ -0,0 +1,41 @@ +--- +- name: Get secrets + import_role: + name: secretsmanager-passwords + vars: + secretsmanager_passwords: "{{ bip_weblogic_secretsmanager_secrets }}" + +- name: Set secret facts + set_fact: + weblogic_admin_password: "{{ secretsmanager_passwords_dict['bipweb'].passwords['weblogic'] }}" + bipdb_sys_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['sys'] }}" + bipdb_biplatform_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['biplatform'] }}" + bipdb_mds_password: "{{ secretsmanager_passwords_dict['bipdbshared'].passwords['mds'] }}" + +- debug: + msg: "Configuring BIP DB {{ bip_db_name }} on {{ bip_db_server }}" + +- debug: + msg: "Configuring OASys DB {{ oasys_db_name }} on {{ oasys_db_server }}" + +- debug: + msg: "Configuring Admin console {{ weblogic_domain_hostname }} with username {{ weblogic_admin_username }}" + +- name: Check all SSM parameters and tags are set + set_fact: + weblogic_all_variables_set: true + when: + - weblogic_admin_username|length > 0 + - weblogic_admin_password|length > 0 + - bip_db_name|length > 0 + - bip_db_server|length > 0 + - oasys_db_name|length > 0 + - oasys_db_server|length > 0 + - bipdb_sys_password|length> 0 + - bipdb_biplatform_password|length> 0 + - bipdb_mds_password|length> 0 + +- name: Fail if missing SSM parameters or tags + fail: + msg: Ensure all required SSM parameters and tags are set + when: not weblogic_all_variables_set|default(false) diff --git a/ansible/roles/oasys-bip/tasks/install-jdk.yml b/ansible/roles/oasys-bip/tasks/install-jdk.yml new file mode 100644 index 000000000..6a819893e --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/install-jdk.yml @@ -0,0 +1,34 @@ +--- +- name: Check installed packages + ansible.builtin.package_facts: + +- block: + - name: Create jdk install directory + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: oracle + group: oinstall + mode: "0755" + loop: + - "{{ 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: "{{ stage }}/jdk/jdk-7u80-linux-x64.rpm" + mode: get + overwrite: latest + loop: + - /u01/software/jdk/jdk-7u80-linux-x64.rpm + when: image_builder_s3_bucket_name is defined + + - name: Install jdk rpm binary + yum: + name: "{{ stage}}/jdk/jdk-7u80-linux-x64.rpm" + state: present + + # block + when: ansible_facts.packages['jdk'] is not defined diff --git a/ansible/roles/oasys-bip/tasks/main.yml b/ansible/roles/oasys-bip/tasks/main.yml new file mode 100644 index 000000000..e4cefb8e9 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/main.yml @@ -0,0 +1,88 @@ +--- +- name: Oasys BI publisher Installation + block: + - import_tasks: get-facts.yml + tags: + - ec2provision + - ec2patch + - weblogic_get_facts + - weblogic_moj_admin_scripts + - weblogic_certificate_fix + - weblogic_create_managed_app + - weblogic_setup_log_rotate + - rcu + + - import_tasks: packages.yml + tags: + - amibuild + - ec2provision + - weblogic_packages + + - import_tasks: users.yml + tags: + - amibuild + - ec2provision + - weblogic_users + + - import_tasks: swap.yml + tags: + - amibuild + - ec2provision + - weblogic_swap + + - import_tasks: install-jdk.yml + tags: + - amibuild + - ec2provision + - weblogic_install_jdk + + - import_tasks: oracle-limits-update.yml + tags: + - amibuild + - ec2provision + - oracle-limits-changes + + - import_tasks: clone_bip_software.yml + tags: + - amibuild + - ec2provision + + - import_tasks: services.yml + tags: + - amibuild + - ec2provision + + - include_tasks: + file: setup-log-rotate.yml + apply: + tags: + - ec2provision + - weblogic_setup_log_rotate + tags: + - ec2provision + - weblogic_setup_log_rotate + loop_control: + loop_var: weblogic_managed_app_list + loop: "{{ weblogic_servers }}" + + - import_tasks: cleanup.yml + tags: + - amibuild + - ec2provision + + when: ansible_distribution in ['RedHat', 'OracleLinux'] and ansible_distribution_major_version == "7" + +- import_tasks: get-db-facts.yml + tags: + - bip_db_create + - never + +- import_tasks: create_bip_database.yml + tags: + - bip_db_create + - never + +- import_tasks: rcu.yml + tags: + - bip_db_create + - never diff --git a/ansible/roles/oasys-bip/tasks/moj-admin-scripts.yml b/ansible/roles/oasys-bip/tasks/moj-admin-scripts.yml new file mode 100644 index 000000000..c78b2c6f1 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/moj-admin-scripts.yml @@ -0,0 +1,37 @@ +--- +- name: Create moj admin directory + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: oracle + group: oinstall + mode: "0755" + loop: + - /home/oracle/admin/scripts/ + +- name: Copy moj admin scripts + ansible.builtin.template: + src: "10.3{{ item }}" + dest: "{{ item }}" + owner: oracle + group: oinstall + mode: "0755" + loop: + - /home/oracle/admin/scripts/wait_for_entry_in_log.sh + - /home/oracle/admin/scripts/create_managed_app.py + - /home/oracle/admin/scripts/set_ms_log_rotation.py + - /home/oracle/admin/scripts/get_param.py + - /home/oracle/admin/scripts/set_param.py + - /home/oracle/admin/scripts/ms_state.py + - /home/oracle/admin/scripts/ms_state.sh + +- name: Copy moj admin files + ansible.builtin.template: + src: "10.3{{ item }}" + dest: "{{ item }}" + owner: oracle + group: oinstall + mode: "0644" + loop: + - /home/oracle/admin/scripts/README.md + - /home/oracle/admin/scripts/weblogic.properties diff --git a/ansible/roles/oasys-bip/tasks/oracle-limits-update.yml b/ansible/roles/oasys-bip/tasks/oracle-limits-update.yml new file mode 100644 index 000000000..10a63eaa4 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/oracle-limits-update.yml @@ -0,0 +1,16 @@ +--- +- name: Add oracle user limits + community.general.pam_limits: + domain: oracle + limit_type: "{{ item.limit_type }}" + limit_item: "{{ item.limit_item }}" + value: "{{ item.value }}" + loop: + - { limit_type: "soft", limit_item: "memlock", value: 134217728 } + - { limit_type: "soft", limit_item: "nofile", value: 1024 } + - { limit_type: "soft", limit_item: "nproc", value: 16384 } + - { limit_type: "soft", limit_item: "stack", value: 32768 } + - { limit_type: "hard", limit_item: "memlock", value: 134217728 } + - { limit_type: "hard", limit_item: "nofile", value: 65536 } + - { limit_type: "hard", limit_item: "nproc", value: 16384 } + - { limit_type: "hard", limit_item: "stack", value: 10240 } diff --git a/ansible/roles/oasys-bip/tasks/packages.yml b/ansible/roles/oasys-bip/tasks/packages.yml new file mode 100644 index 000000000..1fe7f8841 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/packages.yml @@ -0,0 +1,39 @@ +--- +- name: Install the latest version of required packages + ansible.builtin.package: + name: + - bind-utils + - binutils + - compat-libcap1 + # - compat-libstdc++-33 + # - compat-libstdc++-33.i686 + - dos2unix + - gcc + - gcc-c++ + - glibc + - glibc-devel + - glibc.i686 + - ksh + - libaio-devel + - libgcc + - libstdc++ + - libstdc++-devel + - libstdc++.i686 + - libXmu + - libXp.i686 + - libXt.i686 + - libXtst.i686 + - make + - nfs-utils + - openssh-clients + - pam + - psmisc + - rng-tools + - smartmontools + - sysstat + - util-linux-ng + - xorg-x11-apps + - xorg-x11-utils + - xorg-x11-xauth + - expect + state: latest diff --git a/ansible/roles/oasys-bip/tasks/rcu.yml b/ansible/roles/oasys-bip/tasks/rcu.yml new file mode 100644 index 000000000..ba9bfe51f --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/rcu.yml @@ -0,0 +1,51 @@ +--- +- name: Create stage directory + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: oracle + group: oinstall + mode: "0755" + loop: + - "{{ stage }}" + - "{{ wl_home }}/bi_rcu" + +- name: Get RCU install software from S3 bucket + amazon.aws.aws_s3: + bucket: "{{ image_builder_s3_bucket_name }}" + object: "oasys-bip/u01/software/rcu/rcuHome.zip" + dest: "{{ stage }}/rcuHome.zip" + mode: get + overwrite: latest + +- name: Extract archives into target directory + ansible.builtin.unarchive: + owner: oracle + group: oinstall + src: "{{stage }}/rcuHome.zip" + dest: "{{ wl_home }}/bi_rcu" + remote_src: true + keep_newer: true + +- name: Copy weblogic install config + ansible.builtin.template: + src: "bip_password.tmp.j2" + dest: "{{stage }}/obiee_rcu_paramfile.txt" + owner: oracle + group: oinstall + +- name: Create BIP repository + become_user: oracle + ansible.builtin.shell: | + set -eo pipefail + main() { + . ~/.bash_profile + $WL_HOME//bi_rcu/bin/rcu -silent -createRepository \ + -connectString {{ bip_db_server }}:1521/{{ bip_db_name }} \ + -dbUser SYS -dbRole SYSDBA -schemaPrefix OAS \ + -component BIPLATFORM -component MDS -f < /u01/stage/obiee_rcu_paramfile.txt + } + main 2>&1 | logger -p local3.info -t ansible-bip-repository + async: 86400 + poll: 60 + when: not ansible_check_mode diff --git a/ansible/roles/oasys-bip/tasks/services.yml b/ansible/roles/oasys-bip/tasks/services.yml new file mode 100644 index 000000000..2c37fdce8 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/services.yml @@ -0,0 +1,71 @@ +--- +- name: Stop Weblogic and nodemanager + become_user: oracle + ansible.builtin.shell: | + set -eo pipefail + main() { + . {{ wl_home }}/server/bin/setWLSEnv.sh + {{ domain_home }}/{{ domain_name }}/bin/stopWebLogic.sh + kill -9 `ps -ef | grep weblogic.NodeManager|grep -v grep | awk '{ print $2 " " $3 }'` + } + main 2>&1 | logger -p local3.info -t ansible-oracle-bip + when: not ansible_check_mode + +- name: Create scripts install directory + ansible.builtin.file: + path: "{{ scripts_dir }}" + state: directory + owner: oracle + group: oinstall + mode: "0700" + +- name: Copy nodemanager systemd helper scripts + ansible.builtin.template: + src: "10.3{{ item }}" + dest: "{{ item }}" + mode: "0755" + owner: oracle + group: oinstall + loop: + - "{{ scripts_dir }}/startNodeManager.sh" + - "{{ scripts_dir }}/waitNodeManager.sh" + - "{{ scripts_dir }}/stopNodeManager.sh" + - "{{ scripts_dir }}/startWebLogic.sh" + - "{{ scripts_dir }}/waitWebLogic.sh" + - "{{ scripts_dir }}/stopWebLogic.sh" + - "{{ scripts_dir }}/startManagedWebLogic.sh" + - "{{ scripts_dir }}/waitManagedWebLogic.sh" + - "{{ scripts_dir }}/stopManagedWebLogic.sh" + - "{{ scripts_dir }}/wait_for_entry_in_log.sh" + - "{{ scripts_dir }}/set_ms_log_rotation.py" + +- name: Copy weblogic systemd service + ansible.builtin.template: + src: "10.3{{ item }}" + dest: "{{ item }}" + loop: + - /etc/systemd/system/wls_nodemanager.service + - /etc/systemd/system/wls_adminserver.service + - /etc/systemd/system/wls_managedserver.service + +- name: Run systemd reload + ansible.builtin.systemd: + daemon_reload: true + +- name: Enable wls_nodemanager service + ansible.builtin.service: + name: "{{ item }}" + enabled: yes + loop: + - wls_nodemanager + - wls_adminserver + - wls_managedserver + +- name: Start weblogic services + ansible.builtin.service: + name: "{{ item }}" + state: started + loop: + - wls_nodemanager + - wls_adminserver + - wls_managedserver diff --git a/ansible/roles/oasys-bip/tasks/setup-log-rotate.yml b/ansible/roles/oasys-bip/tasks/setup-log-rotate.yml new file mode 100644 index 000000000..764c40f0a --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/setup-log-rotate.yml @@ -0,0 +1,43 @@ +--- +- name: Set weblogic managed app facts + set_fact: + weblogic_managed_app: "{{ weblogic_managed_app_list.name }}" + +- name: Start services if not already running + ansible.builtin.service: + name: "{{ item }}" + state: started + loop: + - wls_nodemanager + - wls_adminserver + - wls_managedserver + +- block: + - name: Copy log setup managed app configuration files + ansible.builtin.template: + src: "{{ item }}" + dest: "{{ stage }}/{{ item }}" + owner: oracle + group: oinstall + loop: + - "{{ weblogic_managed_app }}.properties" + + - name: Configure log setup + become_user: oracle + ansible.builtin.shell: | + set -eo pipefail + . ~/.bash_profile + . $WL_HOME/server/bin/setWLSEnv.sh + main() { + echo "# configure log setup app {{ weblogic_managed_app }}" + java weblogic.WLST {{ scripts_dir }}/set_ms_log_rotation.py -p {{ stage }}/{{ weblogic_managed_app }}.properties + } + main 2>&1 | logger -s -p local3.info -t ansible-xtag-weblogic + + always: + - name: Remove temporary install files + ansible.builtin.file: + path: "{{ item }}" + state: absent + loop: + - "{{ stage }}/{{ weblogic_managed_app }}.properties" diff --git a/ansible/roles/oasys-bip/tasks/swap.yml b/ansible/roles/oasys-bip/tasks/swap.yml new file mode 100644 index 000000000..b07a967e0 --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/swap.yml @@ -0,0 +1,26 @@ +--- +- name: Check swapfile + ansible.builtin.stat: + path: /swapfile + register: swapfile + +- name: Create swapfile + ansible.builtin.shell: | + set -eo pipefail + main() { + echo "# creating swapfile" + fallocate -l 1G /swapfile + dd if=/dev/zero of=/swapfile bs=1024 count=1048576 + chmod 600 /swapfile + mkswap /swapfile + swapon /swapfile + } + main 2>&1 | logger -p local3.info -t ansible-weblogic + when: not swapfile.stat.exists + +- name: Mount swapfile + ansible.posix.mount: + src: /swapfile + path: swap + fstype: swap + state: present diff --git a/ansible/roles/oasys-bip/tasks/users.yml b/ansible/roles/oasys-bip/tasks/users.yml new file mode 100644 index 000000000..495ea0a4d --- /dev/null +++ b/ansible/roles/oasys-bip/tasks/users.yml @@ -0,0 +1,14 @@ +--- +- name: Check oracle user already exists + ansible.builtin.getent: + database: passwd + key: "{{ oracle_install_user }}" + +- name: Copy oracle bash profile + ansible.builtin.template: + src: "{{ item }}.j2" + dest: "/home/oracle/.bash_profile" + owner: "{{ oracle_install_user }}" + group: "{{ oracle_install_group }}" + loop: + - .bash_profile diff --git a/ansible/roles/oasys-bip/templates/.bash_profile.j2 b/ansible/roles/oasys-bip/templates/.bash_profile.j2 new file mode 100644 index 000000000..13c8710fc --- /dev/null +++ b/ansible/roles/oasys-bip/templates/.bash_profile.j2 @@ -0,0 +1,24 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + +# User specific environment and startup programs + +PATH=$PATH:$HOME/.local/bin:$HOME/bin + +export PATH +umask 022 +export EDITOR=vi +export DOMAIN=`basename /u01/app/oracle/Middleware/user_projects/domains/*` +export JAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m" +export JAVA_HOME=/usr/bin/java +export JAVA_HOME + +export ORACLE_BASE=/u01/app/oracle +export ORACLE_HOME=/u01/app/oracle/Middleware/wlserver_10.3 +export WL_HOME=/u01/app/oracle/Middleware/wlserver_10.3 +export NODEMGR=${WL_HOME}/server/bin +export WEBLOGIC=/u01/app/oracle/Middleware/user_projects/domains/${DOMAIN}/bin +export XTAG_HOME=/u01/tag/xtag +export PATH=/u01/app/oracle/Middleware/wlserver_10.3/common/bin:$PATH +#. $WL_HOME/server/bin/setWLSEnv.sh \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_adminserver.service b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_adminserver.service new file mode 100644 index 000000000..9ce1fea16 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_adminserver.service @@ -0,0 +1,12 @@ +[Unit] +Description=WebLogic Admin Server + +[Service] +Type=simple +TimeoutStartSec=120 +ExecStart={{ scripts_dir }}/startWebLogic.sh +ExecStartPost={{ scripts_dir }}/waitWebLogic.sh +ExecStop={{ scripts_dir }}/stopWebLogic.sh + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_managedserver.service b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_managedserver.service new file mode 100644 index 000000000..771937137 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_managedserver.service @@ -0,0 +1,13 @@ +[Unit] +Description=WebLogic managed server Service + +[Service] +Type=simple +After=wls_adminserver +TimeoutStartSec=180 +ExecStart={{ scripts_dir }}/startManagedWebLogic.sh +ExecStartPost={{ scripts_dir }}/waitManagedWebLogic.sh +ExecStop={{ scripts_dir }}/stopManagedWebLogic.sh + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_nodemanager.service b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_nodemanager.service new file mode 100644 index 000000000..34fff51e3 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/etc/systemd/system/wls_nodemanager.service @@ -0,0 +1,12 @@ +[Unit] +Description=WebLogic NodeManager Service + +[Service] +Type=simple +TimeoutStartSec=60 +ExecStart={{ scripts_dir }}/startNodeManager.sh +ExecStartPost={{ scripts_dir }}/waitNodeManager.sh +ExecStop={{ scripts_dir }}/stopNodeManager.sh + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/README.md b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/README.md new file mode 100644 index 000000000..b19a12f88 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/README.md @@ -0,0 +1,23 @@ +The python scripts in this directory are designed to be run with wlst. +Credentials should be picked up automatically from boot.properties + +Setting environment + +``` +. $WL_HOME/server/bin/setWLSEnv.sh +. /u01/app/oracle/Middleware/user_projects/domains/NomisDomain/bin/setDomainEnv.sh +``` + +Checking managed server status +``` +wlst.sh ~/admin/scripts/ms_state.py +``` + +Use systemctl scripts for starting and stopping each individual component. +This ensures any component output goes to /var/log/messages. + +``` +systemctl start wls_nodemanager +systemctl start wls_adminserver +systemctl start wls_managedserver +``` diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/set_ms_log_rotation.py b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/set_ms_log_rotation.py new file mode 100644 index 000000000..49a3df0a7 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/set_ms_log_rotation.py @@ -0,0 +1,57 @@ +#!/usr/bin/python + +from java.io import FileInputStream +import time +import getopt +import sys +import re + +# Get location of the properties file. +properties = '' +try: + opts, args = getopt.getopt(sys.argv[1:], "p:h::", ["properies="]) +except getopt.GetoptError: + print 'set_ms_log_rotation.py -p ' + sys.exit(2) +for opt, arg in opts: + if opt == '-h': + print 'set_ms_log_rotation.py -p ' + sys.exit() + elif opt in ("-p", "--properties"): + properties = arg +print 'properties=', properties + +# Load the properties from the properties file. + +propInputStream = FileInputStream(properties) +configProps = Properties() +configProps.load(propInputStream) + +# Set all variables from values in properties file. +adminUsername = configProps.get("admin.username") +adminPassword = configProps.get("admin.password") +adminURL = configProps.get("admin.url") +msName = configProps.get("ms.name") + +# Connect to the AdminServer. +connect(adminUsername, adminPassword, adminURL) + +edit() +startEdit() + +# Manage logging. +cd('/Servers/' + msName + '/Log/' + msName) +cmo.setRotationType('bySize') +cmo.setFileMinSize(50000) +cmo.setNumberOfFilesLimited(true) +cmo.setFileCount(10) +cmo.setRedirectStderrToServerLogEnabled(false) +cmo.setRedirectStdoutToServerLogEnabled(false) +cmo.setMemoryBufferSeverity('Debug') +cmo.setLogFileSeverity('Trace') + +save() +activate() + +disconnect() +exit() diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startManagedWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startManagedWebLogic.sh new file mode 100755 index 000000000..f2b0c8f89 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startManagedWebLogic.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'su - oracle -c ". {{ wl_home }}/server/bin/setWLSEnv.sh && {{ domain_home }}/{{ domain_name }}/bin/startManagedWebLogic.sh {{ managed_server }}"' + su - oracle -c ". {{ wl_home }}/server/bin/setWLSEnv.sh && {{ domain_home }}/{{ domain_name }}/bin/startManagedWebLogic.sh {{ managed_server }}" + exitcode=$? + echo "Started: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + exit 1 +fi \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startNodeManager.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startNodeManager.sh new file mode 100755 index 000000000..7dec44f85 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startNodeManager.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'su - oracle -c {{ wl_home }}/server/bin/startNodeManager.sh' + su - oracle -c {{ wl_home }}/server/bin/startNodeManager.sh + exitcode=$? + echo "Started: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + exit 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startWebLogic.sh new file mode 100755 index 000000000..ace2f53c2 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/startWebLogic.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'su - oracle -c {{ domain_home }}/{{ domain_name }}/bin/startWebLogic.sh' + su - oracle -c {{ domain_home }}/{{ domain_name }}/bin/startWebLogic.sh + exitcode=$? + echo "Started: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + exit 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopManagedWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopManagedWebLogic.sh new file mode 100755 index 000000000..3f4050851 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopManagedWebLogic.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +get_process_pids() { + process_pids1=$(pgrep -u oracle -f "startManagedWebLogic.sh$" 2> /dev/null) + process_pids2=$(pgrep -u oracle -f "weblogic.Name={{ managed_server }}" 2> /dev/null) + [[ -z $process_pids1 && -z $process_pids2 ]] && return 1 + ( + for process_pid in $process_pids1 $process_pids2; do + pstree -ap "$process_pid" | grep -v '{' | cut -d, -f2 | cut -d\ -f1 + done + ) | sort -u | tr '\n' ' ' +} + +stop_process() { + if ! PIDS=$(get_process_pids); then + echo "already stopped" + return 0 + fi + + timeout 60 {{ domain_home }}/{{ domain_name }}/bin/stopManagedWebLogic.sh {{ managed_server }} + + if ! PIDS=$(get_process_pids); then + echo "stopped" + return 0 + fi + + echo "kill $PIDS" + kill $PIDS + sleep 2 + + if ! get_process_pids > /dev/null; then + echo "stopped" + return 0 + fi + + sleep 5 + if ! PIDS=$(get_process_pids); then + echo "stopped after 5 seconds" + return 0 + fi + + echo "kill -9 $PIDS" + kill -9 $PIDS + sleep 2 + + if ! PIDS=$(get_process_pids); then + echo "stopped after kill -9" + return 0 + fi + echo "could not kill $PIDS" + return 1 +} + +stop_process diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopNodeManager.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopNodeManager.sh new file mode 100755 index 000000000..09accd5fe --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopNodeManager.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +get_process_pids() { + process_pids1=$(pgrep -u oracle -f "startNodeManager.sh$" 2> /dev/null) + process_pids2=$(pgrep -u oracle -f "weblogic.NodeManager" 2> /dev/null) + [[ -z $process_pids1 && -z $process_pids2 ]] && return 1 + ( + for process_pid in $process_pids1 $process_pids2; do + pstree -ap "$process_pid" | grep -v '{' | cut -d, -f2 | cut -d\ -f1 + done + ) | sort -u | tr '\n' ' ' +} + +stop_process() { + if ! PIDS=$(get_process_pids); then + echo "already stopped" + return 0 + fi + + echo "kill $PIDS" + kill $PIDS + sleep 2 + + if ! get_process_pids > /dev/null; then + echo "stopped" + return 0 + fi + + sleep 5 + if ! PIDS=$(get_process_pids); then + echo "stopped after 5 seconds" + return 0 + fi + + echo "kill -9 $PIDS" + kill -9 $PIDS + sleep 2 + + if ! PIDS=$(get_process_pids); then + echo "stopped after kill -9" + return 0 + fi + echo "could not kill $PIDS" + return 1 +} + +stop_process diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopWebLogic.sh new file mode 100755 index 000000000..dfff32726 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/stopWebLogic.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +get_process_pids() { + process_pids1=$(pgrep -u oracle -f "startWebLogic.sh$" 2> /dev/null) + [[ -z $process_pids1 ]] && return 1 + ( + for process_pid in $process_pids1; do + pstree -ap "$process_pid" | grep -v '{' | cut -d, -f2 | cut -d\ -f1 + done + ) | sort -u | tr '\n' ' ' +} + +stop_process() { + if ! PIDS=$(get_process_pids); then + echo "already stopped" + return 0 + fi + + timeout 60 {{ domain_home }}/{{ domain_name }}/bin/stopWebLogic.sh + + if ! PIDS=$(get_process_pids); then + echo "stopped" + return 0 + fi + + echo "kill $PIDS" + kill $PIDS + sleep 2 + + if ! get_process_pids > /dev/null; then + echo "stopped" + return 0 + fi + + sleep 5 + if ! PIDS=$(get_process_pids); then + echo "stopped after 5 seconds" + return 0 + fi + + echo "kill -9 $PIDS" + kill -9 $PIDS + sleep 2 + + if ! PIDS=$(get_process_pids); then + echo "stopped after kill -9" + return 0 + fi + echo "could not kill $PIDS" + return 1 +} + +stop_process diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitManagedWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitManagedWebLogic.sh new file mode 100755 index 000000000..607473117 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitManagedWebLogic.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'wait_for_entry_in_log.sh wls_managedserver.service "Server started in RUNNING mode" "startManagedWebLogic.sh"' + {{ scripts_dir }}/wait_for_entry_in_log.sh wls_managedserver.service "Server started in RUNNING mode" "startManagedWebLogic.sh" + exitcode=$? + echo "Waited: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + return 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitNodeManager.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitNodeManager.sh new file mode 100755 index 000000000..15c1b2950 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitNodeManager.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'wait_for_entry_in_log.sh wls_nodemanager.service "listener started" "startNodeManager.sh"' + {{ scripts_dir }}/wait_for_entry_in_log.sh wls_nodemanager.service "listener started" "startNodeManager.sh" + exitcode=$? + echo "Waited: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + return 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitWebLogic.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitWebLogic.sh new file mode 100755 index 000000000..b5c8875ce --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/waitWebLogic.sh @@ -0,0 +1,11 @@ +#!/bin/bash +if [[ $(whoami) == "root" ]]; then + echo 'wait_for_entry_in_log.sh wls_adminserver.service "Server started in RUNNING mode" "startWebLogic.sh"' + {{ scripts_dir }}/wait_for_entry_in_log.sh wls_adminserver.service "Server started in RUNNING mode" "startWebLogic.sh" + exitcode=$? + echo "Waited: exitcode=$exitcode" + exit $exitcode +else + echo "must be run as root" + return 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/wait_for_entry_in_log.sh b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/wait_for_entry_in_log.sh new file mode 100755 index 000000000..a8e29467e --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/wait_for_entry_in_log.sh @@ -0,0 +1,34 @@ +#!/bin/bash +logfile=$1 +match_pattern=$2 +filter_pattern=$3 +if [[ -z $match_pattern ]]; then + echo "Usage $0 []" >&2 + exit 1 +fi +if [[ -e "$logfile" ]]; then + # wait until a matching line found in the log file + # only way I could get this to work was to spawn tail in a subshell + if [[ -z $filter_pattern ]]; then + ( tail -f -n0 "$logfile" & ) | grep -qE "${match_pattern}" + else + ( tail -f -n0 "$logfile" & ) | grep -qE "${filter_pattern}(.*)${match_pattern}" + fi + # kill the tail subshell. It's not so easy to find the pid + pid=$(ps -o pid= -o cmd --forest -g $(ps -o sid= -p $$) | grep -F "tail -f -n0 $logfile" | grep -v grep | cut -d\ -f1) + [[ -n $pid ]] && kill $pid 2> /dev/null + exit 0 +elif [[ "$logfile" =~ .service$ ]]; then + if [[ -z $filter_pattern ]]; then + ( journalctl -u $logfile -f -S -10s & ) | grep -qE "${match_pattern}" + else + ( journalctl -u $logfile -f -S -10s & ) | grep -qE "${filter_pattern}(.*)${match_pattern}" + fi + # kill the tail subshell. It's not so easy to find the pid + pid=$(ps -o pid= -o cmd --forest -g $(ps -o sid= -p $$) | grep -F "tail -f -n0 $logfile" | grep -v grep | cut -d\ -f1) + [[ -n $pid ]] && kill $pid 2> /dev/null + exit 0 +else + echo "$logfile not found" >&2 + exit 1 +fi diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogic.properties b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogic.properties new file mode 100644 index 000000000..0beca34a8 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogic.properties @@ -0,0 +1,2 @@ +domain.adminServerName=AdminServer +domain.adminurl={{ weblogic_domain_hostname }}:7001 diff --git a/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogicControl.py b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogicControl.py new file mode 100644 index 000000000..5c900c125 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/10.3/home/oracle/admin/scripts/weblogicControl.py @@ -0,0 +1,130 @@ +# --------------------------------------------------------- +# Check the status of all WL instances including the admin +# --------------------------------------------------------- +import sys +from java.io import FileInputStream + +propInputStream = FileInputStream( + "{{ script_dir }}/weblogic.properties") +configProps = Properties() +configProps.load(propInputStream) +domainName = configProps.get("domain.name") +domainHome = configProps.get("domain.home") +wlConfigFile = configProps.get("domain.configfile") +wlKeyFile = configProps.get("domain.keyfile") +nmConfigFile = configProps.get("nm.configfile") +nmKeyFile = configProps.get("nm.keyfile") +nmHome = configProps.get("nm.home") +nmPort = configProps.get("nm.port") +nmMachines = configProps.get("nm.host") +adminUrl = configProps.get("domain.adminurl") +adminServerName = configProps.get("domain.adminServerName") + + +def conn(): + try: + connect(userConfigFile=wlConfigFile, + userKeyFile=wlKeyFile, url=adminUrl) + except ConnectionException, e: + print 'Unable to find admin server' + exit() + + +def ServerState(server): + if server != 'wls': + nmConnect(userConfigFile=nmConfigFile, userKeyFile=nmKeyFile, port=nmPort, + host=nmMachines, domainName=domainName, domainDir=domainHome, nmType='Plain') + nmServerStatus(server) + exit() + else: + conn() + serverNames = cmo.getServers() + domainRuntime() + print 'Fetching state of every WebLogic instance' + print '' + for name in serverNames: + cd("/ServerLifeCycleRuntimes/" + name.getName()) + serverState = cmo.getState() + print '%-20s' % (name.getName()) + serverState + disconnect() + exit() + + +def nmConn(machine): + try: + nmConnect(userConfigFile=nmConfigFile, userKeyFile=nmKeyFile, port=nmPort, + host=nmMachines, domainName=domainName, domainDir=domainHome, nmType='Plain') + status = "SUCCESS" + except ConnectionException, e: + status = "FAILED" + print 'Nodemanager Connection: ' + status + + +def nmStartNM(machine): + try: + nmConnect(userConfigFile=nmConfigFile, userKeyFile=nmKeyFile, port=nmPort, + host=nmMachines, domainName=domainName, domainDir=domainHome, nmType='Plain') + print 'Nodemanager already running' + + except: + print 'start nodemaneger except' + startNodeManager(verbose='false', NodeManagerHome=nmHome, + ListenPort=nmPort, ListenAddress=nmMachines) + + +def nmStop(): + try: + nmConnect(userConfigFile=nmConfigFile, userKeyFile=nmKeyFile, port=nmPort, + host=nmMachines, domainName=domainName, domainDir=domainHome, nmType='Plain') + stopNodeManager() + print 'Stopped nodemanager' + except: + print 'Reached exception for nmstop' + + +def nmStartAS(): + try: + nmStart(adminServerName) + except: + print 'Issues starting admin server' + + +if __name__ == "main": + action = sys.argv[1] + module = sys.argv[2] + if action == 'status': + if module == 'nm': + nmConn(nmMachines) + exit() + elif module == 'wls': + ServerState(module) + elif module == 'as': + ServerState(adminServerName) + elif action == 'stop': + if module == 'as': + conn() + shutdown(adminServerName, 'Server', 'true', 0, block='true') + disconnect() + exit() + elif module == 'ms': + msname = sys.argv[3] + nmConn(nmMachines) + nmKill(msname) + exit() + elif module == 'nm': + nmStop() + exit() + elif action == 'start': + if module == 'ms': + msname = sys.argv[3] + nmConn(nmMachines) + nmStart(msname) + exit() + elif module == 'nm': + print nmMachines + nmStartNM(nmMachines) + exit() + elif module == 'as': + nmConn(nmMachines) + nmStartAS() + exit() diff --git a/ansible/roles/oasys-bip/templates/AdminServer.properties b/ansible/roles/oasys-bip/templates/AdminServer.properties new file mode 100644 index 000000000..9976e6d1f --- /dev/null +++ b/ansible/roles/oasys-bip/templates/AdminServer.properties @@ -0,0 +1,7 @@ +# AdminServer connection details. +admin.username={{ weblogic_admin_username }} +admin.password={{ weblogic_admin_password }} +admin.url={{ weblogic_domain_hostname }}:7001 + +# Managed Server +ms.name=AdminServer \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/addApplicationPrivileges.exp.j2 b/ansible/roles/oasys-bip/templates/addApplicationPrivileges.exp.j2 new file mode 100644 index 000000000..8cdc180b2 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/addApplicationPrivileges.exp.j2 @@ -0,0 +1,7 @@ +#!/usr/bin/expect +set PASSWORD [lindex $argv 0] + +spawn {{ middleware_home }}/oracle_common/common/bin/wlst.sh {{ stage }}/addBIPCodeGrants.py t3://{{ weblogic_servername }}:7001 weblogic +expect "\Please enter password:\]" +send "$PASSWORD\r" +expect eof \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/addBIPCodeGrants.py.j2 b/ansible/roles/oasys-bip/templates/addBIPCodeGrants.py.j2 new file mode 100644 index 000000000..cc285dee6 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/addBIPCodeGrants.py.j2 @@ -0,0 +1,40 @@ +#!/usr/bin/python +import os +import sys +import inspect + + +def _getPathToThisFile(): + return os.path.dirname(inspect.getabsfile(inspect.currentframe())) + + +sys.path.append(_getPathToThisFile()) + +WLSAdminUrl = sys.argv[1] +WLSAdminUN = sys.argv[2] +psw = raw_input('Please enter password: ') +WLSAdminPW = psw + +try: + connect(WLSAdminUN, WLSAdminPW, WLSAdminUrl) + # saved_stdout = sys.stdout + # sys.stdout = open('_stdout.log', 'w') + + try: + grantPermission(codeBaseURL="file:${oracle.deployed.app.dir}/bipublisher_11.1.1${oracle.deployed.app.ext}", permTarget="context=APPLICATION,name=obi", + permClass="oracle.security.jps.service.policystore.PolicyStoreAccessPermission", permActions="containsAppRole") + + except: + print >> sys.stdout, "Entry for BI Publisher already exist." + else: + print >> sys.stdout, "Entry for BI Publisher has been added successfully." + + sys.stdout.close() + # os.remove('_stdout.log') + # sys.stdout = saved_stdout + disconnect() + # explicitly exit without errors. patching system requires this. + exit() +except: + dumpStack() + raise diff --git a/ansible/roles/oasys-bip/templates/add_hidden_parameter.sql.j2 b/ansible/roles/oasys-bip/templates/add_hidden_parameter.sql.j2 new file mode 100644 index 000000000..ce132abd8 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/add_hidden_parameter.sql.j2 @@ -0,0 +1,9 @@ +set echo on +spool {{ stage }}/add_hidden_parameter.log + +ALTER SYSTEM SET "_allow_insert_with_update_check"=TRUE scope=spfile; +shutdown immediate +startup + +spool off +exit \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml b/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml new file mode 100644 index 000000000..f19654eae --- /dev/null +++ b/ansible/roles/oasys-bip/templates/bi_config_moveplan.xml @@ -0,0 +1,557 @@ + + + J2EEDomain + bifoundation_domain + 11.1.1.9.0 + CLONE20231010113530183 + + + Startup Mode + PRODUCTION + + STRING + READ_WRITE + + + + SERVER_CONFIG + + + Server Name + AdminServer + + STRING + READ_ONLY + + + + Listen Address + All Local Addresses + + STRING + READ_WRITE + + + + Listen Port + 7001 + + INTEGER + READ_WRITE + + + + + + Server Name + bi_server1 + + STRING + READ_ONLY + + + + Listen Address + All Local Addresses + + STRING + READ_WRITE + + + + Listen Port + 9704 + + INTEGER + READ_WRITE + + + + + + MACHINE_CONFIG + + + Machine Name + {{ weblogic_domain_hostname }} + + STRING + READ_WRITE + + + + Node Manager Listen Address + {{ weblogic_domain_hostname }} + + STRING + READ_WRITE + + + + Node Manager Listen Port + 9556 + + INTEGER + READ_WRITE + + + + + + CLUSTER_CONFIG + + + Cluster Name + bi_cluster + + STRING + READ_ONLY + + + + Messaging Mode + unicast + + STRING + READ_WRITE + + + + Cluster Address + + + STRING + READ_WRITE + + + + Unicast Channel + + + STRING + READ_WRITE + + + + Multicast Address + 239.192.0.0 + + STRING + READ_WRITE + + + + Multicast Port + 7001 + + INTEGER + READ_WRITE + + + + + + DATASOURCE + + + DataSource Name + mds-owsm + + STRING + READ_ONLY + + + + Driver Class + oracle.jdbc.OracleDriver + + STRING + READ_WRITE + + + + Url + jdbc:oracle:thin:@{{ bip_db_server }}:1521/{{ bip_db_name }} + + STRING + READ_WRITE + + + + User + OAS_MDS + + STRING + READ_WRITE + + + + Password File + {{ oas_mds_password_file }} + + STRING + true + READ_WRITE + + + + + + DataSource Name + EPMSystemRegistry + + STRING + READ_ONLY + + + + Driver Class + oracle.jdbc.OracleDriver + + STRING + READ_WRITE + + + + Url + jdbc:oracle:thin:@{{ bip_db_server }}:1521/{{ bip_db_name }} + + STRING + READ_WRITE + + + + User + OAS_BIPLATFORM + + STRING + READ_WRITE + + + + Password File + {{ oas_biplatform_password_file }} + + STRING + true + READ_WRITE + + + + + + DataSource Name + bip_datasource + + STRING + READ_ONLY + + + + Driver Class + oracle.jdbc.OracleDriver + + STRING + READ_WRITE + + + + Url + jdbc:oracle:thin:@{{ bip_db_server }}:1521/{{ bip_db_name }} + + STRING + READ_WRITE + + + + User + OAS_BIPLATFORM + + STRING + READ_WRITE + + + + Password File + {{ oas_biplatform_password_file }} + + STRING + true + READ_WRITE + + + + + + OPSS_SECURITY + + + + + + + + + BIEE-DOMAIN-CONFIG + BI EE Domain XML file contains the BI topology details including each BI Oracle Instance. + + + OracleInstances + Contains a property group for each host that is running BI components within the BI Domain + + + BIInstance + Contains domain wide configuration properties used by all hosts running BI components within the BI Domain + + EmailOptions + + smtpServerName + localhost + + STRING + READ_WRITE + + + + port + 25 + + INTEGER + READ_WRITE + + + + fromDisplayName + Oracle Business Intelligence + + STRING + READ_WRITE + + + + emailAddressOfSender + defaultuser@defaultmailserver.com + + STRING + READ_WRITE + + + + + MarketingOptions + + url + http://localhost:8765 + + STRING + READ_WRITE + + + + + SchedulerOptions + + dataSource + dataSourceValue + + STRING + READ_WRITE + + + + + + + + BI-PUBLISHER-CONFIG + BI Publisher config files are xmlp-server.xml, datasources.xml,providers.xml, jms_cluster_config.properties and config properties specified in domain env + + + XMLP-DATASOURCES + There will be a separate config list for each BI Publisher datasource configured + + dataSource + + file + + path + /u01/app/oracle/Middleware/user_projects/domains/bifoundation_domain/config/bipublisher/repository/DemoFiles + + STRING + READ_WRITE + + + + + + dataSource + + connection + + url + jdbc:oraclebi://{{ weblogic_domain_hostname }}:9703/ + + STRING + READ_WRITE + + + + + + dataSource + + connection + + url + jdbc:oracle:thin:@{{ oasys_db_server }}:1521:{{ oasys_db_name }} + + STRING + READ_WRITE + + + + username + EOR + + STRING + READ_WRITE + + + + + + + XMLP-SCHEDULER-JMS-CONFIG + config list for BIPublisher scheduler cluster config properties + + + + + diff --git a/ansible/roles/oasys-bip/templates/bi_server1.properties b/ansible/roles/oasys-bip/templates/bi_server1.properties new file mode 100644 index 000000000..f800abb72 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/bi_server1.properties @@ -0,0 +1,8 @@ +# AdminServer Connection + +admin.username={{ weblogic_admin_username }} +admin.password={{ weblogic_admin_password }} +admin.url={{ weblogic_domain_hostname }}:7001 + +# Managed Server +ms.name=bi_server1 diff --git a/ansible/roles/oasys-bip/templates/bip_install.rsp.j2 b/ansible/roles/oasys-bip/templates/bip_install.rsp.j2 new file mode 100644 index 000000000..88956fb43 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/bip_install.rsp.j2 @@ -0,0 +1,159 @@ +[ENGINE] + +#DO NOT CHANGE THIS. +Response File Version=1.0.0.0.0 + +[GENERIC] + +#Set this to true if you wish to specify a directory where latest updates are downloaded. This option would use the software updates from the specified directory +SPECIFY_DOWNLOAD_LOCATION=false + +#Set this to true to skip the Software updates +SKIP_SOFTWARE_UPDATES=true + +#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true +SOFTWARE_UPDATES_DOWNLOAD_LOCATION= + +#Install Software and Configure Components for Express Install. Installs and Configures components with default settings. Installs the light-weight WebLogic Server and creates a new domain. +INSTALL_FOR_DEVELOPMENT_TYPE=false + +#Install and Configure Software Components and Applications. Installs binaries in an ORACLE_HOME and configures working instances in an INSTANCE_HOME. +INSTALL_AND_CONFIGURE_TYPE=true + +#Install Software Components and Applications. Installs binaries in an ORACLE_HOME, but do not configure working instances of installed components. +INSTALL_AND_CONFIGURE_LATER_TYPE=false + +#Internal flag to enable cloud install +ISCLOUD=false + +#Set this to true if you want to create a new BI System, all other required variables need to be provided. If this is set to true then variables "SCALEOUT_BISYSTEM" and "EXTEND_BISYSTEM" must be set to false, since the variables are mutually exclusive. +CREATE_BISYSTEM=true + +#Set this to true if you want to scale out an existing BI System, all other required variables need to be provided. If this is set to true then variables "CREATE_BISYSTEM","EXTEND_BISYSTEM" and "UPDATE_BIDOMAIN" must be set to false, since the variables are mutually exclusive. In order to scale out an existing BI system, the domain in the system must be running +SCALEOUT_BISYSTEM=false + +#Set this to true if you want to configure BI System in an existing exmpty domain in the localhost, all other required variables need to be provided. If this is set to true then variables "CREATE_BISYSTEM","SCALEOUT_BISYSTEM" and "UPDATE_BIDOMAIN" must be set to false, since the variables are mutually exclusive. +EXTEND_BISYSTEM=false + +#Set this to true if you want to update an existing BI System running on the localhost, all other required variables need to be provided. If this is set to true then variables "CREATE_BISYSTEM","EXTEND_BISYSTEM" and "SCALEOUT_BISYSTEM" must be set to false, since the variables are mutually exclusive. +UPDATE_BIDOMAIN=false + +#Write the name of the domain you want to create. Domain name may only contain alphanumeric characters, or the underscore (_) or hyphen (-) characters. +DOMAIN_NAME=bifoundation_domain + +#Write the name of the cell you want to create. Cell name may only contain alphanumeric characters, or the underscore (_) or hyphen (-) characters. +CELL_NAME=unknown + +#Write the name of the host to which you want to connect. It should have an already existing domain configured. +DOMAIN_HOSTNAME=T1ODL0007 + +#Give the port number at which the host should be connected. +DOMAIN_PORT=1521 + +#Give an administrator user name for the domain if you are creating a new one otherwise give the administrator user name for the domain configured at the host. +ADMIN_USER_NAME=weblogic + +#Give an administrator password for the domain if you are creating a new one otherwise give the administrator password for the domain configured at the host. +ADMIN_PASSWORD=webl0g1c + +#Write the administrator password again to confirm. +ADMIN_CONFIRM_PASSWORD=webl0g1c + +#Is Single Server Install. +WLS_SINGLE_SERVER_INSTALL=false + +#Write the complete path to a valid Middleware Home. +MW_HOME=/u01/app/oracle/Middleware + +#Give the complete path to a valid WebLogic Server Home. +WEBLOGIC_HOME=/u01/app/oracle/Middleware/wlserver_10.3 + +#Give the name of the Oracle Home directory. The Oracle Home directory name may only contain alphanumeric , hyphen (-) , dot (.) and underscore (_) characters, and it must begin with an alphanumeric character. +ORACLE_HOME=/u01/app/oracle/Middleware/Oracle_BI1 + +#Give the complete path for an Oracle Instance directory to be created. This is the location where the software configuration files and runtime processes will reside. +INSTANCE_HOME=/u01/app/oracle/Middleware/instances/instance1 + +#Give a name for Oracle Instance corresponding to the Instance Home. The Oracle Instance name may only contain alphanumeric and underscore (_) characters, it must begin with an alphabetic (a-z or A-Z) character, and must be from 4 to 30 characters in length. +INSTANCE_NAME=bipinfra + +#Give the complete path for a domain home to be created. +DOMAIN_HOME_PATH=/u01/app/oracle/Middleware/user_projects/domains/bifoundation_domain + +#Format: hostname:port:servicename. For Application Cluster Database: host1:port1^host2:port2@servicename +DATABASE_CONNECTION_STRING_BI=T1ODL0007:1521:bipinfra + +#Enter the BIPLATFORM schema username. +DATABASE_SCHEMA_USER_NAME_BI=OAS_BIPLATFORM + +#Enter the BIPLATFORM schema password. +DATABASE_SCHEMA_PASSWORD_BI=Manager1 + +#Select the database type in which the BIPLATFORM schema exists. Supported database types are Oracle Database, Microsoft SQL Server, IBM DB2. +DATABASE_TYPE_BI=Oracle Database + +#Format: hostname:port:servicename. For Application Cluster Database: host1:port1^host2:port2@servicename +DATABASE_CONNECTION_STRING_MDS=T1ODL0007:1521:bipinfra + +#Enter the MDS schema username. +DATABASE_SCHEMA_USER_NAME_MDS=OAS_MDS + +#Enter the MDS schema password. +DATABASE_SCHEMA_PASSWORD_MDS=Manager1 + +#Select the database type in which the MDS schema exists. Supported database types are Oracle Database, Microsoft SQL Server, IBM DB2. +DATABASE_TYPE_MDS=Oracle Database + +# +AUTOMATIC_PORT_DETECT=true + +# +STATICPORT INI FILE LOCATION= + +#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name. +MYORACLESUPPORT_USERNAME= + +#Provide the My Oracle Support Password +MYORACLESUPPORT_PASSWORD= + +#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration +DECLINE_SECURITY_UPDATES=true + +#Set this to true if My Oracle Support Password is specified +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + +#Provide the Proxy Host +PROXY_HOST= + +#Provide the Proxy Port +PROXY_PORT= + +#Provide the Proxy Username +PROXY_USER= + +#Provide the Proxy Password +PROXY_PWD= + +#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port] +COLLECTOR_SUPPORTHUB_URL= + + +[SYSTEM] + + +[APPLICATIONS] + +#Set to true to configure Oracle Business Intelligence Enterprise Edition. Otherwise set to false. +CONFIGURE_BI=false + +#Set to true to configure Oracle Business Intelligence Publishing and Reporting. Otherwise set to false. +CONFIGURE_BIP=true + +#Set to true to configure Oracle Real-Time Decisions. Otherwise set to false. +CONFIGURE_RTD=false + +#Set to true to select all Oracle Essbase Components. Otherwise set to false. +CONFIGURE_ESSBASE_SUITE=false + + +[RELATIONSHIPS] \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/bip_password.tmp.j2 b/ansible/roles/oasys-bip/templates/bip_password.tmp.j2 new file mode 100644 index 000000000..4b43e3d1b --- /dev/null +++ b/ansible/roles/oasys-bip/templates/bip_password.tmp.j2 @@ -0,0 +1,3 @@ +{{ bipdb_sys_password }} +{{ bipdb_biplatform_password }} +{{ bipdb_mds_password }} \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/bip_paste_binary.sh.j2 b/ansible/roles/oasys-bip/templates/bip_paste_binary.sh.j2 new file mode 100644 index 000000000..ab468de9b --- /dev/null +++ b/ansible/roles/oasys-bip/templates/bip_paste_binary.sh.j2 @@ -0,0 +1,2 @@ +#!/bin/bash +/u01/stage/pasteBinary.sh -javaHome /usr/java/jdk1.7.0_80 -archiveLoc /u01/stage/bi_mw_copy_binary.jar -targetMWHomeLoc /u01/app/oracle/Middleware -invPtrLoc /etc/oraInst.loc -logDirLoc /u01/stage/logs -executeSysPrereqs false diff --git a/ansible/roles/oasys-bip/templates/boot.properties.j2 b/ansible/roles/oasys-bip/templates/boot.properties.j2 new file mode 100644 index 000000000..9d172dfc2 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/boot.properties.j2 @@ -0,0 +1,3 @@ +# these credentials are encrypted once the weblogic server is started +username={{ weblogic_admin_username }} +password={{ weblogic_admin_password }} diff --git a/ansible/roles/oasys-bip/templates/create_bip_db.sh.j2 b/ansible/roles/oasys-bip/templates/create_bip_db.sh.j2 new file mode 100644 index 000000000..ded47c122 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/create_bip_db.sh.j2 @@ -0,0 +1,30 @@ +#!/bin/bash +export ORAENV_ASK=false +export ORACLE_HOME=/u01/app/oracle/product/19c/db_1 +export PATH=$ORACLE_HOME/bin:$PATH +export ORACLE_SID=$1 +export SYS_PASSWORD=$2 +export SYSTEM_PASSWORD=$3 + +dbca -silent -createDatabase \ + -templateName General_Purpose.dbc \ + -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -responseFile NO_VALUE \ + -characterSet AL32UTF8 \ + -sysPassword ${SYS_PASSWORD} \ + -systemPassword ${SYSTEM_PASSWORD} \ + -createAsContainerDatabase false \ + -databaseType MULTIPURPOSE \ + -totalMemory 2048 \ + -storageType ASM \ + -diskGroupName +DATA \ + -recoveryAreaDestination +FLASH \ + -redoLogFileSize 600 \ + -emConfiguration NONE \ + -automaticMemoryManagement false \ + -sampleSchema FALSE \ + -enableArchive TRUE \ + -ignorePreReqs + +. oraenv <<< $ORACLE_SID +srvctl add service -d $ORACLE_SID -s BIPINF_TAF +srvctl start service -d $ORACLE_SID -s BIPINF_TAF diff --git a/ansible/roles/oasys-bip/templates/domain.properties b/ansible/roles/oasys-bip/templates/domain.properties new file mode 100644 index 000000000..45d64e651 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/domain.properties @@ -0,0 +1,15 @@ +# Paths +path.middleware={{ middleware_home }} +path.wls={{ wl_home }} +path.domain.config={{ domain_home }} + +# Credentials +admin.username={{ weblogic_admin_username }} +admin.password={{ weblogic_admin_password }} +admin.url={{ weblogic_domain_hostname }}:7001 +admin.port=7001 +admin.address={{ weblogic_domain_hostname }} + +# Domain details +domain.name={{ domain_name }} +machine={{ weblogic_domain_hostname }} diff --git a/ansible/roles/oasys-bip/templates/nm_moveplan.xml b/ansible/roles/oasys-bip/templates/nm_moveplan.xml new file mode 100644 index 000000000..5b3a8f671 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/nm_moveplan.xml @@ -0,0 +1,124 @@ + + + NodeManager + nodemanager + 11.1.1.9.0 + CLONE20231010121257628 + + + NODEMANAGER_PROPERTIES + + Listen Address + {{ weblogic_domain_hostname }} + + STRING + READ_WRITE + + + + Listen Port + 9556 + + INTEGER + READ_WRITE + + + + + DOMAINS + + + Domain Name + bifoundation_domain + + STRING + READ_WRITE + + + + Domain Location + /u01/app/oracle/Middleware/user_projects/domains/bifoundation_domain + + STRING + READ_WRITE + + + + AdminServer Listen Address + {{ weblogic_domain_hostname }} + + STRING + READ_WRITE + + + + AdminServer Listen Port + 7001 + + INTEGER + READ_WRITE + + + + AdminServer User Name + weblogic + + STRING + READ_WRITE + + + + AdminServer Password File + {{ weblogic_password_file }} + + STRING + true + READ_WRITE + + + + Custom Trust Keystore File + + Provide the value of Custom Trust KeyStore File of the domain, if value of the config property "AdminServer Listen Port" mentioned above represents SSL port of the server. + + STRING + READ_WRITE + + + + Node Manager User Name + weblogic + + STRING + READ_WRITE + + + + Node Manager Password File + {{ weblogic_password_file }} + + STRING + true + READ_WRITE + + + + + + + diff --git a/ansible/roles/oasys-bip/templates/obfuscatePassword.exp.j2 b/ansible/roles/oasys-bip/templates/obfuscatePassword.exp.j2 new file mode 100644 index 000000000..174738cb3 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/obfuscatePassword.exp.j2 @@ -0,0 +1,10 @@ +#!/usr/bin/expect +set PASSWORD [lindex $argv 0] +set FILE [lindex $argv 1] + +spawn /u01/app/oracle/Middleware/oracle_common/bin/obfuscatePassword.sh -javahome /usr/java/jdk1.7.0_80 +expect "\[Password to obfuscate:\]" +send "$PASSWORD\r" +expect "\[Path of password file to be created:\]" +send "$FILE\r" +expect eof \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/oraInst.loc.j2 b/ansible/roles/oasys-bip/templates/oraInst.loc.j2 new file mode 100644 index 000000000..637f300d7 --- /dev/null +++ b/ansible/roles/oasys-bip/templates/oraInst.loc.j2 @@ -0,0 +1,2 @@ +inventory_loc=/u01/app/oraInventory +inst_group={{ oracle_install_group }} \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/password.txt.j2 b/ansible/roles/oasys-bip/templates/password.txt.j2 new file mode 100644 index 000000000..e38a8250f --- /dev/null +++ b/ansible/roles/oasys-bip/templates/password.txt.j2 @@ -0,0 +1 @@ +{{ weblogic_admin_password }} \ No newline at end of file diff --git a/ansible/roles/oasys-bip/templates/silent.xml.j2 b/ansible/roles/oasys-bip/templates/silent.xml.j2 new file mode 100755 index 000000000..b9fba3e8b --- /dev/null +++ b/ansible/roles/oasys-bip/templates/silent.xml.j2 @@ -0,0 +1,10 @@ + + + + + + + + +