From c7d8941b7dc89d259e8597698bc80b1ffedc9ace Mon Sep 17 00:00:00 2001 From: Craig Gilbertson Date: Tue, 19 Dec 2023 10:54:45 +0000 Subject: [PATCH 1/2] Removed outdated patching roles --- .../group_vars/server_type_ncr_bip_cmc.yml | 34 ++++++++-------- .../ncr-bip-cmc-patching/defaults/main.yml | 20 ---------- .../roles/ncr-bip-cmc-patching/meta/main.yml | 6 --- .../roles/ncr-bip-cmc-patching/tasks/main.yml | 1 - .../ncr-bip-cmc-patching/templates/.gitkeep | 0 ansible/roles/ncr-bip-cmc/defaults/main.yml | 12 ++---- ansible/roles/ncr-bip-cmc/tasks/get_facts.yml | 28 ++++++++++--- .../roles/ncr-bip-patching/defaults/main.yml | 20 ---------- ansible/roles/ncr-bip-patching/meta/main.yml | 6 --- ansible/roles/ncr-bip-patching/tasks/main.yml | 1 - .../roles/ncr-bip-patching/templates/.gitkeep | 0 .../ncr-tomcat-patching/defaults/main.yml | 22 ----------- .../roles/ncr-tomcat-patching/meta/main.yml | 6 --- .../tasks/add_response_file.yml | 19 --------- .../roles/ncr-tomcat-patching/tasks/main.yml | 12 ------ .../tasks/patch_tomcat.yml | 6 --- .../tasks/post_patching.yml | 39 ------------------- .../ncr-tomcat-patching/templates/.gitkeep | 0 18 files changed, 43 insertions(+), 189 deletions(-) delete mode 100644 ansible/roles/ncr-bip-cmc-patching/defaults/main.yml delete mode 100644 ansible/roles/ncr-bip-cmc-patching/meta/main.yml delete mode 100644 ansible/roles/ncr-bip-cmc-patching/tasks/main.yml delete mode 100644 ansible/roles/ncr-bip-cmc-patching/templates/.gitkeep delete mode 100644 ansible/roles/ncr-bip-patching/defaults/main.yml delete mode 100644 ansible/roles/ncr-bip-patching/meta/main.yml delete mode 100644 ansible/roles/ncr-bip-patching/tasks/main.yml delete mode 100644 ansible/roles/ncr-bip-patching/templates/.gitkeep delete mode 100644 ansible/roles/ncr-tomcat-patching/defaults/main.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/meta/main.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/tasks/add_response_file.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/tasks/main.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/tasks/patch_tomcat.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/tasks/post_patching.yml delete mode 100644 ansible/roles/ncr-tomcat-patching/templates/.gitkeep diff --git a/ansible/group_vars/server_type_ncr_bip_cmc.yml b/ansible/group_vars/server_type_ncr_bip_cmc.yml index b2cf6b851..6dd184219 100644 --- a/ansible/group_vars/server_type_ncr_bip_cmc.yml +++ b/ansible/group_vars/server_type_ncr_bip_cmc.yml @@ -14,23 +14,23 @@ users_and_groups_system: - sapsys server_type_roles_list: - - users-and-groups - - sudoers - - get-ec2-facts - - set-ec2-hostname - - domain-search - - disable-ipv6 - - disable-firewall - - time - - packages - - message-of-the-day - - amazon-ssm-agent - - amazon-cli - - ansible-script - - epel - - disks - - oracle-19c-client - - oracle-tns-entries + # - users-and-groups + # - sudoers + # - get-ec2-facts + # - set-ec2-hostname + # - domain-search + # - disable-ipv6 + # - disable-firewall + # - time + # - packages + # - message-of-the-day + # - amazon-ssm-agent + # - amazon-cli + # - ansible-script + # - epel + # - disks + # - oracle-19c-client + # - oracle-tns-entries - ncr-bip-cmc - collectd - amazon-cloudwatch-agent diff --git a/ansible/roles/ncr-bip-cmc-patching/defaults/main.yml b/ansible/roles/ncr-bip-cmc-patching/defaults/main.yml deleted file mode 100644 index 31665beeb..000000000 --- a/ansible/roles/ncr-bip-cmc-patching/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 -sap_bi_platform_unpack_base_directory: /opt/sap/bip -sap_bi_platform_extraction_directory: /u02/software/BIP_4_3_SP1 -sap_bi_platform_installation_directory: /u01/app/bobj/BIP4 -sap_jvm_unpack_base_directory: /opt/sap/java - -sap_bi_platform_platform_files: - - BIPLATS4303P_300-70002683_P1.EXE - - BIPLATS4303P_300-70002683_P2.RAR - -s3: - bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 - packages_prefix: BIP_PATCHES/ - files: - sap_bi_platform: - - BIPLATS4303P_300-70002683_P1.EXE - - BIPLATS4303P_300-70002683_P2.RAR - -ssm_parameters_prefix: "bi-platform-cmc" diff --git a/ansible/roles/ncr-bip-cmc-patching/meta/main.yml b/ansible/roles/ncr-bip-cmc-patching/meta/main.yml deleted file mode 100644 index eda808260..000000000 --- a/ansible/roles/ncr-bip-cmc-patching/meta/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -dependencies: - - role: get-ec2-facts - - role: ansible-requirements - - role: disable-ipv6 - - role: disable-firewall diff --git a/ansible/roles/ncr-bip-cmc-patching/tasks/main.yml b/ansible/roles/ncr-bip-cmc-patching/tasks/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/roles/ncr-bip-cmc-patching/tasks/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/roles/ncr-bip-cmc-patching/templates/.gitkeep b/ansible/roles/ncr-bip-cmc-patching/templates/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/ansible/roles/ncr-bip-cmc/defaults/main.yml b/ansible/roles/ncr-bip-cmc/defaults/main.yml index 6da7999c6..9e74d9cb2 100644 --- a/ansible/roles/ncr-bip-cmc/defaults/main.yml +++ b/ansible/roles/ncr-bip-cmc/defaults/main.yml @@ -5,6 +5,8 @@ sap_bi_platform_extraction_directory: /u02/software/BIP_4_3_SP1 sap_bi_platform_installation_directory: /u01/app/bobj/BIP4 sap_jvm_unpack_base_directory: /opt/sap/java +nomis-combined-reporting-environment: "{{ ec2.tags['nomis-combined-reporting-environment'] }}" + s3: bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 packages_prefix: BIP/ @@ -20,12 +22,6 @@ ssm_parameters_prefix: "bip-cmc" bip_cmc_secretsmanager_passwords: bip_cmc: - account_name: "nomis-combined-reporting-{{ aws_environment }}" - secret: "/t1-ncr-bip-cmc/passwords" + secret: "/ec2/ncr-bip-cmc/t1/passwords" users: - - cms_cluster_key: - - cms_admin_password: - - cms_db_password: - - lcm_password: - - product_key: - - auditing_db_password: + - bip_cmc: auto \ No newline at end of file diff --git a/ansible/roles/ncr-bip-cmc/tasks/get_facts.yml b/ansible/roles/ncr-bip-cmc/tasks/get_facts.yml index 03785e2cd..54a0e33aa 100644 --- a/ansible/roles/ncr-bip-cmc/tasks/get_facts.yml +++ b/ansible/roles/ncr-bip-cmc/tasks/get_facts.yml @@ -7,9 +7,25 @@ - name: Set password facts set_fact: - cms_cluster_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_cluster_key'] }}" - cms_admin_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_admin_password'] }}" - cms_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_db_password'] }}" - lcm_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['lcm_password'] }}" - product_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['product_key'] }}" - auditing_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['auditing_db_password'] }}" + cms_cluster_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[cms_cluster_key] }}" + cms_admin_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[cms_admin_password] }}" + cms_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[cms_db_password] }}" + lcm_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[lcm_password] }}" + product_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[product_key] }}" + auditing_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords[auditing_db_password] }}" + +- name: Check all SSM parameters and tags are set + set_fact: + bip_cmc_all_variables_set: true + when: + - cms_cluster_key|length > 0 + - cms_admin_password|length > 0 + - lcm_password|length > 0 + - cms_db_password|length > 0 + - auditing_db_password|length > 0 + - product_key|length > 0 + +- name: Fail if missing SSM parameters or tags + fail: + msg: Ensure all required SSM parameters and tags are set + when: not bip_cmc_all_variables_set|default(false) diff --git a/ansible/roles/ncr-bip-patching/defaults/main.yml b/ansible/roles/ncr-bip-patching/defaults/main.yml deleted file mode 100644 index 0b759856f..000000000 --- a/ansible/roles/ncr-bip-patching/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 -sap_bi_platform_unpack_base_directory: /opt/sap/bip -sap_bi_platform_extraction_directory: /u02/software/BIP_4_3_SP1 -sap_bi_platform_installation_directory: /u01/app/bobj/BIP4 -sap_jvm_unpack_base_directory: /opt/sap/java - -sap_bi_platform_platform_files: - - BIPLATS4303P_300-70002683_P1.EXE - - BIPLATS4303P_300-70002683_P2.RAR - -s3: - bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 - packages_prefix: BIP_PATCHES/ - files: - sap_bi_platform: - - BIPLATS4303P_300-70002683_P1.EXE - - BIPLATS4303P_300-70002683_P2.RAR - -ssm_parameters_prefix: "bi-platform" diff --git a/ansible/roles/ncr-bip-patching/meta/main.yml b/ansible/roles/ncr-bip-patching/meta/main.yml deleted file mode 100644 index eda808260..000000000 --- a/ansible/roles/ncr-bip-patching/meta/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -dependencies: - - role: get-ec2-facts - - role: ansible-requirements - - role: disable-ipv6 - - role: disable-firewall diff --git a/ansible/roles/ncr-bip-patching/tasks/main.yml b/ansible/roles/ncr-bip-patching/tasks/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/roles/ncr-bip-patching/tasks/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/roles/ncr-bip-patching/templates/.gitkeep b/ansible/roles/ncr-bip-patching/templates/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/ansible/roles/ncr-tomcat-patching/defaults/main.yml b/ansible/roles/ncr-tomcat-patching/defaults/main.yml deleted file mode 100644 index cad514bef..000000000 --- a/ansible/roles/ncr-tomcat-patching/defaults/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 -sap_bi_platform_unpack_base_directory: /opt/sap/bip -sap_bi_platform_extraction_directory: /u02/software/BIP_4_3_SP1 -sap_bi_platform_installation_directory: /u01/app/bobj/BIP4 -sap_jvm_unpack_base_directory: /opt/sap/java - -s3: - bip_bucket_name: nomis-combined-reporting-bip-packages20230612143115114600000001 - packages_prefix: BIP_PATCHES/ - files: - sap_bi_platform: - - BIPLATS4303P_300-70002683_P1.EXE - - BIPLATS4303P_300-70002683_P2.RAR - -ssm_parameters_prefix: "tomcat" - -tomcat_post_install_directories: - tomcat: /u01/app/bobj/BIP4/sap_bobj/tomcat - custom_config: /u01/app/bobj/BIP4/sap_bobj/enterprise_xi40/warfiles/webapps/BOE/WEB-INF/config/custom - biprws_config: /u01/app/bobj/BIP4/sap_bobj/enterprise_xi40/warfiles/webapps/biprws/WEB-INF/config/custom - webapps_root: /u01/app/bobj/BIP4/sap_bobj/enterprise_xi40/warfiles/webapps/ROOT diff --git a/ansible/roles/ncr-tomcat-patching/meta/main.yml b/ansible/roles/ncr-tomcat-patching/meta/main.yml deleted file mode 100644 index eda808260..000000000 --- a/ansible/roles/ncr-tomcat-patching/meta/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -dependencies: - - role: get-ec2-facts - - role: ansible-requirements - - role: disable-ipv6 - - role: disable-firewall diff --git a/ansible/roles/ncr-tomcat-patching/tasks/add_response_file.yml b/ansible/roles/ncr-tomcat-patching/tasks/add_response_file.yml deleted file mode 100644 index ee0e1e39e..000000000 --- a/ansible/roles/ncr-tomcat-patching/tasks/add_response_file.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: Copy response file - ansible.builtin.template: - src: u02/software/BIP_4_3_SP1/tomcat_patch_response.ini - dest: "{{ sap_bi_platform_extraction_directory }}/tomcat_response.ini" - owner: bobj - group: binstall - mode: "0755" - -- name: Ensure product key is set in response file - ansible.builtin.lineinfile: - path: "{{ sap_bi_platform_extraction_directory }}/tomcat_patch_response.ini" - regexp: "^productkey=" - line: "productkey={{ tomcat_product_key }}" - -- name: Ensure CMS password is set in response file - ansible.builtin.lineinfile: - path: "{{ sap_bi_platform_extraction_directory }}/tomcat_patch_response.ini" - regexp: "^remotecmsadminpassword=" - line: "remotecmsadminpassword={{ tomcat_cms_password }}" diff --git a/ansible/roles/ncr-tomcat-patching/tasks/main.yml b/ansible/roles/ncr-tomcat-patching/tasks/main.yml deleted file mode 100644 index d31ff13c1..000000000 --- a/ansible/roles/ncr-tomcat-patching/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- import_tasks: add_response_file.yml - tags: - - amibuild - - ec2provision - when: ansible_distribution in ['RedHat'] - -- import_tasks: patch_tomcat.yml - tags: - - amibuild - - ec2provision - when: ansible_distribution in ['RedHat'] diff --git a/ansible/roles/ncr-tomcat-patching/tasks/patch_tomcat.yml b/ansible/roles/ncr-tomcat-patching/tasks/patch_tomcat.yml deleted file mode 100644 index b91e359d8..000000000 --- a/ansible/roles/ncr-tomcat-patching/tasks/patch_tomcat.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Run Patch - become_user: bobj - ansible.builtin.shell: | - . ~/.bash_profile - /u02/software/BIP_4_3_SP1/setup.sh -InstallDir /u01/app/bobj/BIP4/ -r /u02/software/BIP_4_3_SP1/tomcat_patch_response.ini diff --git a/ansible/roles/ncr-tomcat-patching/tasks/post_patching.yml b/ansible/roles/ncr-tomcat-patching/tasks/post_patching.yml deleted file mode 100644 index 55e209a3a..000000000 --- a/ansible/roles/ncr-tomcat-patching/tasks/post_patching.yml +++ /dev/null @@ -1,39 +0,0 @@ -### TOMCAT POST PATCHING CONFIGURATION ---- -- name: Add tomcat config files - ansible.builtin.template: - src: "{{ item.src }}" - dest: "{{ tomcat_post_install_directories.tomcat }}/{{ item.dest }}" - loop: - - { src: "../templates/context.xml", dest: "conf/context.xml" } - - { src: "../templates/setenv.sh", dest: "bin/setenv.sh" } - -- name: Modify wdeploy.conf - ansible.builtin.lineinfile: - path: "{{ sap_bi_platform_installation_directory }}/sap_bobj/enterprise_xi40/wdeploy/conf/wdeploy.conf" - regexp: "^disable_InfoView=" - line: "disable_InfoView=true" - become: true - become_user: bobj - -- name: Add biprws custom config file - ansible.builtin.template: - src: ../templates/properties/biprws.properties - dest: "{{ tomcat_post_install_directories.biprws_config }}/biprws.properties" - -- name: Rename main root files - block: - - name: Backup index file - ansible.builtin.copy: - remote_src: true - src: "{{ tomcat_post_install_directories.webapps_root }}/index.jsp" - dest: "{{ tomcat_post_install_directories.webapps_root }}/index_main.jsp" - become: true - become_user: bobj - -- name: Add root files - ansible.builtin.template: - src: "{{ item.src }}" - dest: "{{ tomcat_post_install_directories.webapps_root }}/{{ item.dest }}" - loop: - - { src: "../templates/root/index.jsp", dest: "index.jsp" } diff --git a/ansible/roles/ncr-tomcat-patching/templates/.gitkeep b/ansible/roles/ncr-tomcat-patching/templates/.gitkeep deleted file mode 100644 index e69de29bb..000000000 From 873f7477bb3137db98a3ffd0659a88fe337c7bd6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 19 Dec 2023 10:56:01 +0000 Subject: [PATCH 2/2] Commit changes made by code formatters --- ansible/roles/ncr-bip-cmc/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/ncr-bip-cmc/defaults/main.yml b/ansible/roles/ncr-bip-cmc/defaults/main.yml index 9e74d9cb2..1c7e2586b 100644 --- a/ansible/roles/ncr-bip-cmc/defaults/main.yml +++ b/ansible/roles/ncr-bip-cmc/defaults/main.yml @@ -24,4 +24,4 @@ bip_cmc_secretsmanager_passwords: bip_cmc: secret: "/ec2/ncr-bip-cmc/t1/passwords" users: - - bip_cmc: auto \ No newline at end of file + - bip_cmc: auto