From fffac8c46e3f7be545ae9db0bf4128b15c61daed Mon Sep 17 00:00:00 2001 From: hdamecharla <71097261+hdamecharla@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:36:40 +0530 Subject: [PATCH] Final PR for release v3.9.3.0 (#500) * Merge from main to experimental (#490) * remove duplicate definitions * remove duplicate --------- Co-authored-by: Kimmo Forss * Prepare for hotfix 3.9.2.0 * Add permissions for control plane SPN * Updated variable name * Change provider for network links * Undo * Change provider * Update the ref in the resources.yml (cherry picked from commit 240862074a635165945326f6bb81d234f17eb611) * changes required for release 3.9.2.0 * skip resource provider * HotFix 3.9.3 * Preparation for hotfix release 3.9.3 * Add the missing exports * Update advanced state management * move second parameter * Add verbosity * Update pipeline * remove the vault * remove the quotes * add the getopt values * move the order * Don't create the configuration variables * Switch the if statement * Don't reset the step * Add the support for test only for workload zone as well * Name rationalization * Add support for multiple IP ranges * Using a list * adress space check * change the address space to list * use the correct output * Use the renamed output storageaccount_resourcegroup_name * Don't perform deployment if not logged on as SPN * format * simplify network logic * Fix the logic for deployer configuration * Fix deployer and flatten the list of vnets * Fix the list of vnets * remove the set statements * Version update and fault domain counter * Update the template * Web App updates * Variable renames * Update pipeline * Package updates * Add support for multiple address ranges * Change HTML IDs * deployment task * Update Azure Identity * More informative task names * Feng shui * change the dns creation logic * Fixes for IPs * Default upgrade packages to false * Switch to use instance metadata * Add support for extending packages, mounts etc * Rel 9.2 support * Add support for dynamically retrieval of SWPM10 * hdbuserstore updates * pacemaker updates * Load Balancer timeout updates * Format the Terraform files, add support for tags for all resources * Start documentation of variables * Add support for providing tags for all resources * Support deployerless deployments * Add missing tags * Web App updates (tag support) * Add a dependency on the private end point * Add dependency for container * Work on the dependency map * Add a dependency on the storage account network rules * Make the public access same for both storage accounts * change the dependency order * store the state file if failure when removing * Adding the missing parameters * Set permissions on variable groups * Fix the Invoke-Restmethod call * Allow resetting of PAT * Fix typo * Resetting of PAT * allow reusing of repo * Add permissions to pipelines * Simplify the query * Add a pause * Remove default access for all pipelines * Don't show Invoke-RestMethod response * Add pipelines permissions for pool * Don't set permissions on pools (yet) * Add permissions on agent pools * Use the queue id and not the pool ID * Add more info * Final version for next release * prepare for release 3.9.3.0 * install lint 6.20.3 for the workflow as we are not ready to 6.21 yet. * suppress tracing when checking variables * Lint fixes * Linting * remove extended character * Pull in main * Several improvements and additions for deploying DB2 (#496) * Bugfix nproc unlimited for dbsidadm group, not db2sidadm group * Use virtual_host from hostvars (inventory) for DB2 installation * Fixed DB2 log_dir mountpoint DB2 log_dir was mounted on /log/SID/dir instead of /db2/SID/log_dir * Fix Agent_IP variable for sap_library * Remove become and orchestration user for delegated VmAgentActions tasks * Improve 2.10-sap-notes tasks * Optimize SAP OS USERS and Group Creation (user_nw) tasks * Remove unused input-api variables * Add custom virtual_hostname variabels for db, ers, scs and pas * Add vars for ASCS/ERS NFS filesystem devices when not using AFS or ANF * Bugfix data source azuread_service_principal Error: Unsupported argument on imports.tf line 49, in data "azuread_service_principal" "sp": client_id = local.spn.client_id An argument named "client_id" is not expected here. one of `application_id,display_name,object_id` must be specified * Contain setting of HANA schema name to only execute when deploying HANA * alingment on task and set execution bit for the acss-registration shell script. --------- Co-authored-by: Kimmo Forss Co-authored-by: Harm Jan Stam --- deploy/ansible/playbook_04_00_01_db_ha.yaml | 10 +-- .../playbook_05_00_00_sap_scs_install.yaml | 11 ++-- .../4.0.0-hdb-install/tasks/main.yaml | 15 +++-- .../4.0.1.5-provision_hana_replication.yml | 44 ++++++------- .../tasks/4.0.1.7-sap-profile-changes.yml | 12 ++-- .../roles-db/4.0.1-hdb-hsr/tasks/main.yml | 24 +++---- .../roles-db/4.2.0-db2-install/tasks/main.yml | 11 ++-- .../tasks/4.2.1.0-db2_ha_install_primary.yml | 6 +- .../4.2.1.2-db2_ha_install_secondary.yml | 6 +- .../tasks/4.2.1.7-sap-profile-changes.yaml | 6 +- .../tasks/4.3.0.5-install_db_instance.yml | 2 +- .../tasks/4.4.1.1-mssql-alwayson-config.yaml | 2 +- .../0.7-VmAgentActions/tasks/main.yaml | 10 ++- .../1.9-kernelparameters/tasks/main.yaml | 4 +- .../2.10-sap-notes/tasks/main.yaml | 62 +++++++------------ .../2.4-hosts-file/tasks/main.yaml | 31 ++++------ .../2.5-sap-users/tasks/user_nw.yaml | 44 ++----------- .../2.6-sap-mounts/defaults/main.yaml | 2 +- .../tasks/2.6.4-db2-mounts.yaml | 5 +- .../3.3.1-bom-utility/tasks/bom-template.yaml | 6 +- .../5.0.0-scs-install/defaults/main.yml | 2 +- .../5.0.0-scs-install/tasks/main.yaml | 8 +-- .../5.0.1-scs-ha-install/tasks/main.yaml | 2 +- .../5.0.2-ers-ha-install/tasks/main.yaml | 3 +- .../roles-sap/5.1-dbload/tasks/main.yaml | 20 +++--- .../roles-sap/5.2-pas-install/tasks/main.yaml | 54 ++++++++-------- .../roles-sap/5.3-app-install/tasks/main.yaml | 46 +++++++------- .../roles-sap/5.4-web-install/tasks/main.yaml | 6 +- .../tasks/5.5.3-SAPHanaSR.yml | 4 +- .../tasks/5.5.5-post_provision_report.yml | 4 +- .../tasks/5.6.1-set_runtime_facts.yml | 5 -- .../tasks/5.6.4-provision.yml | 1 - .../tasks/5.6.4.0-cluster-RedHat.yml | 6 ++ .../5.6.4.0-cluster-Suse-SimpleMount.yml | 6 ++ .../tasks/5.6.4.0-cluster-Suse.yml | 6 ++ .../3.3.1-bom-utility/tasks/bom-template.yaml | 6 +- .../5.0.0-scs-install/defaults/main.yml | 1 + .../windows/5.0.0-scs-install/tasks/main.yaml | 15 +---- .../windows/5.1-dbload/tasks/main.yaml | 10 +-- .../windows/5.2-pas-install/tasks/main.yaml | 8 +-- .../windows/5.3-app-install/tasks/main.yaml | 8 +-- deploy/ansible/vars/ansible-input-api.yaml | 17 ++--- .../pipelines/templates/acss-registration.sh | 0 .../bootstrap/sap_library/imports.tf | 2 +- deploy/terraform/run/sap_landscape/imports.tf | 2 +- deploy/terraform/run/sap_library/imports.tf | 2 +- deploy/terraform/run/sap_library/module.tf | 2 +- deploy/terraform/run/sap_system/imports.tf | 3 +- .../modules/sap_library/variables_global.tf | 8 +-- 49 files changed, 247 insertions(+), 323 deletions(-) mode change 100644 => 100755 deploy/pipelines/templates/acss-registration.sh diff --git a/deploy/ansible/playbook_04_00_01_db_ha.yaml b/deploy/ansible/playbook_04_00_01_db_ha.yaml index df6b584ae5..98771efb7d 100644 --- a/deploy/ansible/playbook_04_00_01_db_ha.yaml +++ b/deploy/ansible/playbook_04_00_01_db_ha.yaml @@ -587,11 +587,11 @@ domain_service_password: "{{ hostvars.localhost.adsvc_password }}" witness_storage_account_name: "{{ hostvars.localhost.witness_storage_account_name }}" witness_storage_account_key: "{{ hostvars.localhost.witness_storage_account_key }}" - win_sql_svc_account: '{{ sql_svc_account }}' - win_sql_svc_password: '{{ sql_svc_password }}' - win_sqlagent_svc_account: '{{ sql_agent_account }}' - win_sqlagent_svc_password: '{{ sql_agent_password }}' - scs_server_name: "{{ scs_server }}" + win_sql_svc_account: "{{ sql_svc_account }}" + win_sql_svc_password: "{{ sql_svc_password }}" + win_sqlagent_svc_account: "{{ sql_agent_account }}" + win_sqlagent_svc_password: "{{ sql_agent_password }}" + scs_server_name: "{{ custom_scs_virtual_hostname | default(scs_server, true) }}" tags: - 4.4.1.0-mssql-alwayson diff --git a/deploy/ansible/playbook_05_00_00_sap_scs_install.yaml b/deploy/ansible/playbook_05_00_00_sap_scs_install.yaml index 8f35a248ba..89773d4538 100644 --- a/deploy/ansible/playbook_05_00_00_sap_scs_install.yaml +++ b/deploy/ansible/playbook_05_00_00_sap_scs_install.yaml @@ -222,7 +222,6 @@ ansible.builtin.set_fact: tier: scs main_password: "{{ hostvars.localhost.sap_password }}" - scs_high_availability: "{{ scs_high_availability }}" sapbits_location_base_path: "{{ hostvars.localhost.sapbits_location_base_path }}" sapbits_sas_token: "{{ hostvars.localhost.sapbits_sas_token }}" always_upload_jinja_templates: false @@ -324,7 +323,6 @@ svc_password: "{{ hostvars.localhost.svcadm_password }}" primary_node: "{{ ansible_play_hosts_all[0] }}" secondary_node: "" - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" loop: "{{ all_sids }}" loop_control: loop_var: sid_to_be_deployed @@ -430,8 +428,6 @@ fencing_spn_client_pwd: "{% if not use_msi_for_clusters %}{{ hostvars.localhost.sap_fencing_spn_pwd }}{% endif %}" fencing_spn_tenant_id: "{% if not use_msi_for_clusters %}{{ hostvars.localhost.sap_fencing_spn_tenant_id }}{% endif %}" always_upload_jinja_templates: false - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" tags: - always @@ -507,6 +503,8 @@ public: true vars: scs_instance_number: "{{ sid_to_be_deployed.ascs_inst_no }}" + scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(sap_sid | lower ~ 'scs' ~ scs_instance_number ~ 'cl1', true) }}" + ers_virtual_hostname: "{{ custom_ers_virtual_hostname | default(sap_sid | lower ~ 'ers' ~ ers_instance_number ~ 'cl2', true) }}" loop: "{{ all_sids }}" loop_control: loop_var: sid_to_be_deployed @@ -625,9 +623,8 @@ secondary_node_ip_ers: "{{ hostvars[ansible_play_hosts_all[1]]['ansible_eth0']['ipv4']['address'] }}" ansible_winrm_transport: credssp ansible_winrm_server_cert_validation: ignore - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" - + scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(sap_sid | lower ~ 'scs' ~ scs_instance_number ~ 'cl1', true) }}" + ers_virtual_hostname: "{{ custom_ers_virtual_hostname | default(sap_sid | lower ~ 'ers' ~ ers_instance_number ~ 'cl2', true) }}" loop: "{{ all_sids }}" loop_control: loop_var: sid_to_be_deployed diff --git a/deploy/ansible/roles-db/4.0.0-hdb-install/tasks/main.yaml b/deploy/ansible/roles-db/4.0.0-hdb-install/tasks/main.yaml index 91b2d0e3b8..077b209595 100644 --- a/deploy/ansible/roles-db/4.0.0-hdb-install/tasks/main.yaml +++ b/deploy/ansible/roles-db/4.0.0-hdb-install/tasks/main.yaml @@ -13,8 +13,7 @@ # +------------------------------------4--------------------------------------*/ - name: "SAP HANA: Set BOM facts" ansible.builtin.set_fact: - sap_inifile: "hdbserver_{{ ansible_hostname }}_{{ sap_sid }}_install.rsp" - hana_host: "{% if db_high_availability %}{{ ansible_hostname }}{% else %}{{ virtual_host }}{% endif %}" + sap_inifile: "hdbserver_{{ virtual_host }}_{{ sap_sid }}_install.rsp" dir_params: "{{ tmp_directory }}/.params" # 0x) Create hidden directory for parameter files @@ -68,7 +67,7 @@ _rsp_component_root: "../COMPONENTS" _rsp_components: "{{ hana_components }}" _rsp_sapmnt: "/hana/shared" # Default Value - _rsp_hostname: "{{ hana_host }}" + _rsp_hostname: "{{ virtual_host }}" _rsp_sid: "{{ db_sid | upper }}" _rsp_number: "{{ db_instance_number }}" _rsp_system_usage: "custom" @@ -81,11 +80,11 @@ - name: "SAP HANA: installation" block: - - name: "SAP HANA: Execute hdblcm on {{ (hana_host) }}" + - name: "SAP HANA: Execute hdblcm on {{ virtual_host }}" ansible.builtin.shell: | umask {{ custom_umask | default('022') }} ; chmod 755 /usr/sap; - ./hdblcm --batch --action=install --hostname {{ hana_host }} --configfile='{{ dir_params }}/{{ sap_inifile }}' + ./hdblcm --batch --action=install --hostname {{ virtual_host }} --configfile='{{ dir_params }}/{{ sap_inifile }}' args: chdir: "{{ target_media_location }}/CD_HDBSERVER/SAP_HANA_DATABASE" creates: "/etc/sap_deployment_automation/{{ db_sid | upper }}/sap_deployment_hdb.txt" @@ -105,13 +104,13 @@ when: hana_installation.rc == 1 - - name: "SAP HANA: Re-execute hdblcm on {{ (hana_host) }} and rescue" + - name: "SAP HANA: Re-execute hdblcm on {{ virtual_host }} and rescue" block: - - name: "SAP HANA: Re-execute hdblcm on {{ (hana_host) }}" + - name: "SAP HANA: Re-execute hdblcm on {{ virtual_host }}" ansible.builtin.shell: | umask {{ custom_umask | default('022') }} ; chmod 755 /usr/sap; - ./hdblcm --batch --action=install --hostname {{ hana_host }} --configfile='{{ dir_params }}/{{ sap_inifile }}' + ./hdblcm --batch --action=install --hostname {{ virtual_host }} --configfile='{{ dir_params }}/{{ sap_inifile }}' args: chdir: "{{ target_media_location }}/CD_HDBSERVER/SAP_HANA_DATABASE" creates: "/etc/sap_deployment_automation/{{ db_sid | upper }}/sap_deployment_hdb.txt" diff --git a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.5-provision_hana_replication.yml b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.5-provision_hana_replication.yml index 82c195750e..eab85d40fc 100644 --- a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.5-provision_hana_replication.yml +++ b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.5-provision_hana_replication.yml @@ -30,14 +30,14 @@ HOME: "/usr/sap/{{ db_sid | upper }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" DIR_SYSEXE: "/usr/sap/{{ db_sid | upper }}/SYS/exe/hdb" SAPSYSTEMNAME: "{{ db_sid | upper }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" when: - ansible_hostname == primary_instance_name @@ -108,14 +108,14 @@ HOME: "/usr/sap/{{ db_sid | upper }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" DIR_SYSEXE: "/usr/sap/{{ db_sid | upper }}/SYS/exe/hdb" SAPSYSTEMNAME: "{{ db_sid | upper }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" when: ansible_hostname == primary_instance_name @@ -126,10 +126,10 @@ become_user: "{{ db_sid_admin_user }}" become: true block: - - name: "HANA HSR: - Stop HANA on {{ ansible_hostname | lower }}" + - name: "HANA HSR: - Stop HANA on {{ virtual_host }}" ansible.builtin.import_tasks: ../../../roles-misc/0.4-helpers/tasks/04.02-stop_hana.yml - - name: "HANA HSR: - Start HANA on {{ ansible_hostname | lower }}" + - name: "HANA HSR: - Start HANA on {{ virtual_host }}" ansible.builtin.import_tasks: ../../../roles-misc/0.4-helpers/tasks/04.01-start_hana.yml vars: ansible_python_interpreter: python3 @@ -137,34 +137,34 @@ HOME: "/usr/sap/{{ db_sid | upper }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" DIR_SYSEXE: "/usr/sap/{{ db_sid | upper }}/SYS/exe/hdb" SAPSYSTEMNAME: "{{ db_sid | upper }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" when: ansible_hostname == primary_instance_name - name: "HANA HSR: - Ensure System Replication is configured command on secondary" ansible.builtin.debug: - msg: "{{ hdbnsutil_command }} -sr_register --remoteHost={{ primary_instance_name }} --remoteInstance={{ db_instance_number }} + msg: "{{ hdbnsutil_command }} -sr_register --remoteHost={{ hostvars[primary_instance_name]['virtual_host'] }} --remoteInstance={{ db_instance_number }} --replicationMode={{ hana_replication_mode }} --operationMode={{ hana_operation_mode }} --name=SITEB" verbosity: 4 - name: "HANA HSR: - Ensure System Replication is configured on secondary" block: - - name: "HANA HSR: - Stop HANA on {{ ansible_hostname | lower }}" + - name: "HANA HSR: - Stop HANA on {{ virtual_host }}" ansible.builtin.import_tasks: ../../../roles-misc/0.4-helpers/tasks/04.02-stop_hana.yml - name: "HANA HSR: - Ensure Secondary node is registered as secondary in replication" become_user: "{{ db_sid_admin_user }}" become: true ansible.builtin.shell: > - {{ hdbnsutil_command }} -sr_register --remoteHost={{ primary_instance_name }} + {{ hdbnsutil_command }} -sr_register --remoteHost={{ hostvars[primary_instance_name]['virtual_host'] }} --remoteInstance={{ db_instance_number }} --replicationMode={{ hana_replication_mode }} --operationMode={{ hana_operation_mode }} --name=SITEB register: hsr_secondary_registration @@ -172,7 +172,7 @@ args: executable: /bin/bash - - name: "HANA HSR: - Start HANA on {{ ansible_hostname | lower }}" + - name: "HANA HSR: - Start HANA on {{ virtual_host }}" ansible.builtin.import_tasks: ../../../roles-misc/0.4-helpers/tasks/04.01-start_hana.yml vars: ansible_python_interpreter: python3 @@ -180,14 +180,14 @@ HOME: "/usr/sap/{{ db_sid | upper }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" DIR_SYSEXE: "/usr/sap/{{ db_sid | upper }}/SYS/exe/hdb" SAPSYSTEMNAME: "{{ db_sid | upper }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname | lower }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" when: - ansible_hostname == secondary_instance_name diff --git a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.7-sap-profile-changes.yml b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.7-sap-profile-changes.yml index d667c9141d..a6f8a89b7e 100644 --- a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.7-sap-profile-changes.yml +++ b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/4.0.1.7-sap-profile-changes.yml @@ -28,8 +28,8 @@ - name: "HSR: 4.0.1.7 - Check if SAP DEFAULT.PFL changes are needed" ansible.builtin.lineinfile: path: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" - regexp: "^SAPDBHOST = {{ db_lb_virtual_host }}" - line: "SAPDBHOST = {{ db_lb_virtual_host }}" + regexp: "^SAPDBHOST = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" + line: "SAPDBHOST = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" state: present check_mode: true register: check_default_pfl @@ -51,7 +51,7 @@ - name: "HSR: 4.0.1.7 - SAP DEFAULT.PFL changes - add db virtual hostname " ansible.builtin.lineinfile: path: /sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL - line: SAPDBHOST = {{ db_lb_virtual_host }} + line: SAPDBHOST = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }} insertafter: '#SAPDBHOST' when: - check_default_pfl is changed @@ -64,8 +64,8 @@ - name: "HSR: 4.0.1.7 - Check if SAP DEFAULT.PFL changes are needed for JAVA" ansible.builtin.lineinfile: path: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" - regexp: "^j2ee/dbhost = {{ db_lb_virtual_host }}" - line: "j2ee/dbhost = {{ db_lb_virtual_host }}" + regexp: "^j2ee/dbhost = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" + line: "j2ee/dbhost = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" state: present check_mode: true register: check_default_pfl @@ -87,7 +87,7 @@ - name: "HSR: 4.0.1.7 - SAP DEFAULT.PFL changes - add db virtual hostname for JAVA" ansible.builtin.lineinfile: path: /sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL - line: j2ee/dbhost = {{ db_lb_virtual_host }} + line: j2ee/dbhost = {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }} insertafter: '#j2ee/dbhost' when: - check_default_pfl is changed diff --git a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/main.yml b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/main.yml index acca53ac2d..9e5b193365 100644 --- a/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/main.yml +++ b/deploy/ansible/roles-db/4.0.1-hdb-hsr/tasks/main.yml @@ -26,13 +26,13 @@ HOME: "/usr/sap/{{ hana_tenant_database_name }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" SAPSYSTEMNAME: "{{ hana_tenant_database_name }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" TEMPDIR: "{{ tmp_directory }}/{{ sap_sid | upper }}" ANSIBLE_REMOTE_TMP: "{{ tmp_directory }}/{{ sap_sid | upper }}" @@ -53,13 +53,13 @@ HOME: "/usr/sap/{{ hana_tenant_database_name }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" SAPSYSTEMNAME: "{{ hana_tenant_database_name }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" TEMPDIR: "{{ tmp_directory }}/{{ sap_sid | upper }}" ANSIBLE_REMOTE_TMP: "{{ tmp_directory }}/{{ sap_sid | upper }}" @@ -78,14 +78,14 @@ HOME: "/usr/sap/{{ hana_tenant_database_name }}/home" PYTHONHOME: "/usr/sap/{{ DB }}/exe/Python3" DIR_EXECUTABLE: "/usr/sap/{{ DB }}/exe" - SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ ansible_hostname }}" + SAP_RETRIEVAL_PATH: "/usr/sap/{{ DB }}/{{ virtual_host }}" DIR_SYSEXE: "/usr/sap/{{ hana_tenant_database_name }}/SYS/exe/hdb" SAPSYSTEMNAME: "{{ hana_tenant_database_name }}" - SECUDIR: "/usr/sap/{{ DB }}/{{ ansible_hostname }}/sec" + SECUDIR: "/usr/sap/{{ DB }}/{{ virtual_host }}/sec" DAT_BIN_DIR: "/usr/sap/{{ DB }}/exe/dat_bin_dir" DIR_INSTANCE: "/usr/sap/{{ DB }}" - PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" - PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ ansible_hostname }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" + PYTHONPATH: "/usr/sap/{{ DB }}/exe/Py3:/usr/sap/HDB/SYS/global/hdb/custom/python_support:/usr/sap/{{ DB }}/exe/python_support:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/testscripts:/usr/sap/{{ DB }}/exe/Python3/lib/python3.7" + PATH: "/usr/sap/{{ DB }}/exe/krb5/bin:/usr/sap/{{ DB }}/exe/krb5/sbin:/usr/sap/{{ DB }}/{{ virtual_host }}:/usr/sap/{{ DB }}:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/mdc:/usr/sap/{{ DB }}/exe/Python3/bin:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/HDB/home:/usr/sap/HDB/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/mit/bin" LD_LIBRARY_PATH: "/usr/sap/{{ DB }}/exe/krb5/lib/krb5/plugins/preauth:/usr/sap/{{ DB }}/exe/krb5/lib:/usr/sap/{{ DB }}/exe:/usr/sap/{{ DB }}/exe/Python3/lib:/usr/sap/{{ DB }}/exe/Py3:/usr/sap/{{ DB }}/exe/filter:/usr/sap/{{ DB }}/exe/dat_bin_dir:/usr/sap/{{ DB }}/exe/plugins/afl:/usr/sap/{{ DB }}/exe/plugins/lcapps:/usr/sap/{{ DB }}/exe/plugins/repository:/usr/sap/{{ DB }}/exe/plugins/epmmds:/usr/sap/HDB/SYS/global/hdb/federation:/usr/sap/HDB/SYS/global/hdb/plugins/3rd_party_libs:/usr/sap/HDB/SYS/global/hdb/plugins/1st_party_libs" TEMPDIR: "{{ tmp_directory }}/{{ sap_sid | upper }}" ANSIBLE_REMOTE_TMP: "{{ tmp_directory }}/{{ sap_sid | upper }}" diff --git a/deploy/ansible/roles-db/4.2.0-db2-install/tasks/main.yml b/deploy/ansible/roles-db/4.2.0-db2-install/tasks/main.yml index 55590e07f7..d7f6d211cc 100644 --- a/deploy/ansible/roles-db/4.2.0-db2-install/tasks/main.yml +++ b/deploy/ansible/roles-db/4.2.0-db2-install/tasks/main.yml @@ -68,19 +68,17 @@ db2_cd_package_db2client: "{{ db2_archive_path }}/db2client" db2_cd_package_software: "{{ db2_archive_path }}/db2server/LINUXX86_64" db2_cd_package_kernel: "{{ target_media_location }}/download_basket/" - sap_db_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_DB') | first }}" + sap_db_hostname: "{{ virtual_host }}" db2_encryption_algo_type: "AES" db2_ase_encryption_length: "256" db2_encryption_keystore_dir: /db2/db2{{ db_sid | lower }}/keystore - db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ sap_db_hostname }}_ssl_comm_000" - sap_scs_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first }}" + db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ virtual_host }}_ssl_comm_000" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first]['virtual_host'], true) }}" sap_profile_dir: "/sapmnt/{{ sap_sid | upper }}/profile" tier: "db2S" db2_memory: "{{ mem_size | int }}" param_directory: "{{ dir_params }}" - # +--------------------------------4--------------------------------------*/ - # - # - name: "SAP DB2 install: variables" + - name: "DB2 Install: install variables" ansible.builtin.debug: msg: @@ -102,7 +100,6 @@ # *================================4=======================================8 # SAP DB2: Install # 2230669 - System Provisioning Using a Parameter Input File - # - name: "DB2 Install - SAPINST DB2 Install" ansible.builtin.shell: | diff --git a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.0-db2_ha_install_primary.yml b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.0-db2_ha_install_primary.yml index 9e76496319..d4492ea8d3 100644 --- a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.0-db2_ha_install_primary.yml +++ b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.0-db2_ha_install_primary.yml @@ -92,12 +92,12 @@ db2_cd_package_db2client: "{{ db2_archive_path }}/db2client" db2_cd_package_software: "{{ db2_archive_path }}/db2server/LINUXX86_64" db2_cd_package_kernel: "{{ target_media_location }}/download_basket/" - sap_db_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_DB') | first }}" + sap_db_hostname: "{{ virtual_host }}" db2_encryption_algo_type: "AES" db2_ase_encryption_length: "256" db2_encryption_keystore_dir: /db2/db2{{ db_sid | lower }}/keystore - db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ sap_db_hostname }}_ssl_comm_000" - sap_scs_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first }}" + db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ virtual_host }}_ssl_comm_000" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first]['virtual_host'], true) }}" sap_profile_dir: "/sapmnt/{{ sap_sid | upper }}/profile" param_directory: "{{ dir_params }}" db2_memory: "{{ mem_size | int }}" diff --git a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.2-db2_ha_install_secondary.yml b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.2-db2_ha_install_secondary.yml index 521f54490d..af49e192f4 100644 --- a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.2-db2_ha_install_secondary.yml +++ b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.2-db2_ha_install_secondary.yml @@ -82,12 +82,12 @@ db2_cd_package_db2client: "{{ db2_archive_path }}/db2client" db2_cd_package_software: "{{ db2_archive_path }}/db2server/LINUXX86_64" db2_cd_package_kernel: "{{ target_media_location }}/download_basket/" - sap_db_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_DB') | first }}" + sap_db_hostname: "{{ virtual_host }}" db2_encryption_algo_type: "AES" db2_ase_encryption_length: "256" db2_encryption_keystore_dir: /db2/db2{{ db_sid | lower }}/keystore - db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ sap_db_hostname }}_ssl_comm_000" - sap_scs_hostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first }}" + db2_sslencryption_label: "sap_db2{{ db_sid }}_{{ virtual_host }}_ssl_comm_000" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') | first]['virtual_host'], true) }}" sap_profile_dir: "/sapmnt/{{ sap_sid | upper }}/profile" param_directory: "{{ dir_params }}" db2_memory: "{{ mem_size | int }}" diff --git a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.7-sap-profile-changes.yaml b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.7-sap-profile-changes.yaml index 8589153919..4ae9ceaf47 100644 --- a/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.7-sap-profile-changes.yaml +++ b/deploy/ansible/roles-db/4.2.1-db2-hainstall/tasks/4.2.1.7-sap-profile-changes.yaml @@ -21,7 +21,7 @@ - name: "4.2.1.7 - SAP DEFAULT.PFL changes - add db virtual hostname " ansible.builtin.lineinfile: path: /sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL - line: SAPDBHOST = {{ db_virtual_hostname }} + line: SAPDBHOST = {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }} insertafter: '#SAPDBHOST' tags: - dbhostpara @@ -29,7 +29,7 @@ - name: "4.2.1.7 - SAP DEFAULT.PFL changes - add db virtual hostname " ansible.builtin.lineinfile: path: /sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL - line: j2ee/dbhost = {{ db_virtual_hostname }} + line: j2ee/dbhost = {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }} insertafter: '#SAPDBHOST' tags: - j2eedbhostpara @@ -46,7 +46,7 @@ - name: "4.2.1.7 - SAP db2cli.ini profile changes " ansible.builtin.lineinfile: path: /sapmnt/{{ sap_sid | upper }}/global/db6/db2cli.ini - line: Hostname = {{ db_virtual_hostname }} + line: Hostname = {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }} insertafter: '#Hostname' tags: - virtdbhostpara diff --git a/deploy/ansible/roles-db/4.3.0-ase-install/tasks/4.3.0.5-install_db_instance.yml b/deploy/ansible/roles-db/4.3.0-ase-install/tasks/4.3.0.5-install_db_instance.yml index 2bc24226fc..319e3bc931 100644 --- a/deploy/ansible/roles-db/4.3.0-ase-install/tasks/4.3.0.5-install_db_instance.yml +++ b/deploy/ansible/roles-db/4.3.0-ase-install/tasks/4.3.0.5-install_db_instance.yml @@ -65,7 +65,7 @@ umask {{ custom_umask | default('022') }}; ./sapinst SAPINST_INPUT_PARAMETERS_URL={{ dir_params }}/{{ sap_inifile }} \ SAPINST_EXECUTE_PRODUCT_ID={{ bom.product_ids.dbl }} \ - SAPINST_USE_HOSTNAME={{ sap_db_hostname }} \ + SAPINST_USE_HOSTNAME={{ virtual_host }} \ SAPINST_SKIP_DIALOGS=true \ SAPINST_START_GUISERVER=false args: diff --git a/deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.1.1-mssql-alwayson-config.yaml b/deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.1.1-mssql-alwayson-config.yaml index 953a563fdb..1267d2970e 100644 --- a/deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.1.1-mssql-alwayson-config.yaml +++ b/deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.1.1-mssql-alwayson-config.yaml @@ -315,7 +315,7 @@ block: - name: "Calculate the SCS Virtual Instance hostname" ansible.builtin.set_fact: - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" + scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(sap_sid | lower ~ 'scs' ~ scs_instance_number ~ 'cl1', true) }}" - name: "Set environment variables required for AlwaysON required by SAP" ansible.windows.win_environment: diff --git a/deploy/ansible/roles-misc/0.7-VmAgentActions/tasks/main.yaml b/deploy/ansible/roles-misc/0.7-VmAgentActions/tasks/main.yaml index 3a85e2a958..bb309711d8 100644 --- a/deploy/ansible/roles-misc/0.7-VmAgentActions/tasks/main.yaml +++ b/deploy/ansible/roles-misc/0.7-VmAgentActions/tasks/main.yaml @@ -6,8 +6,7 @@ - name: "Get VM list from resource_group: {{ resourceGroup_name }}" delegate_to: localhost - become: true - become_user: "{{ orchestration_ansible_user }}" + become: false ansible.builtin.command: >- az vm list --resource-group {{ resourceGroup_name }} \ --subscription {{ subscriptionId }} --query [].name -o tsv @@ -21,8 +20,7 @@ # foreach vm in rg_vm_list, find the agent status and reboot the VM when status is not ready - name: "Get the agent status for each VM in resource_group: {{ resourceGroup_name }}" delegate_to: localhost - become: true - become_user: "{{ orchestration_ansible_user }}" + become: false ansible.builtin.command: >- az vm get-instance-view --name {{ item }} --resource-group {{ resourceGroup_name }} \ --subscription {{ subscriptionId }} \ @@ -36,8 +34,7 @@ - name: "Reboot VM when agent status is not ready" delegate_to: localhost - become: true - become_user: "{{ orchestration_ansible_user }}" + become: false ansible.builtin.command: >- az vm restart --name {{ vm_agent_status[0] }} --resource-group {{ resourceGroup_name }} \ --subscription {{ subscriptionId }} @@ -50,6 +47,7 @@ # - name: "Wait for 120 seconds" # delegate_to: localhost + # become: false # ansible.builtin.pause: # seconds: 120 # when: vm_reboot is changed diff --git a/deploy/ansible/roles-os/1.9-kernelparameters/tasks/main.yaml b/deploy/ansible/roles-os/1.9-kernelparameters/tasks/main.yaml index 88beb0d947..0ec0aedee0 100644 --- a/deploy/ansible/roles-os/1.9-kernelparameters/tasks/main.yaml +++ b/deploy/ansible/roles-os/1.9-kernelparameters/tasks/main.yaml @@ -136,8 +136,8 @@ block: | @sapsys hard nproc unlimited @sapsys soft nproc unlimited - @db2{{ db_sid | lower }}adm hard nproc unlimited - @db{{ db_sid | lower }}adm soft nproc unlimited + @db{{ db_sid | lower }}adm hard nproc unlimited + @db{{ db_sid | lower }}adm soft nproc unlimited when: - node_tier == 'db2' diff --git a/deploy/ansible/roles-sap-os/2.10-sap-notes/tasks/main.yaml b/deploy/ansible/roles-sap-os/2.10-sap-notes/tasks/main.yaml index 3bba307980..23721c52d8 100644 --- a/deploy/ansible/roles-sap-os/2.10-sap-notes/tasks/main.yaml +++ b/deploy/ansible/roles-sap-os/2.10-sap-notes/tasks/main.yaml @@ -29,7 +29,8 @@ ansible.builtin.include_tasks: 2.10.0.yaml when: - node_tier == 'hana' - - distribution_id == ['suse12', 'suse15', 'sles_sap12', 'sles_sap15'] + - distribution_id in ['suse12', 'suse15', 'sles_sap12', 'sles_sap15'] + # -------------------------------------+---------------------------------------8 # -------------------------------------+---------------------------------------8 @@ -43,36 +44,33 @@ # Disable SELinux # Disable core file creation -- name: "2.10.1 sap-notes: - Disable SELinux" - ansible.posix.selinux: - state: disabled - register: selinux_disabled +- name: "2.10.1 sap-notes: - Disable SELinux and Reboot" when: - node_tier in ['scs', 'ers', 'pas', 'app', 'web'] - - distribution_id in ['redhat7', 'redhat8', 'redhat9', 'oracle8'] + - distribution_id in ['redhat7', 'redhat8', 'redhat9', 'oraclelinux8'] + block: + - name: "2.10.1 sap-notes: - Disable SELinux" + ansible.posix.selinux: + state: disabled + register: selinux_disabled + + - name: "2.10.1 sap-notes: Reboot app VMs after selinux is configured" + ansible.builtin.reboot: + reboot_timeout: 300 + post_reboot_delay: 60 + ignore_unreachable: true + when: + - selinux_disabled.changed -- name: "2.10.1 sap-notes: Reboot app VMs after selinux is configured" - ansible.builtin.reboot: - reboot_timeout: 300 - post_reboot_delay: 60 - ignore_unreachable: true +- name: "2.10.1 sap-notes: Check VM Agent Status" when: - selinux_disabled.changed - node_tier in ['scs', 'ers', 'pas', 'app', 'web'] - - distribution_id in ['redhat7', 'redhat8', 'redhat9', 'oracle8'] - -- name: "2.10.1 sap-notes: Check VM Agent Status" + - distribution_id in ['redhat7', 'redhat8', 'redhat9', 'oraclelinux8'] block: - - name: "2.10.1 sap-notes: Reset unreachable hosts" + - name: "2.10.1 sap-notes: Clear the failed state of hosts" ansible.builtin.meta: clear_host_errors - - name: "2.10.1 sap-notes: Pass facts to localhost" - ansible.builtin.debug: - msg: - - "subscriptionId: {{ subscription_id }}" - - "resourceGroup_name: {{ resource_group_name }}" - - "vmName: {{ vm_name }}" - - name: "2.10.1 sap-notes: Including Task for VM Agent Actions" ansible.builtin.include_tasks: roles-misc/0.7-VmAgentActions/tasks/main.yaml vars: @@ -84,10 +82,6 @@ ansible.builtin.wait_for_connection: timeout: 300 register: wait_for_connection_results - when: - - selinux_disabled.changed - - node_tier in ['scs', 'ers', 'pas', 'app', 'web'] - - distribution_id in ['redhat7', 'redhat8', 'redhat9', 'oracle8'] - name: 2.10.1 - SAP Note 2777782 ansible.builtin.include_tasks: 2.10.1.yaml @@ -98,7 +92,7 @@ - name: 2.10.2 - SAP Note 2777782 ansible.builtin.include_tasks: 2.10.2.yaml when: - - node_tier == 'oracle' or node_tier == 'oracle-asm' + - node_tier in ['oracle', 'oracle-asm'] - distribution_id == 'oraclelinux8' - name: 2.10.1275776 - SAP Note 1275776 @@ -107,12 +101,6 @@ - node_tier == 'sybase' - distribution_id in ['redhat8', 'redhat9'] -# - name: 2.10.3119751 - SAP Note 3119751 -# ansible.builtin.include_tasks: 2.10.3119751.yaml -# when: -# - platform == 'HANA' -# - distribution_id in ['redhat8'] - - name: "2.10 - Force all notified handlers to run now" ansible.builtin.meta: flush_handlers @@ -121,13 +109,7 @@ when: - platform == 'HANA' - distribution_id in ['redhat8', 'redhat9'] -# - name: "2.10.1 sap-notes: - Disable SELinux" -# selinux: -# state: disabled -# notify: "2.10-sap-notes: Reboot after the selinux is configured" -# tags: ansible_skip_lint -# when: -# - distribution_id == 'oraclelinux8' + # ToDo RHEL7 and also the other SAP nodes # -------------------------------------+---------------------------------------8 diff --git a/deploy/ansible/roles-sap-os/2.4-hosts-file/tasks/main.yaml b/deploy/ansible/roles-sap-os/2.4-hosts-file/tasks/main.yaml index e1ffe99f08..f94ab07dff 100644 --- a/deploy/ansible/roles-sap-os/2.4-hosts-file/tasks/main.yaml +++ b/deploy/ansible/roles-sap-os/2.4-hosts-file/tasks/main.yaml @@ -38,19 +38,19 @@ - name: "2.4 Hosts - Set the SCS Virtual Instance hostname" ansible.builtin.set_fact: - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" + scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(sap_sid | lower ~ 'scs' ~ scs_instance_number ~ 'cl1', true) }}" when: - scs_high_availability - name: "2.4 Hosts - Set the ERS Virtual Instance hostname" ansible.builtin.set_fact: - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" + ers_virtual_hostname: "{{ custom_ers_virtual_hostname | default(sap_sid | lower ~ 'ers' ~ ers_instance_number ~ 'cl2', true) }}" when: - scs_high_availability - name: "2.4 Hosts: - Set the DB Virtual Instance hostname" ansible.builtin.set_fact: - db_virtual_hostname: "{{ sap_sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl" + db_virtual_hostname: "{{ custom_db_virtual_hostname | default(sap_sid | lower ~ db_sid | lower ~ 'db' ~ db_instance_number ~ 'cl', true) }}" when: - db_high_availability @@ -60,7 +60,6 @@ with_items: - "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_SCS') }}" - - name: "2.4 Hosts: - Setup Virtual host name resolution - SCS & ERS" ansible.builtin.blockinfile: path: /etc/hosts @@ -103,31 +102,21 @@ - name: "2.4 Hosts: Process pas_hostname variable and update host file when it is defined" when: - - pas_hostname is defined - - pas_hostname | type_debug != 'NoneType' - - pas_hostname | length != 0 + - custom_scs_virtual_hostname | default(false, true) block: - - name: "2.4 Hosts: - Get the PAS Server name list" - ansible.builtin.set_fact: - pas_server_list: "{{ pas_server_list | default([]) + [item] }}" - with_items: - - "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_PAS') }}" - - name: "2.4 Hosts: - Set virtual_host fact from the fetched PAS server list" ansible.builtin.set_fact: - pas_virtualhost_from_inventory: "{{ hostvars[pas_server_list[0]]['virtual_host'] }}" - when: - - pas_server_list is defined - - pas_server_list | length > 0 + pas_virtualhost_from_inventory: "{{ hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_PAS') | first]['virtual_host'] }}" + when: query('inventory_hostnames', sap_sid | upper ~ '_PAS') | length > 0 - name: "2.4 Hosts: - Set fact for the PAS if pas_hostname is defined" ansible.builtin.set_fact: - pas_virtual_hostname: "{% if pas_hostname | type_debug != 'NoneType' and pas_hostname | length != 0 %}{{ pas_hostname }}{% else %}{{ pas_virtualhost_from_inventory }}{% endif %}" + pas_virtual_hostname: "{{ custom_pas_virtual_hostname | default(pas_virtualhost_from_inventory, true) }}" - name: "2.4 Hosts: - Display the variables being used" ansible.builtin.debug: msg: - - "pas_hostname: {{ pas_hostname }} " + - "pas_hostname: {{ custom_pas_virtual_hostname }} " - "pas_virtual_hostname: {{ pas_virtual_hostname }} " - "virtualhost_in_inventory: {{ pas_virtualhost_from_inventory }}" @@ -141,11 +130,13 @@ virtual_host_line: "{{ (hosts_content['content'] | b64decode).split('\n') | select('search', pas_virtualhost_from_inventory) | first }}" - name: "2.4 Hosts: - Duplicate the line with virtual_host and replace with pas_virtual_hostname in /etc/hosts" + when: + - virtual_host_line is defined + - pas_virtual_hostname is defined ansible.builtin.lineinfile: path: /etc/hosts line: "{{ virtual_host_line | replace(pas_virtualhost_from_inventory, pas_virtual_hostname) }}" insertbefore: "{{ virtual_host_line }}" - when: virtual_host_line is defined and pas_virtual_hostname is defined - name: "2.4 Hosts: - Remove duplicate lines from /etc/hosts" block: diff --git a/deploy/ansible/roles-sap-os/2.5-sap-users/tasks/user_nw.yaml b/deploy/ansible/roles-sap-os/2.5-sap-users/tasks/user_nw.yaml index 6d39710ce0..d4f25d561c 100644 --- a/deploy/ansible/roles-sap-os/2.5-sap-users/tasks/user_nw.yaml +++ b/deploy/ansible/roles-sap-os/2.5-sap-users/tasks/user_nw.yaml @@ -1,8 +1,8 @@ # /*---------------------------------------------------------------------------8 # | | -# | SAP: Register BOM | -# | SAP SCS: deploy SCS Parameter file install template | -# | SAP SCS: Install | +# | SAP: Register BOM | +# | SAP: deploy Generic Parameter file template | +# | SAP: SAP OS USERS and Group Creation | # | | # +------------------------------------4--------------------------------------*/ @@ -24,19 +24,6 @@ - { mode: '0755', path: '{{ tmp_directory }}/{{ sid_to_be_deployed.sid | upper }}' } - { mode: '0755', path: '/etc/sap_deployment_automation/{{ sid_to_be_deployed.sid | upper }}' } -- name: "User Creation: Set the Server name list" - ansible.builtin.set_fact: - scs_server_temp: "{{ scs_server_temp | default([]) + [item] }}" - with_items: - - "{{ query('inventory_hostnames', '{{ sid_to_be_deployed.sid | upper }}_SCS') }}" - - "{{ query('inventory_hostnames', '{{ sid_to_be_deployed.sid | upper }}_DB') }}" - - "{{ query('inventory_hostnames', '{{ sid_to_be_deployed.sid | upper }}_PAS') }}" - - "{{ query('inventory_hostnames', '{{ sid_to_be_deployed.sid | upper }}_APP') }}" - -- name: "User Creation: Set the SCS Server name" - ansible.builtin.set_fact: - scs_server: "{{ scs_server_temp | first }}" - - name: "User Creation: reset" ansible.builtin.file: path: "/etc/sap_deployment_automation/{{ sid_to_be_deployed.sid | upper }}/user_created.txt" @@ -71,23 +58,8 @@ always_upload_jinja_templates: false task_prefix: "GENERIC: " bom_name: "{{ bom_base_name }}{{ bom_suffix }}" - sap_cd_package_cd1: - sap_cd_package_cd2: - sap_cd_package_cd3: - sap_cd_package_cd4: - sap_cd_package_cd5: - sap_cd_package_hdbclient: - sap_ciInstanceNumber: - app_instance_number: - sap_ciDialogWPNumber: - sap_ciBtcWPNumber: - sap_installSAPHostAgent: - sap_profile_dir: - sap_scs_hostname: "{{ scs_server }}" - sap_db_hostname: - sap_ciVirtualHostname: - sap_appVirtualHostname: param_directory: "{{ dir_params }}" + sap_sid: "{{ sid_to_be_deployed.sid }}" sidadm_uid: "{{ sid_to_be_deployed.sidadm_uid }}" - name: "User Creation: install variables" @@ -100,14 +72,6 @@ - name: "User Creation" block: - -# *====================================4=======================================8 -# | SAP SCS: Install | -# | 2230669 - System Provisioning Using a Parameter Input File | -# *====================================4=======================================8 - - -# - name: "User Creation: check media exists" ansible.builtin.stat: path: "{{ target_media_location }}/SWPM/sapinst" diff --git a/deploy/ansible/roles-sap-os/2.6-sap-mounts/defaults/main.yaml b/deploy/ansible/roles-sap-os/2.6-sap-mounts/defaults/main.yaml index 8336c15e26..1a9d1cf460 100644 --- a/deploy/ansible/roles-sap-os/2.6-sap-mounts/defaults/main.yaml +++ b/deploy/ansible/roles-sap-os/2.6-sap-mounts/defaults/main.yaml @@ -8,5 +8,5 @@ distribution_full_id: "{{ ansible_distribution | lower ~ ansibl use_AFS: "{{ NFS_provider == 'AFS' }}" -scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" +scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(sap_sid | lower ~ 'scs' ~ scs_instance_number ~ 'cl1', true) }}" ... diff --git a/deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.4-db2-mounts.yaml b/deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.4-db2-mounts.yaml index fd4b1d7444..84f9f16848 100644 --- a/deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.4-db2-mounts.yaml +++ b/deploy/ansible/roles-sap-os/2.6-sap-mounts/tasks/2.6.4-db2-mounts.yaml @@ -39,7 +39,7 @@ {%- set lv_parts = item.lv.split('_') -%} {%- if lv_parts| length == 2 -%} {%- set _path = '/' ~ lv_parts[-1] -%} - {%- elif ('offline' in lv_parts) and + {%- elif ('offline_logdir' in item.lv or 'log_dir' in item.lv) and (lv_parts| length == 4 ) -%} {%- set _path = ['/' ~ lv_parts[-3], db_sid | upper, @@ -54,8 +54,7 @@ fstype: "{{ item.fstype }}" opts: defaults state: mounted - loop: "{{ logical_volumes | - sort(attribute='lv') }}" + loop: "{{ logical_volumes | sort(attribute='lv') }}" register: db2fsmounts when: - item.node_tier == "db2" diff --git a/deploy/ansible/roles-sap/3.3.1-bom-utility/tasks/bom-template.yaml b/deploy/ansible/roles-sap/3.3.1-bom-utility/tasks/bom-template.yaml index 4997ddfa39..39b37d6812 100644 --- a/deploy/ansible/roles-sap/3.3.1-bom-utility/tasks/bom-template.yaml +++ b/deploy/ansible/roles-sap/3.3.1-bom-utility/tasks/bom-template.yaml @@ -12,9 +12,9 @@ ansible.builtin.debug: msg: - "SAP SID : {{ sap_sid }}" - - "Instance Number - SCS: {% if scs_instance_number is defined %}{{ scs_instance_number }}{% endif %}" - - "SCS Virtual Hostname : {% if sap_scs_hostname is defined %}{{ sap_scs_hostname }}{% endif %}" - - "DB Hostname : {% if sap_db_hostname is defined %}{{ sap_db_hostname }}{% endif %}" + - "Instance Number - SCS: {{ scs_instance_number | default('') }}" + - "SCS Virtual Hostname : {{ sap_scs_hostname | default('') }}" + - "DB Hostname : {{ sap_db_hostname | default('') }}" - "FQDN : {{ sap_fqdn }}" - "sapadm UID : {{ sapadm_uid }}" - "sapsys GID : {{ sapsys_gid }}" diff --git a/deploy/ansible/roles-sap/5.0.0-scs-install/defaults/main.yml b/deploy/ansible/roles-sap/5.0.0-scs-install/defaults/main.yml index 6e8eb52a0d..aadc22edad 100644 --- a/deploy/ansible/roles-sap/5.0.0-scs-install/defaults/main.yml +++ b/deploy/ansible/roles-sap/5.0.0-scs-install/defaults/main.yml @@ -3,4 +3,4 @@ distro_name: "{{ ansible_distribution | upper }}-{{ ansible_distributio distribution_id: "{{ ansible_distribution | lower ~ ansible_distribution_major_version }}" distribution_full_id: "{{ ansible_distribution | lower ~ ansible_distribution_version }}" -scs_virtual_hostname: "{% if scs_high_availability is defined %}{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_SCS')]['virtual_host'] | first }}{% endif %}" +scs_virtual_hostname: "{{ custom_scs_virtual_hostname | default(virtual_host, true) }}" diff --git a/deploy/ansible/roles-sap/5.0.0-scs-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.0.0-scs-install/tasks/main.yaml index ad4a319497..c6540f9eb0 100644 --- a/deploy/ansible/roles-sap/5.0.0-scs-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.0.0-scs-install/tasks/main.yaml @@ -134,7 +134,7 @@ sap_ciBtcWPNumber: sap_installSAPHostAgent: sap_profile_dir: - sap_scs_hostname: "{{ virtual_host }}" + sap_scs_hostname: "{{ scs_virtual_hostname }}" sap_db_hostname: sap_ciVirtualHostname: sap_appVirtualHostname: @@ -152,7 +152,7 @@ - "PRODUCT ID: {{ bom.product_ids.scs }}" - "INSTANCE: {{ sid_to_be_deployed.ascs_inst_no }}" - "MEDIA: {{ target_media_location }}" - - "HOST: {{ virtual_host }}" + - "HOST: {{ scs_virtual_hostname }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" - name: "SCS Install: Default instance type" @@ -214,13 +214,13 @@ ansible.builtin.debug: msg: "Start SCS Installation" - - name: "SCS Install: SAP SCS Install on {{ ansible_hostname }}" + - name: "SCS Install: SAP SCS Install on {{ scs_virtual_hostname }}" ansible.builtin.shell: | umask {{ custom_umask | default('022') }} ; ./sapinst SAPINST_INPUT_PARAMETERS_URL={{ dir_params }}/{{ sap_inifile }} \ SAPINST_EXECUTE_PRODUCT_ID={{ bom.product_ids.scs }} \ SAPINST_SKIP_DIALOGS=true \ - SAPINST_USE_HOSTNAME={{ virtual_host }} \ + SAPINST_USE_HOSTNAME={{ scs_virtual_hostname }} \ SAPINST_START_GUISERVER=false args: chdir: "{{ target_media_location }}/SWPM" diff --git a/deploy/ansible/roles-sap/5.0.1-scs-ha-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.0.1-scs-ha-install/tasks/main.yaml index 3d554cfb41..08e466be3e 100644 --- a/deploy/ansible/roles-sap/5.0.1-scs-ha-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.0.1-scs-ha-install/tasks/main.yaml @@ -95,7 +95,7 @@ sap_ciBtcWPNumber: sap_installSAPHostAgent: sap_profile_dir: - sap_scs_hostname: "{{ scs_virtual_hostname }}" # "{{ query('inventory_hostnames', '{{ sid_to_be_deployed.sid | upper }}_SCS') | first }}" + sap_scs_hostname: "{{ scs_virtual_hostname }}" sap_db_hostname: sap_ciVirtualHostname: sap_appVirtualHostname: diff --git a/deploy/ansible/roles-sap/5.0.2-ers-ha-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.0.2-ers-ha-install/tasks/main.yaml index ba91eeeab1..905867d142 100644 --- a/deploy/ansible/roles-sap/5.0.2-ers-ha-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.0.2-ers-ha-install/tasks/main.yaml @@ -85,11 +85,10 @@ sap_ciBtcWPNumber: sap_installSAPHostAgent: sap_profile_dir: "/sapmnt/{{ sid_to_be_deployed.sid | upper }}/profile" - ers_virtual_hostname: "{{ sid_to_be_deployed.sid | lower }}ers{{ ers_instance_number }}cl2" sap_db_hostname: sap_ciVirtualHostname: sap_appVirtualHostname: - sap_scs_hostname: "{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1" + sap_scs_hostname: "{{ scs_virtual_hostname }}" param_directory: "{{ dir_params }}" hdb_instance_number: "{{ db_instance_number }}" diff --git a/deploy/ansible/roles-sap/5.1-dbload/tasks/main.yaml b/deploy/ansible/roles-sap/5.1-dbload/tasks/main.yaml index 6e0b42145e..ceb2cf2e05 100644 --- a/deploy/ansible/roles-sap/5.1-dbload/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.1-dbload/tasks/main.yaml @@ -13,7 +13,7 @@ sap_inifile: "{{ bom_base_name }}-dbload-{{ sid_to_be_deployed.sid | lower }}-{{ ansible_hostname }}.params" sap_inifile_template: "{{ bom_base_name }}{{ bom_suffix }}-dbload-inifile-param.j2" dir_params: "{{ tmp_directory }}/.params" - pas_virtual_hostname: "{% if pas_hostname | type_debug != 'NoneType' and pas_hostname | length != 0 %}{{ pas_hostname }}{% else %}{{ virtual_host }}{% endif %}" + pas_virtual_hostname: "{{ custom_pas_virtual_hostname | default(virtual_host, true) }}" - name: "DBLoad: - Create directories" ansible.builtin.file: path: "{{ item.path }}" @@ -135,7 +135,7 @@ - name: "DBLoad: - Set the server facts" ansible.builtin.set_fact: scs_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" - name: "DBLoad: check media exists" ansible.builtin.stat: @@ -194,8 +194,8 @@ sap_ciBtcWPNumber: sap_installSAPHostAgent: sap_profile_dir: "/sapmnt/{{ sid_to_be_deployed.sid | upper }}/profile" - sap_scs_hostname: "{{ scs_server }}" - sap_db_hostname: "{{ db_virtual_host }}" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(scs_server, true) }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" sap_ciVirtualHostname: sap_appVirtualHostname: param_directory: "{{ dir_params }}" @@ -213,8 +213,8 @@ - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ product_id }}" - "INSTANCE: {{ db_instance_number }}" - - "SCSHOST: {{ scs_server }}" - - "DBHOST: {{ db_virtual_host }}" + - "SCSHOST: {{ custom_scs_virtual_hostname | default(scs_server, true) }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" # Import this task only if the tier is ora. @@ -364,11 +364,11 @@ - db_high_availability - platform == 'HANA' - - name: "DBLoad: Set DB Virtual Host name ({{ db_lb_virtual_host }})" + - name: "DBLoad: Set DB Virtual Host name ({{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }})" become: true become_user: "{{ sid_to_be_deployed.sid | lower }}adm" ansible.builtin.shell: | - {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} + {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" TMPDIR: "{{ hdbuserstore_path }}" @@ -434,11 +434,11 @@ - db_high_availability - platform == 'HANA' - - name: "DBLoad: Set DB Virtual Host name ({{ db_lb_virtual_host }})" + - name: "DBLoad: Set DB Virtual Host name ({{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }})" become: true become_user: "{{ sid_to_be_deployed.sid | lower }}adm" ansible.builtin.shell: | - {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ hana_schema }} {{ main_password }} + {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ hana_schema }} {{ main_password }} environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" TMPDIR: "{{ hdbuserstore_path }}" diff --git a/deploy/ansible/roles-sap/5.2-pas-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.2-pas-install/tasks/main.yaml index bf73d5f0fa..7e4375dbd5 100644 --- a/deploy/ansible/roles-sap/5.2-pas-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.2-pas-install/tasks/main.yaml @@ -26,12 +26,7 @@ sap_inifile: "{{ bom_base_name }}-pas-{{ sid_to_be_deployed.sid | lower }}-{{ ansible_hostname }}.params" sap_inifile_template: "{{ bom_base_name }}{{ bom_suffix }}-pas-inifile-param.j2" dir_params: "{{ tmp_directory }}/.{{ sid_to_be_deployed.sid | lower }}-params" - db_lb_virtual_host_HANA: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" - db_lb_virtual_host_AnyDB: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ db_server_temp }}{% endif %}" - -- name: "PAS Install: Set BOM facts db host" - ansible.builtin.set_fact: - db_lb_virtual_host: "{% if platform == 'HANA' %}{{ db_lb_virtual_host_HANA }}{% else %}{{ db_lb_virtual_host_AnyDB }}{% endif %}" + db_lb_virtual_host: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" - name: "PAS Install: - Create directories" ansible.builtin.file: @@ -83,18 +78,21 @@ pas_bom_instance_type: "{% if bom.InstanceType is defined %}{{ bom.InstanceType }}{% else %}ABAP{% endif %}" public: true -- name: "PAS Install: Get DEFAULT.PFL" - ansible.builtin.slurp: - src: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" - register: profilefile +- name: "PAS Install: Set schema_name variable for HANA" + when: platform == "HANA" + block: + - name: "PAS Install: Get DEFAULT.PFL" + ansible.builtin.slurp: + src: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" + register: profilefile -- name: "PAS Install: Get schema name" - ansible.builtin.set_fact: - schema_name: "{{ profilefile['content'] | b64decode | split('\n') | select('search', 'dbs/hdb/schema') | first | split('=') | last | trim | default('{{ hana_schema }}') }}" + - name: "PAS Install: Get schema name" + ansible.builtin.set_fact: + schema_name: "{{ profilefile['content'] | b64decode | split('\n') | select('search', 'dbs/hdb/schema') | first | split('=') | last | trim | default('{{ hana_schema }}') }}" -- name: "PAS Install: Installation results" - ansible.builtin.debug: - msg: "Schema name {{ schema_name }}" + - name: "PAS Install: Show schema name" + ansible.builtin.debug: + msg: "Schema name {{ schema_name }}" - name: "PAS Install" block: @@ -108,10 +106,10 @@ - name: "PAS Install: Set the SCS Server name" ansible.builtin.set_fact: scs_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" file_path: "{% if scs_high_availability %}INSTALL/HA/ABAP/APP1{% else %}INSTALL/DISTRIBUTED/ABAP/APP1{% endif %}" DB: "{% if MULTI_SIDS is defined %}{{ sid_to_be_deployed.sid | upper }}/HDB{{ db_instance_number }}{% else %}{{ db_sid | upper }}/HDB{{ db_instance_number }}{% endif %}" - pas_virtual_hostname: "{% if pas_hostname | type_debug != 'NoneType' and pas_hostname | length != 0 %}{{ pas_hostname }}{% else %}{{ virtual_host }}{% endif %}" + pas_virtual_hostname: "{{ custom_pas_virtual_hostname | default(virtual_host, true) }}" - name: "PAS Install: check media exists" ansible.builtin.stat: @@ -143,15 +141,15 @@ sap_ciBtcWPNumber: 8 sap_installSAPHostAgent: "false" sap_profile_dir: /sapmnt/{{ sid_to_be_deployed.sid | upper }}/profile - sap_scs_hostname: "{{ scs_server }}" - sap_db_hostname: "{{ db_lb_virtual_host }}" - sap_ciVirtualHostname: "{{ pas_virtual_hostname }}" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(scs_server, true) }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" + sap_ciVirtualHostname: "{{ pas_virtual_hostname | default(virtual_host, true) }}" sap_appVirtualHostname: param_directory: "{{ dir_params }}" sap_sid: "{{ sid_to_be_deployed.sid }}" scs_instance_number: "{{ sid_to_be_deployed.ascs_inst_no }}" sidadm_uid: "{{ sid_to_be_deployed.sidadm_uid }}" - virt_do_not_resolve_hostname: "{{ db_lb_virtual_host }}" + virt_do_not_resolve_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" # support older app inifile templates where hdb_instance_number was used hdb_instance_number: "{{ db_instance_number }}" @@ -166,7 +164,7 @@ - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ pas_bom_id }}" - "INSTANCE: {{ instance_number }}" - - "DBHOST: {{ db_virtual_host }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "HOST: {{ pas_virtual_hostname }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" @@ -300,11 +298,11 @@ - db_high_availability - platform == 'HANA' - - name: "PAS Install: Set DB Virtual Host name ({{ db_lb_virtual_host }})" + - name: "PAS Install: Set DB Virtual Host name ({{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }})" become: true become_user: "{{ sid_to_be_deployed.sid | lower }}adm" ansible.builtin.shell: | - {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} + {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" TMPDIR: "{{ hdbuserstore_path }}" @@ -352,7 +350,7 @@ - name: "PAS Install: Calculate the virtual host name" ansible.builtin.set_fact: - pas_virtual_hostname: "{% if pas_hostname | type_debug != 'NoneType' and pas_hostname | length != 0 %}{{ pas_hostname }}{% else %}{{ virtual_host }}{% endif %}" + pas_virtual_hostname: "{{ custom_pas_virtual_hostname | default(virtual_host, true) }}" - name: "PAS Install: Get hdbuserstore path" ansible.builtin.find: @@ -380,9 +378,9 @@ - db_high_availability - platform == 'HANA' - - name: "PAS Install: Set DB Virtual Host name ({{ db_lb_virtual_host }})" + - name: "PAS Install: Set DB Virtual Host name ({{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }})" ansible.builtin.shell: | - {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} + {{ hdbuserstore_path }} -H {{ pas_virtual_hostname }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }} environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" ssfs_connect: "1" diff --git a/deploy/ansible/roles-sap/5.3-app-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.3-app-install/tasks/main.yaml index 7a52faa27f..1a668d1220 100644 --- a/deploy/ansible/roles-sap/5.3-app-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.3-app-install/tasks/main.yaml @@ -24,12 +24,7 @@ sap_inifile: "{{ bom_base_name }}-app-{{ sid_to_be_deployed.sid }}-{{ ansible_hostname }}.params" sap_inifile_template: "{{ bom_base_name }}{{ bom_suffix }}-app-inifile-param.j2" dir_params: "{{ tmp_directory }}/.{{ sid_to_be_deployed.sid | upper }}-params" - db_lb_virtual_host_HANA: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" - db_lb_virtual_host_AnyDB: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ db_server_temp }}{% endif %}" - -- name: "APP Install: Set BOM facts db host" - ansible.builtin.set_fact: - db_lb_virtual_host: "{% if platform == 'HANA' %}{{ db_lb_virtual_host_HANA }}{% else %}{{ db_lb_virtual_host_AnyDB }}{% endif %}" + db_lb_virtual_host: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" - name: "APP Install: - Create directories" ansible.builtin.file: @@ -66,18 +61,21 @@ ansible.builtin.set_fact: app_bom_id: "{{ bom.product_ids.app }}" -- name: "APP Install: Get DEFAULT.PFL" - ansible.builtin.slurp: - src: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" - register: profilefile +- name: "APP Install: Set schema_name variable for HANA" + when: platform == "HANA" + block: + - name: "APP Install: Get DEFAULT.PFL" + ansible.builtin.slurp: + src: "/sapmnt/{{ sap_sid | upper }}/profile/DEFAULT.PFL" + register: profilefile -- name: "APP Install: Get schema name" - ansible.builtin.set_fact: - schema_name: "{{ profilefile['content'] | b64decode | split('\n') | select('search', 'dbs/hdb/schema') | first | split('=') | last | trim | default('{{ hana_schema }}') }}" + - name: "APP Install: Get schema name" + ansible.builtin.set_fact: + schema_name: "{{ profilefile['content'] | b64decode | split('\n') | select('search', 'dbs/hdb/schema') | first | split('=') | last | trim | default('{{ hana_schema }}') }}" -- name: "APP Install: Installation results" - ansible.builtin.debug: - msg: "Schema name {{ schema_name }}" + - name: "APP Install: Show schema name" + ansible.builtin.debug: + msg: "Schema name {{ schema_name }}" # *====================================4=======================================8 # SAP APP: Install @@ -89,7 +87,7 @@ - name: "APP Install: Set the SCS Server name" ansible.builtin.set_fact: scs_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" file_path: "{% if scs_high_availability %}INSTALL/HA/ABAP/APPX{% else %}INSTALL/DISTRIBUTED/ABAP/APPS{% endif %}" - name: "APP Install: check media exists" @@ -122,14 +120,14 @@ sap_ciBtcWPNumber: 8 sap_installSAPHostAgent: "false" sap_profile_dir: /sapmnt/{{ sid_to_be_deployed.sid | upper }}/profile - sap_scs_hostname: "{{ scs_server }}" - sap_db_hostname: "{{ db_lb_virtual_host }}" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(scs_server, true) }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" sap_ciVirtualHostname: "{{ query('inventory_hostnames', '{{ sap_sid | upper }}_APP') | first }}" sap_appVirtualHostname: "{{ virtual_host }}" param_directory: "{{ dir_params }}" sap_sid: "{{ sid_to_be_deployed.sid }}" sidadm_uid: "{{ sid_to_be_deployed.sidadm_uid }}" - virt_do_not_resolve_hostname: "{{ db_lb_virtual_host }}" + virt_do_not_resolve_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" # support older app inifile templates where hdb_instance_number was used hdb_instance_number: "{{ db_instance_number }}" @@ -143,7 +141,7 @@ - "INSTALLED: {{ app_installed.stat.exists }}" - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ bom.product_ids.app }}" - - "DBHOST: {{ db_virtual_host }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "HOST: {{ virtual_host }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" @@ -246,7 +244,7 @@ - name: "APP Install: Set DB Virtual Host name" become: true become_user: "{{ sid_to_be_deployed.sid | lower }}adm" - ansible.builtin.shell: "{{ hdbuserstore_path }} -H {{ virtual_host }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }}" + ansible.builtin.shell: "{{ hdbuserstore_path }} -H {{ virtual_host }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }}" environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" ssfs_connect: "1" @@ -296,8 +294,8 @@ - db_high_availability - platform == 'HANA' - - name: "APP Install: Set DB Virtual Host name ({{ db_lb_virtual_host }})" - ansible.builtin.shell: "{{ hdbuserstore_path }} -H {{ virtual_host }} SET DEFAULT {{ db_lb_virtual_host }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }}" + - name: "APP Install: Set DB Virtual Host name ({{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }})" + ansible.builtin.shell: "{{ hdbuserstore_path }} -H {{ virtual_host }} SET DEFAULT {{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}:3{{ db_instance_number }}13@{{ db_sid | upper }} {{ schema_name }} {{ main_password }}" environment: SAPSYSTEMNAME: "{{ sid_to_be_deployed.sid | upper }}" ssfs_connect: "1" diff --git a/deploy/ansible/roles-sap/5.4-web-install/tasks/main.yaml b/deploy/ansible/roles-sap/5.4-web-install/tasks/main.yaml index 4b1d01cc93..283b62bede 100644 --- a/deploy/ansible/roles-sap/5.4-web-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/5.4-web-install/tasks/main.yaml @@ -96,8 +96,8 @@ web_instance_number: "{{ wd_instance_number }}" sap_ciInstanceNumber: "{{ scs_instance_number }}" sap_profile_dir: /sapmnt/{{ sap_sid | upper }}/profile - sap_scs_hostname: "{{ scs_server }}" - sap_webVirtualHostname: "{{ inventory_hostname }}" + sap_scs_hostname: "{{ custom_scs_virtual_hostname | default(scs_server, true) }}" + sap_webVirtualHostname: "{{ virtual_host }}" sap_installSAPHostAgent: "false" hdb_instance_number: "{{ db_instance_number }}" web_sid: "{{ sid_to_be_deployed.web_sid | upper }}" @@ -116,7 +116,7 @@ - "SAPSID: {{ sap_sid }}" - "PRODUCT ID: {{ web_bom_id }}" - "INSTANCE: {{ web_instance_number }}" - - "SCSHOST: {{ scs_server }}" + - "SCSHOST: {{ custom_scs_virtual_hostname | default(scs_server, true) }}" - "WHOAMI : {{ whoami.stdout }}" - "LOCATION: {{ target_media_location }}/SWPM" - "TMPDIR: {{ tmp_directory }}/{{ sid_to_be_deployed.web_sid | upper }}" diff --git a/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.3-SAPHanaSR.yml b/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.3-SAPHanaSR.yml index c36cbfd314..08f361e3a5 100644 --- a/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.3-SAPHanaSR.yml +++ b/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.3-SAPHanaSR.yml @@ -199,7 +199,7 @@ awk '/ha_dr_SAPHanaSR.*crm_attribute/ \ { printf "%s %s %s %s\n",$2,$3,$5,$16 }' nameserver_* | tail -n 1 args: - chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ primary_instance_name }}/trace + chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ hostvars[primary_instance_name]['virtual_host'] }}/trace register: saphanasr until: saphanasr.stdout is search("SOK") retries: 10 @@ -218,7 +218,7 @@ awk '/ha_dr_SAPHanaSR.*crm_attribute/ \ { printf "%s %s %s %s\n",$2,$3,$5,$16 }' nameserver_* | tail -n 1 args: - chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ primary_instance_name }}/trace + chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ hostvars[primary_instance_name]['virtual_host'] }}/trace register: saphanasr until: saphanasr.stdout is search("SOK") retries: 10 diff --git a/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.5-post_provision_report.yml b/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.5-post_provision_report.yml index 9426e1a59c..819a68205f 100644 --- a/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.5-post_provision_report.yml +++ b/deploy/ansible/roles-sap/5.5-hanadb-pacemaker/tasks/5.5.5-post_provision_report.yml @@ -53,7 +53,7 @@ read -a saphanasr_status <<< ${get_saphanasr_rc} echo "${saphanasr_status[-1]}" args: - chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ primary_instance_name }}/trace + chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ hostvars[primary_instance_name]['virtual_host'] }}/trace register: saphanasr when: inventory_hostname == primary_instance_name rescue: @@ -73,7 +73,7 @@ read -a saphanasr_status <<< ${get_saphanasr_rc} echo "${saphanasr_status[-1]}" args: - chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ primary_instance_name }}/trace + chdir: /usr/sap/{{ db_sid | upper }}/HDB{{ db_instance_number }}/{{ hostvars[primary_instance_name]['virtual_host'] }}/trace register: saphanasr when: inventory_hostname == primary_instance_name diff --git a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.1-set_runtime_facts.yml b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.1-set_runtime_facts.yml index 429929da2e..d2481bdd39 100644 --- a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.1-set_runtime_facts.yml +++ b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.1-set_runtime_facts.yml @@ -28,11 +28,6 @@ primary_instance_ip: "{{ hostvars[primary_instance_name]['primary_ip'] | string }}" secondary_instance_ip: "{{ hostvars[secondary_instance_name]['primary_ip'] | string }}" -- name: "5.6 SCSERS - Set the SCS and ERS Virtual Instance hostname" - ansible.builtin.set_fact: - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" - - name: "5.6 SCSERS - Print - Virtual Instance hostnames" ansible.builtin.debug: msg: diff --git a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4-provision.yml b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4-provision.yml index 1f6dbd7cf7..808b05190e 100644 --- a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4-provision.yml +++ b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4-provision.yml @@ -46,7 +46,6 @@ - use_simple_mount - ansible_os_family | upper == "SUSE" - - name: "5.6 SCSERS: Post SCS HA Install check if installed" become: true ansible.builtin.stat: diff --git a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-RedHat.yml b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-RedHat.yml index eb7861dcd8..bd59246a47 100644 --- a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-RedHat.yml +++ b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-RedHat.yml @@ -25,6 +25,9 @@ ansible.builtin.command: pcs node standby {{ secondary_instance_name }} - name: "5.6 SCSERS - RHEL - Set fact for ASCS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ascs_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}{{ instance_type | lower }}{{ scs_instance_number }}" @@ -165,6 +168,9 @@ ansible.builtin.command: pcs node standby {{ primary_instance_name }} - name: "5.6 SCSERS - RHEL - ERS - Set fact for ERS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ers_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}ers{{ ers_instance_number }}" diff --git a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse-SimpleMount.yml b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse-SimpleMount.yml index c53176de5c..f225b441ab 100644 --- a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse-SimpleMount.yml +++ b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse-SimpleMount.yml @@ -14,6 +14,9 @@ ansible.builtin.command: crm node standby {{ secondary_instance_name }} - name: "5.6 SCSERS - SUSE - Set fact for ASCS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ascs_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}{{ instance_type | lower }}{{ scs_instance_number }}" @@ -128,6 +131,9 @@ when: inventory_hostname == secondary_instance_name block: - name: "5.6 SCSERS - Set fact for ERS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ers_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}ers{{ ers_instance_number }}" diff --git a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse.yml b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse.yml index d738fe0a28..7f6f0e5bc8 100644 --- a/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse.yml +++ b/deploy/ansible/roles-sap/5.6-scsers-pacemaker/tasks/5.6.4.0-cluster-Suse.yml @@ -14,6 +14,9 @@ ansible.builtin.command: crm node standby {{ secondary_instance_name }} - name: "5.6 SCSERS - SUSE - Set fact for ASCS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ascs_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}{{ instance_type | lower }}{{ scs_instance_number }}" @@ -169,6 +172,9 @@ when: inventory_hostname == secondary_instance_name block: - name: "5.6 SCSERS - Set fact for ERS Filesystem" + when: + - NFS_provider in ['AFS', 'ANF'] + - sap_mnt is defined ansible.builtin.set_fact: ers_filesystem_device: "{{ sap_mnt }}/usrsap{{ sap_sid | upper }}ers{{ ers_instance_number }}" diff --git a/deploy/ansible/roles-sap/windows/3.3.1-bom-utility/tasks/bom-template.yaml b/deploy/ansible/roles-sap/windows/3.3.1-bom-utility/tasks/bom-template.yaml index ce84aaa8c3..e05a194b31 100644 --- a/deploy/ansible/roles-sap/windows/3.3.1-bom-utility/tasks/bom-template.yaml +++ b/deploy/ansible/roles-sap/windows/3.3.1-bom-utility/tasks/bom-template.yaml @@ -12,9 +12,9 @@ ansible.builtin.debug: msg: - "SAP SID : {{ sap_sid }}" - - "Instance Number - SCS: {% if scs_instance_number is defined %}{{ scs_instance_number }}{% endif %}" - - "SCS Virtual Hostname : {% if sap_scs_hostname is defined %}{{ sap_scs_hostname }}{% endif %}" - - "DB Hostname : {% if sap_db_hostname is defined %}{{ sap_db_hostname }}{% endif %}" + - "Instance Number - SCS: {{ scs_instance_number | default('') }}" + - "SCS Virtual Hostname : {{ sap_scs_hostname | default('') }}" + - "DB Hostname : {{ sap_db_hostname | default('') }}" - "FQDN : {{ sap_fqdn }}" - "sapadm UID : {{ sapadm_uid }}" - "sapsys GID : {{ sapsys_gid }}" diff --git a/deploy/ansible/roles-sap/windows/5.0.0-scs-install/defaults/main.yml b/deploy/ansible/roles-sap/windows/5.0.0-scs-install/defaults/main.yml index 313a6342eb..c165cdf816 100644 --- a/deploy/ansible/roles-sap/windows/5.0.0-scs-install/defaults/main.yml +++ b/deploy/ansible/roles-sap/windows/5.0.0-scs-install/defaults/main.yml @@ -1 +1,2 @@ scs_virtual_hostname: "{% if scs_high_availability is defined %}{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[query('inventory_hostnames', '{{ sap_sid | upper }}_SCS')]['virtual_host'] | first }}{% endif %}" +ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" diff --git a/deploy/ansible/roles-sap/windows/5.0.0-scs-install/tasks/main.yaml b/deploy/ansible/roles-sap/windows/5.0.0-scs-install/tasks/main.yaml index b59a455526..95b608445e 100644 --- a/deploy/ansible/roles-sap/windows/5.0.0-scs-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/windows/5.0.0-scs-install/tasks/main.yaml @@ -35,18 +35,6 @@ dir_params: '{{ tmp_directory_windows }}\{{ sid_to_be_deployed.sid | lower }}-params\' ha_identifier: "_ha" -- name: "5.6 SCSERS - Set the SCS Virtual Instance hostname" - ansible.builtin.set_fact: - scs_virtual_hostname: "{{ sap_sid | lower }}scs{{ scs_instance_number }}cl1" - when: - - scs_high_availability - -- name: "5.6 SCSERS - Set the ERS Virtual Instance hostname" - ansible.builtin.set_fact: - ers_virtual_hostname: "{{ sap_sid | lower }}ers{{ ers_instance_number }}cl2" - when: - - scs_high_availability - # /*---------------------------------------------------------------------------8 # | Windows cluster configuration : START | # +------------------------------------4--------------------------------------*/ @@ -505,8 +493,7 @@ sap_ciBtcWPNumber: sap_installSAPHostAgent: sap_profile_dir: - sap_scs_hostname: "{{ virtual_host }}" - ers_virtual_hostname: "{{ ansible_hostname }}" + sap_scs_hostname: "{{ scs_virtual_hostname }}" sap_db_hostname: sap_ciVirtualHostname: sap_appVirtualHostname: diff --git a/deploy/ansible/roles-sap/windows/5.1-dbload/tasks/main.yaml b/deploy/ansible/roles-sap/windows/5.1-dbload/tasks/main.yaml index 85ae082a48..b614117ab3 100644 --- a/deploy/ansible/roles-sap/windows/5.1-dbload/tasks/main.yaml +++ b/deploy/ansible/roles-sap/windows/5.1-dbload/tasks/main.yaml @@ -42,7 +42,7 @@ sap_inifile: "{{ bom_base_name }}-dbload-{{ sid_to_be_deployed.sid | lower }}-{{ ansible_hostname }}.params" sap_inifile_template: "{{ bom_base_name }}{{ bom_suffix }}-dbload-inifile-param.j2" scs_server: "{{ hostvars[scs_server_temp | first]['virtual_host'] }}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" scs_sapmnt_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" dir_params: '{{ tmp_directory_windows }}\params' product_catalog: '{{ download_directory_windows }}\SWPM\product.catalog' @@ -52,8 +52,8 @@ msg: - "INIFILE: {{ sap_inifile }}" - "TEMPLATE: {{ sap_inifile_template }}" - - "SAP SWPM SERVER: {{ scs_server }}" - - "DB VIRTUAL HOST: {{ db_virtual_host }}" + - "SAP SWPM SERVER: {{ custom_scs_virtual_hostname | default(scs_server, true) }}" + - "DB VIRTUAL HOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "DOWNLOAD DIR: {{ download_directory_windows }}" - "PARAMS DIR: {{ dir_params }}" - "CATALOG PATH: {{ product_catalog }}" @@ -163,7 +163,7 @@ sap_installSAPHostAgent: sap_profile_dir: '\\{{ scs_sapmnt_server }}\sapmnt\{{ sid_to_be_deployed.sid | upper }}\SYS\profile' sap_scs_hostname: "{{ scs_sapmnt_server }}" - sap_db_hostname: "{{ db_virtual_host }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" sap_ciVirtualHostname: sap_appVirtualHostname: param_directory: "{{ dir_params }}" @@ -179,7 +179,7 @@ - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ bom.product_ids.dbl }}" - "SCSHOST: {{ scs_sapmnt_server }}" - - "DBHOST: {{ db_virtual_host }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" - name: "DBLoad: - status" diff --git a/deploy/ansible/roles-sap/windows/5.2-pas-install/tasks/main.yaml b/deploy/ansible/roles-sap/windows/5.2-pas-install/tasks/main.yaml index a0713c7328..a89b6b4e98 100644 --- a/deploy/ansible/roles-sap/windows/5.2-pas-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/windows/5.2-pas-install/tasks/main.yaml @@ -74,7 +74,7 @@ ansible.builtin.set_fact: scs_server: "{{ hostvars[scs_server_temp | first]['virtual_host'] }}" scs_sapmnt_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" instance_number: "{% if node_tier == 'pas' %}'00'{% else %}'01'{% endif %}" file_path: "{% if scs_high_availability %}INSTALL/HA/ABAP/APP1{% else %}INSTALL/DISTRIBUTED/ABAP/APP1{% endif %}" db_lb_virtual_host: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" @@ -110,14 +110,14 @@ sap_installSAPHostAgent: "false" sap_profile_dir: '\\{{ scs_sapmnt_server }}\sapmnt\{{ sid_to_be_deployed.sid | upper }}\SYS\profile' sap_scs_hostname: "{{ scs_sapmnt_server }}" - sap_db_hostname: "{{ db_virtual_host }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" sap_ciVirtualHostname: sap_appVirtualHostname: param_directory: "{{ dir_params }}" sap_sid: "{{ sid_to_be_deployed.sid }}" scs_instance_number: "{{ sid_to_be_deployed.ascs_inst_no }}" sidadm_uid: "{{ sid_to_be_deployed.sidadm_uid }}" - virt_do_not_resolve_hostname: "{{ db_lb_virtual_host }}" + virt_do_not_resolve_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" - name: "PAS Install: register variables" ansible.builtin.set_fact: @@ -130,7 +130,7 @@ - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ pas_bom_id }}" - "INSTANCE: {{ instance_number }}" - - "DBHOST: {{ db_virtual_host }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "HOST: {{ virtual_host }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" diff --git a/deploy/ansible/roles-sap/windows/5.3-app-install/tasks/main.yaml b/deploy/ansible/roles-sap/windows/5.3-app-install/tasks/main.yaml index 2dc0af32ac..9588449c13 100644 --- a/deploy/ansible/roles-sap/windows/5.3-app-install/tasks/main.yaml +++ b/deploy/ansible/roles-sap/windows/5.3-app-install/tasks/main.yaml @@ -74,7 +74,7 @@ ansible.builtin.set_fact: scs_server: "{{ hostvars[scs_server_temp | first]['virtual_host'] }}" scs_sapmnt_server: "{% if scs_high_availability %}{{ sid_to_be_deployed.sid | lower }}scs{{ scs_instance_number }}cl1{% else %}{{ hostvars[scs_server_temp | first]['virtual_host'] }}{% endif %}" - db_virtual_host: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" + db_virtual_hostname: "{{ hostvars[db_server_temp | first]['virtual_host'] }}" file_path: "{% if scs_high_availability %}INSTALL/HA/ABAP/APP1{% else %}INSTALL/DISTRIBUTED/ABAP/APP1{% endif %}" db_lb_virtual_host: "{% if db_high_availability %}{{ sid_to_be_deployed.sid | lower }}{{ db_sid | lower }}db{{ db_instance_number }}cl{% else %}{{ hostvars[db_server_temp | first]['virtual_host'] }}{% endif %}" @@ -109,14 +109,14 @@ sap_installSAPHostAgent: "false" sap_profile_dir: '\\{{ scs_sapmnt_server }}\sapmnt\{{ sid_to_be_deployed.sid | upper }}\SYS\profile' sap_scs_hostname: "{{ scs_sapmnt_server }}" - sap_db_hostname: "{{ db_virtual_host }}" + sap_db_hostname: "{{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" sap_ciVirtualHostname: sap_appVirtualHostname: "{{ virtual_host }}" param_directory: "{{ dir_params }}" sap_sid: "{{ sid_to_be_deployed.sid }}" scs_instance_number: "{{ sid_to_be_deployed.ascs_inst_no }}" sidadm_uid: "{{ sid_to_be_deployed.sidadm_uid }}" - virt_do_not_resolve_hostname: "{{ db_lb_virtual_host }}" + virt_do_not_resolve_hostname: "{{ custom_db_virtual_hostname | default(db_lb_virtual_host, true) }}" - name: "APP Install: register variables" ansible.builtin.set_fact: @@ -129,7 +129,7 @@ - "INIFILE: {{ sap_inifile }}" - "PRODUCT ID: {{ app_bom_id }}" - "INSTANCE: {{ instance_number }}" - - "DBHOST: {{ db_virtual_host }}" + - "DBHOST: {{ custom_db_virtual_hostname | default(db_virtual_hostname, true) }}" - "HOST: {{ virtual_host }}" - "SID: {{ sid_to_be_deployed.sid | upper }}" diff --git a/deploy/ansible/vars/ansible-input-api.yaml b/deploy/ansible/vars/ansible-input-api.yaml index d669d1bf2a..cfa7acf9d6 100644 --- a/deploy/ansible/vars/ansible-input-api.yaml +++ b/deploy/ansible/vars/ansible-input-api.yaml @@ -34,22 +34,16 @@ always_upload_jinja_templates: true # -------------------------------------+---------------------------------------8 # SAP Configuration for templates and install - hana_use_master_password: y hana_password_copy: "" hana_backup_path: /hana/backup -aas_hostname: "" -aas_instance_number: "00" sap_sid: "" # REQUIRED - SAP Install download_basket_dir: "{{ target_media_location }}/download_basket" -hdb_hostname: "" db_sid: "XDB" # Default db_instance_number: "00" # Default hana_schema: "SAPHANADB" -pas_hostname: "" pas_instance_number: "00" web_instance_number: "00" -password_hana_system: "" main_password: "" # SAP Install sap_fqdn: "" # SAP Install sapadm_uid: 2100 @@ -67,6 +61,16 @@ instance_type: "ASCS" dbload_retry_count: 120 +# Custom virtual hostnames +custom_db_virtual_hostname: "" +custom_ers_virtual_hostname: "" +custom_pas_virtual_hostname: "" +custom_scs_virtual_hostname: "" + +# Custom ASCS and ERS NFS filesystem devices when not using AFS or ANF +ascs_filesystem_device: "" +ers_filesystem_device: "" + # DB2 specific parameters db2sysadm_gid: 3000 db2sysctrl_gid: 3001 @@ -106,7 +110,6 @@ orasid_uid: 3100 oracle_uid: 3101 hdbshm_gid: 2002 observer_uid: 4000 -scs_hostname: "" scs_instance_number: "00" # SAP Install ers_instance_number: "02" app_instance_number: "00" diff --git a/deploy/pipelines/templates/acss-registration.sh b/deploy/pipelines/templates/acss-registration.sh old mode 100644 new mode 100755 diff --git a/deploy/terraform/bootstrap/sap_library/imports.tf b/deploy/terraform/bootstrap/sap_library/imports.tf index 69f80c3be3..67675a4c8d 100644 --- a/deploy/terraform/bootstrap/sap_library/imports.tf +++ b/deploy/terraform/bootstrap/sap_library/imports.tf @@ -45,5 +45,5 @@ data "azurerm_key_vault_secret" "tenant_id" { // Import current service principal data "azuread_service_principal" "sp" { count = var.use_deployer ? 1 : 0 - client_id = local.spn.client_id + application_id = local.spn.client_id } diff --git a/deploy/terraform/run/sap_landscape/imports.tf b/deploy/terraform/run/sap_landscape/imports.tf index e6eea2d583..4c82f0fab3 100644 --- a/deploy/terraform/run/sap_landscape/imports.tf +++ b/deploy/terraform/run/sap_landscape/imports.tf @@ -69,6 +69,6 @@ data "azurerm_key_vault_secret" "cp_tenant_id" { // Import current service principal data "azuread_service_principal" "sp" { count = var.use_spn ? 1 : 0 - client_id = local.spn.client_id + application_id = local.spn.client_id } diff --git a/deploy/terraform/run/sap_library/imports.tf b/deploy/terraform/run/sap_library/imports.tf index 599f2f0d69..1d1c7e50a6 100644 --- a/deploy/terraform/run/sap_library/imports.tf +++ b/deploy/terraform/run/sap_library/imports.tf @@ -46,5 +46,5 @@ data "azurerm_key_vault_secret" "tenant_id" { // Import current service principal data "azuread_service_principal" "sp" { count = var.use_deployer ? 1 : 0 - client_id = local.spn.client_id + application_id = local.spn.client_id } diff --git a/deploy/terraform/run/sap_library/module.tf b/deploy/terraform/run/sap_library/module.tf index ebd7ce5ebd..11cdc15375 100644 --- a/deploy/terraform/run/sap_library/module.tf +++ b/deploy/terraform/run/sap_library/module.tf @@ -28,7 +28,7 @@ module "sap_library" { ) use_private_endpoint = var.use_private_endpoint use_webapp = var.use_webapp - + Agent_IP = var.Agent_IP } module "sap_namegenerator" { diff --git a/deploy/terraform/run/sap_system/imports.tf b/deploy/terraform/run/sap_system/imports.tf index ca810255cf..fc01eeffe4 100644 --- a/deploy/terraform/run/sap_system/imports.tf +++ b/deploy/terraform/run/sap_system/imports.tf @@ -56,10 +56,9 @@ data "azurerm_key_vault_secret" "tenant_id" { // Import current service principal data "azuread_service_principal" "sp" { count = var.use_spn ? 1 : 0 - client_id = local.spn.client_id + application_id = local.spn.client_id } - data "azurerm_key_vault_secret" "cp_subscription_id" { count = length(try(data.terraform_remote_state.landscape.outputs.controlplane_environment, "")) > 0 ? 1 : 0 name = format("%s-subscription-id", data.terraform_remote_state.landscape.outputs.controlplane_environment) diff --git a/deploy/terraform/terraform-units/modules/sap_library/variables_global.tf b/deploy/terraform/terraform-units/modules/sap_library/variables_global.tf index ad0b8bc967..58aeb96055 100644 --- a/deploy/terraform/terraform-units/modules/sap_library/variables_global.tf +++ b/deploy/terraform/terraform-units/modules/sap_library/variables_global.tf @@ -121,12 +121,12 @@ variable "place_delete_lock_on_resources" { description = "If defined, a delete lock will be placed on the key resources" } -variable "bootstrap" { - -} - variable "Agent_IP" { description = "If provided, contains the IP address of the agent" type = string default = "" } + +variable "bootstrap" { + +}