Skip to content

Commit

Permalink
Reconciliation of the branches (#517)
Browse files Browse the repository at this point in the history
Fix configuration script and enable user-specific service installation.
Update Ansible version variable name.
Enable accelerated networking for SCS VM.
Update management DNS resource group value.
Fix file download in sync_deployer.sh.
Update password validation in 0.1-passwords role.
Clear errors during STONITH device enablement.
Update package versions for Red Hat 8.9.
Check required variable in sap-installation-media-storage-details role.
Fix package version verification in 1.17.0-set_runtime_facts role
enable systemd based options for HA cluster configuration
  • Loading branch information
hdamecharla authored Dec 21, 2023
1 parent e163e2b commit 6078bdc
Show file tree
Hide file tree
Showing 30 changed files with 592 additions and 215 deletions.
2 changes: 1 addition & 1 deletion Webapp/SDAF/ParameterDetails/LandscapeTemplate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ $$utility_vm_os_disk_size$$

# Defines the type of the OS disk for the Virtual Machine
$$utility_vm_os_disk_type$$


# Defines if the utility virtual machine uses DHCP
$$utility_vm_useDHCP$$
Expand Down
98 changes: 49 additions & 49 deletions deploy/ansible/playbook_00_validate_parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@
- db_high_availability is defined
- database_high_availability is not defined

- name: "0.0 Validations - Check required variables are present and not empty"
- name: "0.0 Validations - Check required variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ item_to_check.parameter is defined }}" # Has the variable been defined
- "{{ item_to_check.parameter | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ item_to_check.parameter | trim | length > 1 }}"
fail_msg: "{{ item_to_check.error }}"
- item_to_check.parameter is defined # Has the variable been defined
- item_to_check.parameter | type_debug != 'NoneType' # Is the variable not empty"
- item_to_check.parameter | trim | length > 1
fail_msg: "{{ item_to_check.error }}"
loop:
- { parameter: "database_high_availability", error: "database_high_availability has no value assigned" }
- { parameter: "database_cluster_type", error: "database_cluster_type has no value assigned" }
- { parameter: "scs_high_availability", error: "scs_high_availability has no value assigned" }
- { parameter: "scs_cluster_type", error: "scs_cluster_type has no value assigned" }
- { parameter: "use_msi_for_clusters", error: "use_msi_for_clusters has no value assigned" }
- { parameter: "platform", error: "platform has no value assigned" }
- { parameter: "database_high_availability", error: "database_high_availability has no value assigned" }
- { parameter: "database_cluster_type", error: "database_cluster_type has no value assigned" }
- { parameter: "scs_high_availability", error: "scs_high_availability has no value assigned" }
- { parameter: "scs_cluster_type", error: "scs_cluster_type has no value assigned" }
- { parameter: "use_msi_for_clusters", error: "use_msi_for_clusters has no value assigned" }
- { parameter: "platform", error: "platform has no value assigned" }
loop_control:
loop_var: item_to_check

Expand All @@ -84,16 +84,16 @@
# Show parameters used for cluster aware coding
#
# -------------------------------------+---------------------------------------8
- name: "Cluster aware code..."
- name: "Cluster aware code..."
ansible.builtin.debug:
msg: # Best method for formatting output with Azure Devops Logs
- "database_high_availability: {{ database_high_availability }}"
- "database_cluster_type: {{ database_cluster_type }}"
- "scs_high_availability: {{ scs_high_availability }}"
- "scs_cluster_type: {{ scs_cluster_type }}"
- "use_msi_for_clusters: {{ use_msi_for_clusters }}"
- "platform: {{ platform | upper }}"
verbosity: 2
msg: # Best method for formatting output with Azure Devops Logs
- "database_high_availability: {{ database_high_availability }}"
- "database_cluster_type: {{ database_cluster_type }}"
- "scs_high_availability: {{ scs_high_availability }}"
- "scs_cluster_type: {{ scs_cluster_type }}"
- "use_msi_for_clusters: {{ use_msi_for_clusters }}"
- "platform: {{ platform | upper }}"
verbosity: 2

# -------------------------------------+
# Fencing support is only needed when:
Expand All @@ -118,17 +118,17 @@
# when: (database_high_availability and database_cluster_type == "AFA") or
# (scs_high_availability and scs_cluster_type == "AFA")

- name: "0.0 Validations - Retrieve the Fencing SPN details"
- name: "0.0 Validations - Retrieve the Fencing SPN details"
ansible.builtin.include_role:
name: roles-misc/0.2-kv-secrets
name: roles-misc/0.2-kv-secrets
vars:
operation: fencing
operation: fencing
when:
- (database_high_availability and database_cluster_type == "AFA") or
(scs_high_availability and scs_cluster_type == "AFA")
- platform != "ORACLE"
- (database_high_availability and database_cluster_type == "AFA") or
(scs_high_availability and scs_cluster_type == "AFA")
- platform != "ORACLE"
tags:
- kv-secrets
- kv-secrets

# -------------------------------------+

Expand All @@ -152,9 +152,9 @@
- name: "0.0 Validations - Check required variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ item_to_check.parameter is defined }}" # Has the variable been defined
- "{{ item_to_check.parameter | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ item_to_check.parameter | trim | length > 1 }}"
- item_to_check.parameter is defined # Has the variable been defined
- item_to_check.parameter | type_debug != 'NoneType' # Is the variable not empty"
- item_to_check.parameter | trim | length > 1
fail_msg: "{{ item_to_check.error }}"
loop:
- {
Expand Down Expand Up @@ -187,9 +187,9 @@
- name: "0.0 Validations - Check required SCS HA variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ item_to_check.parameter is defined }}" # Has the variable been defined
- "{{ item_to_check.parameter | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ item_to_check.parameter | trim | length > 1 }}"
- item_to_check.parameter is defined # Has the variable been defined
- item_to_check.parameter | type_debug != 'NoneType' # Is the variable not empty"
- item_to_check.parameter | trim | length > 1
fail_msg: "{{ item_to_check.error }}"
loop:
- {
Expand Down Expand Up @@ -217,9 +217,9 @@
- name: "0.0 Validations - Check required SCS HA fencing variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ item_to_check.parameter is defined }}" # Has the variable been defined
- "{{ item_to_check.parameter | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ item_to_check.parameter | trim | length > 1 }}"
- item_to_check.parameter is defined # Has the variable been defined
- item_to_check.parameter | type_debug != 'NoneType' # Is the variable not empty"
- item_to_check.parameter | trim | length > 1
fail_msg: "{{ item_to_check.error }}"
loop:
- {
Expand Down Expand Up @@ -248,9 +248,9 @@
- name: "0.0 Validations - Check required Database HA variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ item_to_check.parameter is defined }}" # Has the variable been defined
- "{{ item_to_check.parameter | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ item_to_check.parameter | trim | length > 1 }}"
- item_to_check.parameter is defined # Has the variable been defined
- item_to_check.parameter | type_debug != 'NoneType' # Is the variable not empty"
- item_to_check.parameter | trim | length > 1
fail_msg: "{{ item_to_check.error }}"
loop:
- {
Expand Down Expand Up @@ -369,8 +369,8 @@

- name: "0.0 Validations - Check for free disk space on deployer"
ansible.builtin.assert:
that: "{{ (mnt_free_diskspace | first | int / (1024 * 1024 * 1024) | int) > (deployer_free_temp_disk_space | int) }}"
fail_msg: "The deployer needs at least {{ deployer_free_temp_disk_space }} GB of free disk space in /mnt"
that: (mnt_free_diskspace | first | int / (1024 * 1024 * 1024) | int) > (deployer_free_temp_disk_space | int)
fail_msg: "The deployer needs at least {{ deployer_free_temp_disk_space }} GB of free disk space in /mnt"
when:
- mnt_free_diskspace | length > 0
tags:
Expand Down Expand Up @@ -473,7 +473,7 @@
- name: Validate SCS and PAS instance numbers
ansible.builtin.assert:
that:
- "scs_instance_number != pas_instance_number"
- scs_instance_number != pas_instance_number
fail_msg: "Please ensure that the pas_instance_number is different from the scs_instance_number when installing PAS on ASCS"
when: (ansible_play_hosts_all | length) == 2
tags:
Expand All @@ -482,7 +482,7 @@
- name: "0.0 Validations - Validate SCS and PAS instance numbers"
ansible.builtin.assert:
that:
- "scs_instance_number != pas_instance_number"
- scs_instance_number != pas_instance_number
fail_msg: "Please ensure that the pas_instance_number is different from the scs_instance_number on standalone installation"
when: (ansible_play_hosts_all | length) == 1
tags:
Expand All @@ -491,7 +491,7 @@
- name: "0.0 Validations - Validate DB and PAS instance numbers"
ansible.builtin.assert:
that:
- "db_instance_number != pas_instance_number"
- db_instance_number != pas_instance_number
fail_msg: "Please ensure that the pas_instance_number is different from the db_instance_number on standalone installation"
when: (ansible_play_hosts_all | length) == 1
tags:
Expand Down Expand Up @@ -611,12 +611,12 @@
- ansible_os_family != "Windows"

- name: "0.0 Validations - Create validation-done flag"
delegate_to: localhost
delegate_to: localhost
become: false
ansible.builtin.file:
path: "{{ _workspace_directory }}/.progress/validation-done"
state: touch
mode: 0755
path: "{{ _workspace_directory }}/.progress/validation-done"
state: touch
mode: 0755

- name: "0.0 Validations - Netmask"
ansible.builtin.debug:
Expand Down Expand Up @@ -671,7 +671,7 @@
- name: "0.0 Validations - Check for free disk space on SCS"
ansible.builtin.assert:
that:
- "{{ (free_diskspace | first | int / (1024 * 1024 * 1024) | int) > (scs_free_diskspace | int) }}"
- (free_diskspace | first | int / (1024 * 1024 * 1024) | int) > (scs_free_diskspace | int)
fail_msg: "The SCS server needs at least {{ scs_free_diskspace }} GB of free disk space in /mnt"
tags:
- 0.0-scs-diskspace
Expand Down
6 changes: 3 additions & 3 deletions deploy/ansible/roles-misc/0.1-passwords/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
- name: "0.1 Password: - Ensure the password is set"
ansible.builtin.assert:
that:
- "{{ sap_password is defined }}" # Has the variable been defined
- "{{ sap_password | type_debug != 'NoneType' }}" # Is the variable not empty"
- "{{ sap_password | trim | length > 8 }}"
- sap_password is defined # Has the variable been defined
- sap_password | type_debug != 'NoneType' # Is the variable not empty"
- sap_password | trim | length > 8
fail_msg: "The SAP main password was not set in key vault"

- name: "0.1 Password: - Show SAP Password"
Expand Down
7 changes: 1 addition & 6 deletions deploy/ansible/roles-misc/0.2-kv-secrets/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@
- "use_msi_for_clusters: {{ use_msi_for_clusters }}"
- "platform: {{ platform | upper }}"
verbosity: 2
when:
- operation is defined
- operation == "fencing"
when: operation == "fencing"

# -------------------------------------+---------------------------------------8
#
# -------------------------------------+---------------------------------------8
- name: "0.2 Key Vault: - Import S User tasks"
ansible.builtin.import_tasks: "s_user.yaml"
when:
- operation is defined
- operation == "SoftwareAcquisition"


Expand All @@ -52,7 +49,6 @@
- name: "0.2 Key Vault: - Import Fencing secrets"
ansible.builtin.import_tasks: "fencing.yaml"
when:
- operation is defined
- operation == "fencing"
- (database_high_availability and database_cluster_type == "AFA") or
(scs_high_availability and scs_cluster_type == "AFA") # AFA (Azure Fencing Agent)
Expand All @@ -66,7 +62,6 @@
ansible.builtin.import_tasks: "wincluster-witness.yaml"
# TODO: update when clause more appropriately
when:
- operation is defined
- operation == "fencing"
- (scs_high_availability or database_high_availability)
- not use_msi_for_clusters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
- name: "0.0 Validations - Check required variables are present and not empty"
ansible.builtin.assert:
that:
- "{{ sapbits_sas_token is defined }}" # Has the variable been defined
- "{{ sapbits_sas_token | trim | length > 1 }}" # Does the variable have a value
- sapbits_sas_token is defined # Has the variable been defined
- sapbits_sas_token | trim | length > 1 # Does the variable have a value
fail_msg: >-
"The variable 'sapbits_sas_token' is not defined or is empty. Please provide it in the deployer key vault, sap-parameters file or pass it in as a parameter."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
- name: "Verify that the packages are the right version"
ansible.builtin.assert:
that:
- "ansible_facts.packages['{{ packages_list.name }}'][0].version is version('{{ packages_list.version }}', '>=', version_type='{{ packages_list.version_type }}')"
- 'ansible_facts.packages[ packages_list.name ][0].version is version( packages_list.version , ">=", version_type= packages_list.version_type )'
fail_msg: "{{ packages_list.name }} version is not greater than {{ packages_list.version }}"
success_msg: "{{ packages_list.name }} version is greater than {{ packages_list.version }}"
register: package_version_results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
- name: "1.17 Generic Pacemaker - Ensure the STONITH device is enabled"
ansible.builtin.command: pcs property set stonith-enabled=true

- name: "1.17 Generic Pacemaker - Clear any errors during enablement of STONITH device"
ansible.builtin.command: pcs resource cleanup

# /*---------------------------------------------------------------------------8
# | |
# | Fencing - END |
Expand Down
8 changes: 6 additions & 2 deletions deploy/ansible/roles-sap/5.1-dbload/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@
public: true
when: bom.InstanceType is defined

- name: "DBLoad: register application type"
ansible.builtin.set_fact:
application_type: "{% if instance_type == 'SCS' %}JAVA{% else %}ABAP{% endif %}"

- name: "DBLoad: - Set the product ID"
ansible.builtin.set_fact:
product_id: "{{ bom.product_ids.dbl }}"

- name: "DBLoad: - Set dbload path"
ansible.builtin.set_fact:
db_load_path: "{{ tmp_directory }}/{{ sid_to_be_deployed.sid | upper }}/sapinst_instdir/{{ product_id.replace('.', '/').replace('/' + instance_type, '').split(':')[1] }}/INSTALL/DISTRIBUTED/{{ instance_type }}/DB"
db_load_path: "{{ tmp_directory }}/{{ sid_to_be_deployed.sid | upper }}/sapinst_instdir/{{ product_id.replace('.', '/').replace('/' + application_type, '').split(':')[1] }}/INSTALL/DISTRIBUTED/{{ application_type }}/DB"

- name: "DBLoad: Check if DBLoad has been tried on this server"
ansible.builtin.stat:
Expand All @@ -92,7 +96,7 @@
- name: "DBLoad: flag"
ansible.builtin.file:
path: "/etc/sap_deployment_automation/{{ sid_to_be_deployed.sid | upper }}/sap_deployment_dbload.txt"
state: touch
state: touch
mode: 0755
when:
- dbload_performed_according_to_sapinst is defined
Expand Down
Loading

0 comments on commit 6078bdc

Please sign in to comment.