From 852767cd6a1c27539d654d44e8de155200efa76c Mon Sep 17 00:00:00 2001 From: robertsweetman Date: Tue, 9 Apr 2024 17:19:00 +0100 Subject: [PATCH] use common onr-get role --- ansible/roles/onr-boe/defaults/main.yml | 14 ++--------- .../roles/onr-boe/tasks/extract-software.yml | 21 ---------------- ansible/roles/onr-boe/tasks/main.yml | 24 ++++++++++++------- ansible/roles/onr-get/defaults/main.yml | 10 ++++++++ ansible/roles/onr-get/meta/main.yml | 3 +++ .../tasks/download-software.yml | 17 +------------ .../roles/onr-get/tasks/extract-software.yml | 7 ++++++ ansible/roles/onr-get/tasks/main.yml | 10 ++++++++ 8 files changed, 48 insertions(+), 58 deletions(-) delete mode 100644 ansible/roles/onr-boe/tasks/extract-software.yml create mode 100644 ansible/roles/onr-get/defaults/main.yml create mode 100644 ansible/roles/onr-get/meta/main.yml rename ansible/roles/{onr-boe => onr-get}/tasks/download-software.yml (53%) create mode 100644 ansible/roles/onr-get/tasks/extract-software.yml create mode 100644 ansible/roles/onr-get/tasks/main.yml diff --git a/ansible/roles/onr-boe/defaults/main.yml b/ansible/roles/onr-boe/defaults/main.yml index 62c12d5a4..dad5449d8 100644 --- a/ansible/roles/onr-boe/defaults/main.yml +++ b/ansible/roles/onr-boe/defaults/main.yml @@ -1,8 +1,8 @@ --- artefacts_s3_bucket_name: mod-platform-image-artefact-bucket20230203091453221500000001 artefacts_s3_bucket_path: hmpps/onr -artefact_dir: /u02 # check this -app_dir: /u01/software # check this +artefact_dir: /u02 +app_dir: /u01/software/BOE_3_1_FP7_4_Linux boe_software: ENTERPRISE07P_4-10007478.TGZ boe_install_user: bobj @@ -10,13 +10,3 @@ boe_install_group: binstall stage: "{{ artefact_dir }}/stage" temp: "{{ artefact_dir }}/temp" - -# sap_boe_platform_unpack_base_directory: /opt/sap/boe -# 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_host_agent_base_directory: /opt/sap/hostagent - -# ncr_environment: "{{ ec2.tags['nomis-combined-reporting-environment'] }}" -# node: "{{ ec2.tags['node'] }}" -# application_type: "{{ ec2.tags['type'] }}" diff --git a/ansible/roles/onr-boe/tasks/extract-software.yml b/ansible/roles/onr-boe/tasks/extract-software.yml deleted file mode 100644 index 61320b697..000000000 --- a/ansible/roles/onr-boe/tasks/extract-software.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# - name: Check if the BOE software has been extracted -# stat: -# path: "{{ app_dir }}" -# register: software_extracted - -# - name: Unpack the install files -# block: - - name: Unpack the BOE software - ansible.builtin.unarchive: - src: "{{ stage }}/{{ boe_software }}" - dest: "{{ app_dir }}" - remote_src: yes - # when: stage is defined - # when: not software_extracted.stat.exists - # rescue: - # - name: Remove the unpacked BOE software - # file: - # path: "{{ app_dir }}/BOE" - # state: absent - # # when: stage is defined diff --git a/ansible/roles/onr-boe/tasks/main.yml b/ansible/roles/onr-boe/tasks/main.yml index e539df995..52daa9bbc 100644 --- a/ansible/roles/onr-boe/tasks/main.yml +++ b/ansible/roles/onr-boe/tasks/main.yml @@ -26,19 +26,25 @@ # - oracle_db_reconfigure_has # - oracle_db_restore_databases -- import_tasks: download-software.yml - tags: - - amibuild - - ec2provision - # - oracle_db_get_base_software -# - import_tasks: install-base-software.yml +# - import_tasks: download-software.yml +# tags: +# - amibuild +# - ec2provision +# # - oracle_db_get_base_software +# # - import_tasks: install-base-software.yml +# # tags: +# # - amibuild +# # - ec2provision +# # - oracle_db_install_base_software + +# - import_tasks: extract-software.yml # tags: # - amibuild # - ec2provision -# - oracle_db_install_base_software +# # - oracle_db_extract_base_software -- import_tasks: extract-software.yml +- ansible.builtin.import_role: + name: onr-get tags: - amibuild - ec2provision - # - oracle_db_extract_base_software diff --git a/ansible/roles/onr-get/defaults/main.yml b/ansible/roles/onr-get/defaults/main.yml new file mode 100644 index 000000000..835e48748 --- /dev/null +++ b/ansible/roles/onr-get/defaults/main.yml @@ -0,0 +1,10 @@ +--- +artefacts_s3_bucket_name: mod-platform-image-artefact-bucket20230203091453221500000001 +artefacts_s3_bucket_path: hmpps/onr +artefact_dir: /u02 +app_dir: /u01/software/BOE_3_1_FP7_4_Linux + +boe_software: ENTERPRISE07P_4-10007478.TGZ + +stage: "{{ artefact_dir }}/stage" +temp: "{{ artefact_dir }}/temp" diff --git a/ansible/roles/onr-get/meta/main.yml b/ansible/roles/onr-get/meta/main.yml new file mode 100644 index 000000000..4ff987c1c --- /dev/null +++ b/ansible/roles/onr-get/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: get-ec2-facts diff --git a/ansible/roles/onr-boe/tasks/download-software.yml b/ansible/roles/onr-get/tasks/download-software.yml similarity index 53% rename from ansible/roles/onr-boe/tasks/download-software.yml rename to ansible/roles/onr-get/tasks/download-software.yml index 35b758fa5..32c68e506 100644 --- a/ansible/roles/onr-boe/tasks/download-software.yml +++ b/ansible/roles/onr-get/tasks/download-software.yml @@ -12,20 +12,6 @@ - "{{ app_dir }}" tags: - amibuild - # - oracle_19c_download - # - oracle_19c_create_dirs - -# - name: Download oracle prerequisite rpms from S3 bucket -# amazon.aws.aws_s3: -# bucket: "{{ artefacts_s3_bucket_name }}" -# object: "{{ artefacts_s3_bucket_path }}/{{ item }}" -# dest: "{{ stage }}/{{ item }}" -# mode: get -# overwrite: latest -# loop: -# - "{{ oracle_prereq_rpm }}" -# - "{{ oracle_asmlib_rpm }}" -# - "{{ oracleasm_support_rpm }}" - name: Download BOE software from S3 bucket amazon.aws.aws_s3: @@ -36,5 +22,4 @@ overwrite: latest loop: - "{{ boe_software }}" - # - "{{ grid_software }}" - # - "{{ opatch }}" + diff --git a/ansible/roles/onr-get/tasks/extract-software.yml b/ansible/roles/onr-get/tasks/extract-software.yml new file mode 100644 index 000000000..f42969937 --- /dev/null +++ b/ansible/roles/onr-get/tasks/extract-software.yml @@ -0,0 +1,7 @@ +--- +- name: Unpack the BOE software + ansible.builtin.unarchive: + src: "{{ stage }}/{{ boe_software }}" + dest: "{{ app_dir }}" + remote_src: yes + diff --git a/ansible/roles/onr-get/tasks/main.yml b/ansible/roles/onr-get/tasks/main.yml new file mode 100644 index 000000000..f249dc7c6 --- /dev/null +++ b/ansible/roles/onr-get/tasks/main.yml @@ -0,0 +1,10 @@ +--- +- import_tasks: download-software.yml + tags: + - amibuild + - ec2provision + +- import_tasks: extract-software.yml + tags: + - amibuild + - ec2provision