From fec3ea8d19ec7bb44a96516635e7aea10be18607 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:52:53 +0000 Subject: [PATCH 001/210] sap_ha_install_anydb_ibmdb2: experimental new role --- .../sap_ha_install_anydb_ibmdb2/.ansible-lint | 7 + .../sap_ha_install_anydb_ibmdb2/.yamllint.yml | 21 ++ roles/sap_ha_install_anydb_ibmdb2/README.md | 65 ++++++ .../defaults/main.yml | 6 + .../sap_ha_install_anydb_ibmdb2/meta/main.yml | 13 ++ .../meta/runtime.yml | 2 + .../tasks/main.yml | 151 +++++++++++++ .../tasks/passwordless_ssh.yml | 210 ++++++++++++++++++ .../platform/ascertain_platform_type.yml | 114 ++++++++++ .../execute_db2cm_cloud_aws_ec2_vs.yml | 9 + 10 files changed, 598 insertions(+) create mode 100644 roles/sap_ha_install_anydb_ibmdb2/.ansible-lint create mode 100644 roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/README.md create mode 100644 roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/meta/main.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/.ansible-lint b/roles/sap_ha_install_anydb_ibmdb2/.ansible-lint new file mode 100644 index 000000000..63122b8f9 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/.ansible-lint @@ -0,0 +1,7 @@ +--- +enable_list: + - yaml +skip_list: + - ignore-errors # We use ignore_errors for all the assert tasks, which should be acceptable + - schema # We want to allow single digit version numbers in a role's meta/main.yml file. This is allowed as per https://galaxy.ansible.com/docs/contributing/creating_role.html and https://galaxy.ansible.com/api/v1/platforms/?page=6. + - name[template] # Allow templating inside name. During dev and qa, it should be possible to identify cases where it doesn't work diff --git a/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml new file mode 100644 index 000000000..57ef427c1 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml @@ -0,0 +1,21 @@ +--- +# Based on ansible-lint config +extends: default + +rules: + braces: {max-spaces-inside: 1, level: error} + brackets: {max-spaces-inside: 1, level: error} +# colons: {max-spaces-after: -1, level: error} +# commas: {max-spaces-after: -1, level: error} + comments: disable + comments-indentation: disable +# document-start: disable +# empty-lines: {max: 3, level: error} +# hyphens: {level: error} +# indentation: disable +# key-duplicates: enable + line-length: disable +# new-line-at-end-of-file: disable +# new-lines: {type: unix} +# trailing-spaces: disable + truthy: disable diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md new file mode 100644 index 000000000..d81f584d7 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -0,0 +1,65 @@ +`EXPERIMENTAL` + +# sap_ha_install_anydb_ibmdb2 Ansible Role + +Ansible Role for instantiation of IBM Db2 “Integrated Linux Pacemaker” HADR cluster + +Note: IBM Db2 with “Integrated Linux Pacemaker” can use two deployment models: +- Mutual Failover option, not covered by this Ansible Role +- High Availability and Disaster Recovery (HADR) option for Idle Standby, initialised by this Ansible Role + + +## Prerequisites + +### Software Installation files + +Download IBM Db2 installation media from SAP Download Center on host, and set Ansible Variable `sap_ha_install_anydb_ibmdb2_software_directory` to this path. + +### Variables + +- `sap_ha_install_anydb_ibmdb2_hostname_primary` with the IBM Db2 Primary node hostname +- `sap_ha_install_anydb_ibmdb2_hostname_secondary` with the IBM Db2 Secondary node hostname +- `sap_ha_install_anydb_ibmdb2_sid` with the IBM Db2 System ID +- `sap_ha_install_anydb_ibmdb2_software_directory` with the IBM Db2 installation media path + +These are listed in the default variables file, but commented-out to enforce the required variables: +- [**sap_ha_install_anydb_ibmdb2** default parameters](defaults/main.yml) + +## Execution + +Sample Ansible Playbook Execution: + +- Local Host Installation + - `ansible-playbook --connection=local --limit localhost -i "localhost," sap-ha-anydb-ibmdb2-init.yml -e "@inputs/ibmdb2_vars.yml` + +- Target Host Installation + - `ansible-playbook -i "" sap-ha-anydb-ibmdb2-init.yml -e "@inputs/ibmdb2_vars.yml"` + +## Sample Ansible Playbook + +```yaml +--- +- hosts: all + become: true + + collections: + - community.sap_install + + vars: + sap_ha_install_anydb_ibmdb2_hostname_primary: anydb-primary + sap_ha_install_anydb_ibmdb2_hostname_secondary: anydb-second + sap_ha_install_anydb_ibmdb2_sid: DB2 + sap_ha_install_anydb_ibmdb2_software_directory: /software/ibmdb2_extracted + + - name: Execute Ansible Role sap_ha_install_anydb_ibmdb2 + include_role: + name: { role: community.sap_install.sap_ha_install_anydb_ibmdb2 } +``` + +## License + +Apache license 2.0 + +## Author Information + +Sean Freeman diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml new file mode 100644 index 000000000..5b1305788 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -0,0 +1,6 @@ +--- + +# sap_ha_install_anydb_ibmdb2_hostname_primary: +# sap_ha_install_anydb_ibmdb2_hostname_secondary: +# sap_ha_install_anydb_ibmdb2_sid: +# sap_ha_install_anydb_ibmdb2_software_directory: diff --git a/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml b/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml new file mode 100644 index 000000000..4aa584a99 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml @@ -0,0 +1,13 @@ +--- +galaxy_info: + namespace: community + author: Sean Freeman + description: HA for SAP AnyDB - IBM Db2 + company: Red Hat, Inc. + license: Apache-2.0 + min_ansible_version: 2.9 + platforms: + - name: EL + versions: [ 8, 9 ] + galaxy_tags: [ 'sap', 'anydb', 'ibmdb2', 'ibm', 'db2', 'rhel', 'redhat', 'sles', 'suse' ] +dependencies: [] diff --git a/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml b/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml new file mode 100644 index 000000000..c2ea65887 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml @@ -0,0 +1,2 @@ +--- +requires_ansible: '>=2.12.0' diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml new file mode 100644 index 000000000..3bdbae786 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -0,0 +1,151 @@ +--- + +# IBM Db2 with an Integrated Cluster Manager have various options. See IBM Db2 Supported cluster management software - https://www.ibm.com/docs/en/db2/11.5?topic=clustering-supported-cluster-management-software +# IBM Db2 with “Integrated Linux Pacemaker” can use two deployment models, either High Availability and Disaster Recovery (HADR) option for Idle Standby or Mutual Failover option + +# Execute IBM Db2 with “Integrated Linux Pacemaker” using Resource Agents db2ethmon, db2inst (HADR), db2hadr (HADR), db2partition and db2fs +# HA Deployment Model: High Availability and Disaster Recovery (HADR) for Idle Standby +# Configurations performed for: root OS user, IBM Db2 Database Administrator OS user (e.g. db2) +# Configurations executed on: AnyDB Primary Node, AnyDB Secondary Node + +# See SAP Note 1555903 - DB6: Supported IBM Db2 Database Features +# See SAP Note 3100330 - DB6: Using Db2 HADR with Pacemaker Cluster Software +# See SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software +# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ +# See Admin documentation for IBM Db2 with Integrated Cluster Manager (Linux Pacemaker) - https://www.ibm.com/docs/en/db2/11.5?topic=feature-integrated-solution-using-pacemaker +# See Installation documentation for IBM Db2 with Integrated Cluster Manager (Linux Pacemaker) - https://www.ibm.com/docs/en/db2/11.5?topic=manager-installing-pacemaker-cluster + + +# Determine if we are on a cloud platform. +- name: "SAP HA Prepare Pacemaker - Include tasks for platform detection" + ansible.builtin.import_tasks: platform/ascertain_platform_type.yml + +# See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat +- name: Append IBM Db2 HA Ports to /etc/services + ansible.builtin.lineinfile: + path: /etc/services + line: "{{ item }}" + state: present + loop: + - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_1\t55001/tcp\t# DB2 HA Port 1" # DB2 HADR local service (env var db2hadrlocalsvc / HADR_LOCAL_SVC) + - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_2\t55002/tcp\t# DB2 HA Port 2" # DB2 HADR remote service (env var db2hadrremotesvc / HADR_REMOTE_SVC) + when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + +- name: "SAP HA Prepare Pacemaker - Include tasks for Passwordless SSH" + ansible.builtin.import_tasks: passwordless_ssh.yml + + +- name: Ansible Task Block for IBM Db2 “Integrated Linux Pacemaker” configuration + when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + block: + + # IBM Db2 LUW for SAP installation media includes already extracted Db2_*_Pacemaker_*_<><>_<>.tar.gz + # Default install file is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/db2installPCMK + # Default RPM directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux + # Default SRPM (Source) directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux/SRPMS + - name: Identify IBM Db2 installation media with 'Integrated Linux Pacemaker' RPMs subdirectory + ansible.builtin.find: + paths: "{{ sap_ha_install_anydb_ibmdb2_software_directory }}" + recurse: true + file_type: file + patterns: db2installPCMK + excludes: bin + register: __sap_ha_install_anydb_ibmdb2_pcmk + + - name: List all IBM Db2 'Integrated Linux Pacemaker' RPMs in subdirectory + ansible.builtin.find: + paths: "{{ (__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path | dirname) + '/Linux/' + ('rhel' if ansible_os_family == 'RedHat' else 'suse' if ansible_os_family == 'Suse') }}" + recurse: true + file_type: file + patterns: "*.rpm" + register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files + + - name: Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL + ansible.builtin.dnf: + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" + state: present + disable_gpg_check: true + when: ansible_os_family == 'RedHat' + + - name: Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES + community.general.zypper: + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" + state: present + disable_gpg_check: true + when: ansible_os_family == 'Suse' + + # SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software + - name: Verify IBM Db2 'Integrated Linux Pacemaker' is installed + register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check + ansible.builtin.shell: | + rpm -q corosync | grep -I db2pcmk + rpm -q pacemaker | grep -I db2pcmk + rpm -q crmsh | grep -I db2pcmk + + - name: Display IBM Db2 'Integrated Linux Pacemaker' installation details + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_version_check.stdout_lines }}" + + - name: Identify IBM Db2 cluster manager (db2cm) utility + ansible.builtin.find: + paths: /db2 + recurse: true + file_type: file + patterns: db2cm + register: __sap_anydb_ibmdb2_db2cm + + - name: Ensure directory for db2cm binary + ansible.builtin.file: + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin + mode: "0755" + state: directory + + - name: Copy db2cm binary to binary path + ansible.builtin.copy: + src: "{{ __sap_anydb_ibmdb2_db2cm.files[0].path }}" + remote_src: true + dest: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin + mode: '0755' + + # - name: Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) + + - name: Execute db2installPCMK shell script + ansible.builtin.shell: | + {{__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path}} -i + + +- name: Ansible Task Block to create Linux Pacemaker cluster from AnyDB Primary node + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + block: + + # db2cm script must run as root + - name: Create Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + # Assume 1 OS Network Interface until improvements can be made + export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" + export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + sleep 90 + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance + + # - name: Configure Linux Pacemaker infrastructure platform resources using db2cm + # ansible.builtin.include_tasks: "platform/execute_db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" + + +# db2cm script must run as root +- name: Verify AnyDB HA Linux Pacemaker initialisation + register: __sap_ha_install_anydb_ibmdb2_init_check + ansible.builtin.shell: | + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -list + +- name: Display AnyDB HA config + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_init_check.stdout_lines }}" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml new file mode 100644 index 000000000..b8ecd366e --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -0,0 +1,210 @@ +--- + +- name: Ansible Task Block for passwordless SSH between AnyDB Primary and Secondary + when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + block: + + - name: SAP AnyDB - Create .ssh if missing - root user + ansible.builtin.file: + path: /root/.ssh + mode: "0700" + state: directory + + - name: SAP AnyDB - Create .ssh if missing - IBM Db2 Database Administrator + ansible.builtin.file: + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh + mode: "0700" + state: directory + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + + - name: SAP AnyDB - Perform ssh-keygen if required + ansible.builtin.shell: | + [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] && \ + [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ + ssh-keygen -t rsa -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} -N "" -q && + args: + creates: /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub + failed_when: false + + - name: SAP AnyDB - Copy key files from root user if does not exist + ansible.builtin.shell: | + [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] || \ + [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ + cp -f /root/.ssh/anydb_ibmdb2_hadr* /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh + args: + creates: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub + failed_when: false + + - name: SAP AnyDB - Ensure key file exists - root user + ansible.builtin.file: + path: "{{ item }}" + state: file + loop: + - "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}" + - "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" + + - name: SAP AnyDB - Ensure key file exists with correct file permissions - IBM Db2 Database Administrator + ansible.builtin.file: + path: "{{ item }}" + state: file + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + loop: + - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}" + - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" + + - name: SAP AnyDB - Get SSH fingerprint of SAP AnyDB Primary node + ansible.builtin.shell: | + ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} + register: __sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP AnyDB - Get SSH fingerprint pf SAP AnyDB Secondary node + ansible.builtin.shell: | + ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} + register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + + - name: SAP AnyDB - Get contents of SSH Public Key for SAP AnyDB Primary node + ansible.builtin.shell: | + cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub + register: __sap_ha_install_anydb_ibmdb2_primary_pubkey + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP AnyDB - Get contents of SSH Public Key for SAP AnyDB Secondary node + ansible.builtin.shell: | + cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub + register: __sap_ha_install_anydb_ibmdb2_secondary_pubkey + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + + - name: SAP AnyDB - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" + mode: "0600" + path: /root/.ssh/known_hosts + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP AnyDB - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" + mode: "0600" + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/known_hosts + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - root user + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" + mode: "0600" + path: /root/.ssh/authorized_keys + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" + mode: "0600" + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + # Avoid use of default id_rsa file or SSH Agent (ssh-add) + - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - root user + ansible.builtin.blockinfile: + backup: true + create: true + path: /root/.ssh/config + block: | + Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} + IdentityFile /root/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_primary }} + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + # Avoid use of default id_rsa file or SSH Agent (ssh-add) + - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - IBM Db2 Database Administrator + ansible.builtin.blockinfile: + backup: true + create: true + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/config + block: | + Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} + IdentityFile /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_primary }} + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + + - name: SAP AnyDB - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" + mode: "0600" + path: /root/.ssh/known_hosts + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + - name: SAP AnyDB - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" + mode: "0600" + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/known_hosts + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - root user + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" + mode: "0600" + path: /root/.ssh/authorized_keys + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator + ansible.builtin.lineinfile: + backup: true + create: true + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" + mode: "0600" + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + # Avoid use of default id_rsa file or SSH Agent (ssh-add) + - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - root user + ansible.builtin.blockinfile: + backup: true + create: true + path: /root/.ssh/config + block: | + Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} + IdentityFile /root/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + # Avoid use of default id_rsa file or SSH Agent (ssh-add) + - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - IBM Db2 Database Administrator + ansible.builtin.blockinfile: + backup: true + create: true + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/config + block: | + Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} + IdentityFile /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml new file mode 100644 index 000000000..fe638b071 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -0,0 +1,114 @@ +--- +# Platform detection for cloud and other infrastructure platforms. + +### Facts already available to Ansible +# +### Amazon Web Services EC2 Virtual Server. Not applicable for AWS Classic. +# ansible_chassis_asset_tag: "Amazon EC2" # SMBIOS Chassis Asset Tag +# ansible_board_asset_tag: "i-043d3c1a889ed9016" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform +# ansible_chassis_vendor: "Amazon EC2" +# ansible_product_name: "r5.8xlarge" # IaaS profile name +# ansible_system_vendor: "Amazon EC2" +# +### Google Cloud Compute Engine Virtual Machine. +# ansible_chassis_asset_tag: "NA" # SMBIOS Chassis Asset Tag +# ansible_board_asset_tag: "9EAF3038-7EF5-3F1E-6620-FB3BDA7A3709" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform +# ansible_chassis_vendor: "Google" +# ansible_product_name: "Google Compute Engine" +# ansible_system_vendor: "Google" +# +### IBM Cloud Virtual Server. Not applicable for IBM Cloud Classic Infrastructure. +# ansible_chassis_asset_tag: "ibmcloud" # SMBIOS Chassis Asset Tag +# ansible_board_asset_tag: "0c7d4459-xxxx-yyyy-zzzz-abcdefghijkl" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform +# ansible_chassis_vendor: "IBM:Cloud Compute Server 1.0:mx2-16x128" # IaaS profile name as suffix (after colon) +# ansible_product_name: "Standard PC (i440FX + PIIX, 1996)" +# ansible_system_vendor: "QEMU" +# +### Microsoft Azure Virtual Machine. Not applicable for MS Azure Classic/ASM. +# ansible_chassis_asset_tag: "7783-xxxx-yyyy-zzzz-aaaa-bbbb-cc" # SMBIOS Chassis Asset Tag +# ansible_board_asset_tag: "None" # SMBIOS Baseboard Asset Tag +# ansible_chassis_vendor: "Microsoft Corporation" +# ansible_product_name: "Virtual Machine" +# ansible_system_vendor: "70f4a858-1eea-4c35-b9e1-e179c32fc6b5" # ID of virtual machine on platform +# +### VMware vSphere +# ansible_product_name: "VMware7,1", +# ansible_system_vendor: "VMware, Inc.", +# ansible_virtualization_type: "VMware" +# +### End of comment + + +# TODO: detection based on multiple facts and providing one standard +# name for use as platform type in related include files +# cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, cloud_msazure_vm, hyp_ibmpower_vm, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm + + +- name: "SAP HA Prepare Pacemaker - Check if platform is Amazon Web Services EC2 Virtual Server" + when: + - '"amazon" in ansible_system_vendor | lower + or "amazon" in ansible_product_name | lower' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_aws_ec2_vs + +- name: "SAP HA Prepare Pacemaker - Check if platform is Google Cloud Compute Engine Virtual Machine" + when: + - ansible_product_name == 'Google Compute Engine' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_gcp_ce_vm + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Cloud Virtual Server" + when: + - ansible_chassis_asset_tag == 'ibmcloud' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs + +- name: "SAP HA Prepare Pacemaker - Check if platform is Microsoft Azure Virtual Machine" + when: + - ansible_product_name == 'Virtual Machine' + - ansible_chassis_vendor == 'Microsoft Corporation' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_msazure_vm + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" + ansible.builtin.shell: | + set -o pipefail && rpm -qa | grep -E -e "rsct.basic" + register: __sap_ha_install_anydb_ibmdb2_power_rsct_check + changed_when: false + when: ansible_architecture == "ppc64le" + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" + ansible.builtin.fail: + msg: Please install RSCT from IBM Power Systems service and productivity tools repository + when: + - ansible_architecture == "ppc64le" + - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout == "" + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" + ansible.builtin.shell: | + /opt/rsct/bin/ctgethscid + register: __sap_ha_install_anydb_ibmdb2_power_rsct_hscid + changed_when: false + when: + - ansible_architecture == "ppc64le" + - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout != "" + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power Virtual Server from IBM Cloud" + when: + - ansible_architecture == "ppc64le" + - '"ibmcloud" in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs + +- name: "SAP HA Prepare Pacemaker - Check if platform is IBM PowerVM" + when: + - ansible_architecture == "ppc64le" + - '"ibmcloud" not in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm + +#- name: "SAP HA Prepare Pacemaker - Check if platform is VMware vSphere" +# when: +# - ansible_virtualization_type == 'VMware' +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: hyp_vmware_vsphere_vm diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml new file mode 100644 index 000000000..19bec7760 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml @@ -0,0 +1,9 @@ +--- + +# # db2cm script must run as root +# - name: Update Infrastructure Platform configuration for Linux Pacemaker cluster using db2cm +# register: __sap_ha_install_anydb_ibmdb2_fence_config +# ansible.builtin.shell: | +# db2cm -create -aws -fence +# db2cm -create -aws -primaryVIP -rtb -profile -db -instance + From 369a29eb16268cdf4c02809dafe407bdf630f30c Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:02:42 +0000 Subject: [PATCH 002/210] sap_ha_install_anydb_ibmdb2: fix task names --- .../tasks/main.yml | 40 ++++++++-------- .../tasks/passwordless_ssh.yml | 46 +++++++++---------- .../platform/ascertain_platform_type.yml | 20 ++++---- .../execute_db2cm_cloud_aws_ec2_vs.yml | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 3bdbae786..06e35e0d7 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -17,11 +17,11 @@ # Determine if we are on a cloud platform. -- name: "SAP HA Prepare Pacemaker - Include tasks for platform detection" +- name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for platform detection ansible.builtin.import_tasks: platform/ascertain_platform_type.yml # See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat -- name: Append IBM Db2 HA Ports to /etc/services + SAP HA AnyDB - IBM Db2 HADR -- name: Append IBM Db2 HA Ports to /etc/services ansible.builtin.lineinfile: path: /etc/services line: "{{ item }}" @@ -31,11 +31,11 @@ - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_2\t55002/tcp\t# DB2 HA Port 2" # DB2 HADR remote service (env var db2hadrremotesvc / HADR_REMOTE_SVC) when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) -- name: "SAP HA Prepare Pacemaker - Include tasks for Passwordless SSH" +- name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for Passwordless SSH ansible.builtin.import_tasks: passwordless_ssh.yml -- name: Ansible Task Block for IBM Db2 “Integrated Linux Pacemaker” configuration +- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for IBM Db2 “Integrated Linux Pacemaker” configuration when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) block: @@ -43,7 +43,7 @@ # Default install file is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/db2installPCMK # Default RPM directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux # Default SRPM (Source) directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux/SRPMS - - name: Identify IBM Db2 installation media with 'Integrated Linux Pacemaker' RPMs subdirectory + - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 installation media with 'Integrated Linux Pacemaker' RPMs subdirectory ansible.builtin.find: paths: "{{ sap_ha_install_anydb_ibmdb2_software_directory }}" recurse: true @@ -52,7 +52,7 @@ excludes: bin register: __sap_ha_install_anydb_ibmdb2_pcmk - - name: List all IBM Db2 'Integrated Linux Pacemaker' RPMs in subdirectory + - name: SAP HA AnyDB - IBM Db2 HADR - List all IBM Db2 'Integrated Linux Pacemaker' RPMs in subdirectory ansible.builtin.find: paths: "{{ (__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path | dirname) + '/Linux/' + ('rhel' if ansible_os_family == 'RedHat' else 'suse' if ansible_os_family == 'Suse') }}" recurse: true @@ -60,14 +60,14 @@ patterns: "*.rpm" register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files - - name: Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL + - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL ansible.builtin.dnf: name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" state: present disable_gpg_check: true when: ansible_os_family == 'RedHat' - - name: Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES + - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES community.general.zypper: name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" state: present @@ -75,18 +75,18 @@ when: ansible_os_family == 'Suse' # SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software - - name: Verify IBM Db2 'Integrated Linux Pacemaker' is installed + - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check ansible.builtin.shell: | rpm -q corosync | grep -I db2pcmk rpm -q pacemaker | grep -I db2pcmk rpm -q crmsh | grep -I db2pcmk - - name: Display IBM Db2 'Integrated Linux Pacemaker' installation details + - name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 'Integrated Linux Pacemaker' installation details ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_version_check.stdout_lines }}" - - name: Identify IBM Db2 cluster manager (db2cm) utility + - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 cluster manager (db2cm) utility ansible.builtin.find: paths: /db2 recurse: true @@ -94,32 +94,32 @@ patterns: db2cm register: __sap_anydb_ibmdb2_db2cm - - name: Ensure directory for db2cm binary + - name: SAP HA AnyDB - IBM Db2 HADR - Ensure directory for db2cm binary ansible.builtin.file: path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin mode: "0755" state: directory - - name: Copy db2cm binary to binary path + - name: SAP HA AnyDB - IBM Db2 HADR - Copy db2cm binary to binary path ansible.builtin.copy: src: "{{ __sap_anydb_ibmdb2_db2cm.files[0].path }}" remote_src: true dest: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin mode: '0755' - # - name: Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) + # - name: SAP HA AnyDB - IBM Db2 HADR - Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) - - name: Execute db2installPCMK shell script + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script ansible.builtin.shell: | {{__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path}} -i -- name: Ansible Task Block to create Linux Pacemaker cluster from AnyDB Primary node +- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block to create Linux Pacemaker cluster from AnyDB Primary node when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short block: # db2cm script must run as root - - name: Create Linux Pacemaker cluster using db2cm + - name: SAP HA AnyDB - IBM Db2 HADR - Create Linux Pacemaker cluster using db2cm register: __sap_ha_install_anydb_ibmdb2_config ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" @@ -135,17 +135,17 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance - # - name: Configure Linux Pacemaker infrastructure platform resources using db2cm + # - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker infrastructure platform resources using db2cm # ansible.builtin.include_tasks: "platform/execute_db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" # db2cm script must run as root -- name: Verify AnyDB HA Linux Pacemaker initialisation +- name: SAP HA AnyDB - IBM Db2 HADR - Verify AnyDB HA Linux Pacemaker initialisation register: __sap_ha_install_anydb_ibmdb2_init_check ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -list -- name: Display AnyDB HA config +- name: SAP HA AnyDB - IBM Db2 HADR - Display AnyDB HA config ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_init_check.stdout_lines }}" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index b8ecd366e..8602eff50 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -1,16 +1,16 @@ --- -- name: Ansible Task Block for passwordless SSH between AnyDB Primary and Secondary +- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for passwordless SSH between AnyDB Primary and Secondary when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) block: - - name: SAP AnyDB - Create .ssh if missing - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Create .ssh if missing - root user ansible.builtin.file: path: /root/.ssh mode: "0700" state: directory - - name: SAP AnyDB - Create .ssh if missing - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Create .ssh if missing - IBM Db2 Database Administrator ansible.builtin.file: path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh mode: "0700" @@ -18,7 +18,7 @@ owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - - name: SAP AnyDB - Perform ssh-keygen if required + - name: SAP HA AnyDB - IBM Db2 HADR - Perform ssh-keygen if required ansible.builtin.shell: | [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] && \ [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ @@ -27,7 +27,7 @@ creates: /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub failed_when: false - - name: SAP AnyDB - Copy key files from root user if does not exist + - name: SAP HA AnyDB - IBM Db2 HADR - Copy key files from root user if does not exist ansible.builtin.shell: | [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] || \ [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ @@ -36,7 +36,7 @@ creates: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub failed_when: false - - name: SAP AnyDB - Ensure key file exists - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Ensure key file exists - root user ansible.builtin.file: path: "{{ item }}" state: file @@ -44,7 +44,7 @@ - "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}" - "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" - - name: SAP AnyDB - Ensure key file exists with correct file permissions - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Ensure key file exists with correct file permissions - IBM Db2 Database Administrator ansible.builtin.file: path: "{{ item }}" state: file @@ -54,33 +54,33 @@ - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}" - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" - - name: SAP AnyDB - Get SSH fingerprint of SAP AnyDB Primary node + - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint of SAP AnyDB Primary node ansible.builtin.shell: | ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} register: __sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Get SSH fingerprint pf SAP AnyDB Secondary node + - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint pf SAP AnyDB Secondary node ansible.builtin.shell: | ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP AnyDB - Get contents of SSH Public Key for SAP AnyDB Primary node + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary node ansible.builtin.shell: | cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub register: __sap_ha_install_anydb_ibmdb2_primary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Get contents of SSH Public Key for SAP AnyDB Secondary node + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node ansible.builtin.shell: | cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub register: __sap_ha_install_anydb_ibmdb2_secondary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP AnyDB - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user ansible.builtin.lineinfile: backup: true create: true @@ -89,7 +89,7 @@ path: /root/.ssh/known_hosts when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true @@ -100,7 +100,7 @@ group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - root user ansible.builtin.lineinfile: backup: true create: true @@ -109,7 +109,7 @@ path: /root/.ssh/authorized_keys when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true @@ -121,7 +121,7 @@ when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) - - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - root user ansible.builtin.blockinfile: backup: true create: true @@ -132,7 +132,7 @@ when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) - - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Update Passwordless SSH login from SAP AnyDB Primary node to SAP AnyDB Secondary node - IBM Db2 Database Administrator ansible.builtin.blockinfile: backup: true create: true @@ -145,7 +145,7 @@ when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP AnyDB - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user ansible.builtin.lineinfile: backup: true create: true @@ -154,7 +154,7 @@ path: /root/.ssh/known_hosts when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP AnyDB - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true @@ -165,7 +165,7 @@ group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - root user ansible.builtin.lineinfile: backup: true create: true @@ -174,7 +174,7 @@ path: /root/.ssh/authorized_keys when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP AnyDB - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true @@ -186,7 +186,7 @@ when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) - - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - root user + - name: SAP HA AnyDB - IBM Db2 HADR - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - root user ansible.builtin.blockinfile: backup: true create: true @@ -197,7 +197,7 @@ when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) - - name: SAP AnyDB - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - IBM Db2 Database Administrator + - name: SAP HA AnyDB - IBM Db2 HADR - Update Passwordless SSH login from SAP AnyDB Secondary node to SAP AnyDB Primary node (authentication method publickey) - IBM Db2 Database Administrator ansible.builtin.blockinfile: backup: true create: true diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index fe638b071..baeac8265 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -44,47 +44,47 @@ # cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, cloud_msazure_vm, hyp_ibmpower_vm, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm -- name: "SAP HA Prepare Pacemaker - Check if platform is Amazon Web Services EC2 Virtual Server" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Amazon Web Services EC2 Virtual Server when: - '"amazon" in ansible_system_vendor | lower or "amazon" in ansible_product_name | lower' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_aws_ec2_vs -- name: "SAP HA Prepare Pacemaker - Check if platform is Google Cloud Compute Engine Virtual Machine" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Google Cloud Compute Engine Virtual Machine when: - ansible_product_name == 'Google Compute Engine' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_gcp_ce_vm -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Cloud Virtual Server" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server when: - ansible_chassis_asset_tag == 'ibmcloud' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs -- name: "SAP HA Prepare Pacemaker - Check if platform is Microsoft Azure Virtual Machine" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Microsoft Azure Virtual Machine when: - ansible_product_name == 'Virtual Machine' - ansible_chassis_vendor == 'Microsoft Corporation' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_msazure_vm -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check ansible.builtin.shell: | set -o pipefail && rpm -qa | grep -E -e "rsct.basic" register: __sap_ha_install_anydb_ibmdb2_power_rsct_check changed_when: false when: ansible_architecture == "ppc64le" -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check ansible.builtin.fail: msg: Please install RSCT from IBM Power Systems service and productivity tools repository when: - ansible_architecture == "ppc64le" - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout == "" -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power - RSCT binary check" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check ansible.builtin.shell: | /opt/rsct/bin/ctgethscid register: __sap_ha_install_anydb_ibmdb2_power_rsct_hscid @@ -93,21 +93,21 @@ - ansible_architecture == "ppc64le" - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout != "" -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM Power Virtual Server from IBM Cloud" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power Virtual Server from IBM Cloud when: - ansible_architecture == "ppc64le" - '"ibmcloud" in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs -- name: "SAP HA Prepare Pacemaker - Check if platform is IBM PowerVM" +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM PowerVM when: - ansible_architecture == "ppc64le" - '"ibmcloud" not in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm -#- name: "SAP HA Prepare Pacemaker - Check if platform is VMware vSphere" +#- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is VMware vSphere" # when: # - ansible_virtualization_type == 'VMware' # ansible.builtin.set_fact: diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml index 19bec7760..bc5043843 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml @@ -1,7 +1,7 @@ --- # # db2cm script must run as root -# - name: Update Infrastructure Platform configuration for Linux Pacemaker cluster using db2cm +# - name: SAP HA AnyDB - IBM Db2 HADR - Update Infrastructure Platform configuration for Linux Pacemaker cluster using db2cm # register: __sap_ha_install_anydb_ibmdb2_fence_config # ansible.builtin.shell: | # db2cm -create -aws -fence From 893f1f68c3e13c30f00cacef1c8856334b57629b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:27:39 +0000 Subject: [PATCH 003/210] sap_ha_install_anydb_ibmdb2: fail msg if file not found --- .../tasks/main.yml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 06e35e0d7..841ff0d39 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -16,12 +16,26 @@ # See Installation documentation for IBM Db2 with Integrated Cluster Manager (Linux Pacemaker) - https://www.ibm.com/docs/en/db2/11.5?topic=manager-installing-pacemaker-cluster +- name: SAP HA AnyDB - IBM Db2 HADR - Confirm IBM Db2 installation media is available + ansible.builtin.find: + paths: "{{ sap_ha_install_anydb_ibmdb2_software_directory }}" + recurse: true + file_type: file + patterns: db2installPCMK + excludes: bin + register: __sap_ha_install_anydb_ibmdb2_check_install_media + +- name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 installation media is not available + ansible.builtin.fail: + msg: IBM Db2 installation media is not available, cannot find file db2installPCMK + when: not (__sap_ha_install_anydb_ibmdb2_check_install_media.files | length > 0) + # Determine if we are on a cloud platform. - name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for platform detection ansible.builtin.import_tasks: platform/ascertain_platform_type.yml # See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat - SAP HA AnyDB - IBM Db2 HADR -- name: Append IBM Db2 HA Ports to /etc/services +- name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services ansible.builtin.lineinfile: path: /etc/services line: "{{ item }}" @@ -62,14 +76,14 @@ - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL ansible.builtin.dnf: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list }}" state: present disable_gpg_check: true when: ansible_os_family == 'RedHat' - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES community.general.zypper: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list}}" + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list }}" state: present disable_gpg_check: true when: ansible_os_family == 'Suse' @@ -111,7 +125,7 @@ - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script ansible.builtin.shell: | - {{__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path}} -i + {{ __sap_ha_install_anydb_ibmdb2_pcmk.files[0].path }} -i - name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block to create Linux Pacemaker cluster from AnyDB Primary node From 3273f2c075440758363628e5c8af4638ee40e1fe Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 8 May 2024 23:45:59 +0200 Subject: [PATCH 004/210] sap_swpm: No longer change mode and user of files in extracted dirs Solves issue #721. Signed-off-by: Bernd Finger --- .../sap_swpm/tasks/swpm/prepare_software.yml | 39 +++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/roles/sap_swpm/tasks/swpm/prepare_software.yml b/roles/sap_swpm/tasks/swpm/prepare_software.yml index 911d82fdc..c40f12399 100644 --- a/roles/sap_swpm/tasks/swpm/prepare_software.yml +++ b/roles/sap_swpm/tasks/swpm/prepare_software.yml @@ -22,31 +22,9 @@ file_type: directory register: __sap_swpm_register_find_result_directories - - name: SAP SWPM Pre Install - Find non-SAPCAR files - ansible.builtin.find: - path: "{{ sap_swpm_software_path }}" - file_type: file - recurse: true - excludes: "SAPCAR*EXE" - register: __sap_swpm_register_find_result_files_non_sapcar - - - name: SAP SWPM Pre Install - Create list of absolute directory names from the find result - ansible.builtin.set_fact: - __sap_swpm_fact_directories: "{{ __sap_swpm_fact_directories | d([]) + [line_item.path] }}" - loop: "{{ __sap_swpm_register_find_result_directories.files }}" - loop_control: - loop_var: line_item - label: "{{ line_item.path }}" - when: __sap_swpm_register_find_result_directories is defined - - - name: SAP SWPM Pre Install - Create list of absolute file names for non-SAPCAR files from the find result + - name: SAP SWPM Pre Install - Create list of directories ansible.builtin.set_fact: - __sap_swpm_fact_files_non_sapcar: "{{ __sap_swpm_fact_files_non_sapcar | d([]) + [line_item.path] }}" - loop: "{{ __sap_swpm_register_find_result_files_non_sapcar.files }}" - loop_control: - loop_var: line_item - label: "{{ line_item.path }}" - when: __sap_swpm_register_find_result_files_non_sapcar is defined + __sap_swpm_fact_directories: "{{ __sap_swpm_register_find_result_directories.files | map(attribute='path') | reject('contains', 'extracted') }}" - name: SAP SWPM Pre Install - Ensure correct permissions and ownership of all directories ansible.builtin.file: @@ -62,6 +40,19 @@ - __sap_swpm_fact_directories is defined - __sap_swpm_register_find_result_directories is defined + - name: SAP SWPM Pre Install - Find non-SAPCAR files + ansible.builtin.find: + path: "{{ sap_swpm_software_path }}" + file_type: file + recurse: true + excludes: "SAPCAR*EXE" + register: __sap_swpm_register_find_result_files_non_sapcar + + - name: SAP SWPM Pre Install - Create list of files + ansible.builtin.set_fact: + __sap_swpm_fact_files_non_sapcar: "{{ __sap_swpm_register_find_result_files_non_sapcar.files | map(attribute='path') | reject('contains', 'extracted/') }}" + when: __sap_swpm_register_find_result_files_non_sapcar is defined + - name: SAP SWPM Pre Install - Create argument list for chown and chmod of non-SAPCAR*EXE files ansible.builtin.set_fact: __sap_swpm_fact_files_non_sapcar_chown_arg_list: "{{ __sap_swpm_fact_files_non_sapcar | map('quote') | join(' ') }}" From 53caa3e3e5800e445c99741296e77444b35735ef Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Fri, 31 May 2024 14:36:17 +0100 Subject: [PATCH 005/210] Prevent task "SAP SWPM Deployment - Finished" from failing if sap_swpm_sid or sap_swpm_pas_instance_nr not defined. --- roles/sap_swpm/tasks/post_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_swpm/tasks/post_install.yml b/roles/sap_swpm/tasks/post_install.yml index 4e0d39968..5f8a07672 100644 --- a/roles/sap_swpm/tasks/post_install.yml +++ b/roles/sap_swpm/tasks/post_install.yml @@ -26,8 +26,8 @@ - ' SAP SWPM deployment successfully completed ' - ' ' - ' SAP Product - {{ sap_swpm_product_catalog_id }} ' - - ' SID - {{ sap_swpm_sid }} ' - - ' Primary Instance - {{ sap_swpm_pas_instance_nr }} ' + - ' SID - {{ sap_swpm_sid | d("") }} ' + - ' Primary Instance - {{ sap_swpm_pas_instance_nr | d("") }} ' - ' Host - {{ ansible_hostname }} ' - ' FQDN - {{ ansible_fqdn }} ' - ' IP - {{ ansible_default_ipv4.address | d(ansible_all_ipv4_addresses[0]) }} ' From 80c964fc7b3ca6f87c33aad76acab71af64cd765 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 5 Jun 2024 16:28:41 +0100 Subject: [PATCH 006/210] hdbuserstore default connection should use sap_swpm_db_schema_abap_password --- roles/sap_swpm/tasks/post_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/post_install.yml b/roles/sap_swpm/tasks/post_install.yml index 4e0d39968..ffc7ee8b5 100644 --- a/roles/sap_swpm/tasks/post_install.yml +++ b/roles/sap_swpm/tasks/post_install.yml @@ -46,7 +46,7 @@ /usr/sap/{{ sap_swpm_sid }}/hdbclient/hdbuserstore \ SET DEFAULT \ {{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}13@{{ sap_swpm_db_sid }} \ - {{ sap_swpm_db_schema_abap }} '{{ sap_swpm_db_system_password }}' + {{ sap_swpm_db_schema_abap }} '{{ sap_swpm_db_schema_abap_password }}' args: executable: /bin/bash become: true From 40f5542105a200b233b77d0d340b1c5a84276582 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 5 Jun 2024 16:52:02 +0100 Subject: [PATCH 007/210] Option to enable SWPM observer mode --- roles/sap_swpm/defaults/main.yml | 10 ++++++++++ roles/sap_swpm/tasks/pre_install.yml | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index c3956bf99..08a84ecc1 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -194,6 +194,16 @@ sap_swpm_tmsadm_password: sap_swpm_tms_tr_files_path: # --- Experimental --- # +# --- Experimental - SWPM Observer mode --- # +# Enables observer mode of SWPM - TO BE USED for debugging/troubleshooting mainly +# This allows user to watch the installation progress from a browser (on standard port 4237) and possibly interact with it +# Note: Interaction can impact the automated installation and may result in the requirements for further manual actions in order to complete the installation +sap_swpm_swpm_observer_mode: false +# Allows to specify a different remote access user (e.g. when root's password is unknown). Default SWPM behaviour is to use root. This may not be desirable as +# root's password may not be available for security reasons. The remote access user must exist before SWPM is executed (i.e. adm can't be used if it doesn't exist yet). +#sap_swpm_swpm_remote_access_user: admin +# --- Experimental - SWPM Observer mode --- # + sap_swpm_install_saphostagent: 'true' diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 7e0cb7a6f..c570ac851 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -15,13 +15,19 @@ ################ - name: SAP SWPM Pre Install - Set sapinst command + vars: + sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" # If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank # IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" # If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}" - sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_START_GUISERVER=false {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + #RDTEST + sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + #sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_START_GUISERVER=false {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + #sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_REMOTE_ACCESS_USER=admin SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" tags: sap_swpm_sapinst_commandline ################ From e26f4c21ce9608c3482a0e238305a31dcdcec43b Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 5 Jun 2024 17:07:27 +0100 Subject: [PATCH 008/210] Added missing hana connection config --- ...bles-sap-swpm-default-mode-s4hana-distributed-aas-install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml index bceb19ee4..1a08940f0 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml @@ -17,6 +17,7 @@ sap_swpm_product_catalog_id: NW_DI:S4HANA2020.CORE.HDB.PD sap_swpm_inifile_list: - swpm_installation_media - credentials + - credentials_hana - db_connection_nw_hana - nw_config_other - nw_config_additional_application_server_instance From 2674428856d4f590242ce3848d2955f1319443d8 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 7 Jun 2024 14:20:49 +0200 Subject: [PATCH 009/210] sap_swpm: Perform chown and chmod in batches of 100 Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/swpm/prepare_software.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/sap_swpm/tasks/swpm/prepare_software.yml b/roles/sap_swpm/tasks/swpm/prepare_software.yml index c40f12399..e52042570 100644 --- a/roles/sap_swpm/tasks/swpm/prepare_software.yml +++ b/roles/sap_swpm/tasks/swpm/prepare_software.yml @@ -53,19 +53,19 @@ __sap_swpm_fact_files_non_sapcar: "{{ __sap_swpm_register_find_result_files_non_sapcar.files | map(attribute='path') | reject('contains', 'extracted/') }}" when: __sap_swpm_register_find_result_files_non_sapcar is defined - - name: SAP SWPM Pre Install - Create argument list for chown and chmod of non-SAPCAR*EXE files - ansible.builtin.set_fact: - __sap_swpm_fact_files_non_sapcar_chown_arg_list: "{{ __sap_swpm_fact_files_non_sapcar | map('quote') | join(' ') }}" - # Reasons for noqa: # - command-instead-of-module: Shorter execution time compared to looping over a list when using the file module # - no-changed-when: Not worth checking permissions and ownership before this task and comparing afterwards - name: SAP SWPM Pre Install - Ensure correct permissions and ownership of all non-SAPCAR files # noqa command-instead-of-module no-changed-when ansible.builtin.shell: > chown {{ sap_swpm_files_non_sapcar_owner }}:{{ sap_swpm_files_non_sapcar_group }} \ - {{ __sap_swpm_fact_files_non_sapcar_chown_arg_list }} && + {{ line_item | join(' ') }} && chmod {{ sap_swpm_files_non_sapcar_mode }} \ - {{ __sap_swpm_fact_files_non_sapcar_chown_arg_list }} + {{ line_item | join(' ') }} + loop: "{{ __sap_swpm_fact_files_non_sapcar | batch(100) }}" + loop_control: + loop_var: line_item + label: "Batch {{ (__sap_swpm_fact_files_non_sapcar.index(line_item[0]) // 100) + 1 }}, first item: {{ line_item[0] }}" when: - __sap_swpm_fact_files_non_sapcar is defined - __sap_swpm_register_find_result_files_non_sapcar is defined From bd9bba4b7d0d9ccb1b26717aff72fee81fc54590 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Thu, 13 Jun 2024 18:35:40 +0100 Subject: [PATCH 010/210] Option to enable SWPM observer mode - removed obsolete comments --- roles/sap_swpm/tasks/pre_install.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index c570ac851..5d4ca06b3 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -24,10 +24,7 @@ # If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank # IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" # If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}" - #RDTEST - sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" - #sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_START_GUISERVER=false {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" - #sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true SAPINST_REMOTE_ACCESS_USER=admin SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" tags: sap_swpm_sapinst_commandline ################ From 19a321706464cf2f0b71211535db2325769f6b9a Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Thu, 13 Jun 2024 19:43:20 +0100 Subject: [PATCH 011/210] Option to enable SWPM observer mode - removed trailing spaces --- roles/sap_swpm/tasks/pre_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 5d4ca06b3..93faba0d9 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -24,7 +24,7 @@ # If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank # IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" # If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}" - sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" tags: sap_swpm_sapinst_commandline ################ From 38666ba6168ad1824e0227864506b04d9a8cda2b Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 17 Jun 2024 16:42:28 +0200 Subject: [PATCH 012/210] Initial commit for new playbooks --- playbooks/disclaimer.yml | 20 +++++ playbooks/sap_hana_install.yml | 122 ++++++++++++++++++++++++++++ playbooks/sap_hana_preconfigure.yml | 88 ++++++++++++++++++++ 3 files changed, 230 insertions(+) create mode 100644 playbooks/disclaimer.yml create mode 100644 playbooks/sap_hana_install.yml create mode 100644 playbooks/sap_hana_preconfigure.yml diff --git a/playbooks/disclaimer.yml b/playbooks/disclaimer.yml new file mode 100644 index 000000000..079129e90 --- /dev/null +++ b/playbooks/disclaimer.yml @@ -0,0 +1,20 @@ +--- +- name: Disclaimer for using playbooks + hosts: localhost + gather_facts: false + + tasks: + - name: Disclaimer + ansible.builtin.debug: + msg: |- + ********************************************************************************************************************* + The playbooks of this collections can be used interactively to reach a defined state. + Instead of answering questions interactively, you can pass a variable file + with the required values. + To turn off this diclaimer set sap_playbook_disclaimer to false. + This playbook runs against localhost only. + If you want to use the playbook against multiple hosts, create an inventory containing + these hosts and run the playbook with the options `-i inventory -e target_group=all` + where `inventory` is the filename of the inventory and `all` is the group the playbook is excuted against. + For details creating an inventory see: https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html + ********************************************************************************************************************* diff --git a/playbooks/sap_hana_install.yml b/playbooks/sap_hana_install.yml new file mode 100644 index 000000000..46fd63043 --- /dev/null +++ b/playbooks/sap_hana_install.yml @@ -0,0 +1,122 @@ +--- +## +# Call this playbook interactively with +# ansible-playbook community.sap_install.sap_hana_preconfigure +# +# or alternatively unattended with +# ansible-playbook community.sap_install.sap_hana_preconfigure -e @myvars.yml +# +# The file myvars. yaml needs to contain the following variables +# +- name: Disclaimer + ansible.builtin.import_playbook: disclaimer.yml # TODO: check if FQDN is required/optional + when: sap_playbook_disclaimer | d('true') + +- name: Collecting Variables + hosts: localhost + + vars_prompt: + - name: "sap_domain" + prompt: "Enter Domainname of your SAP systems (leave empty for using system default: " + private: false + default: "{{ sap_domain | d('') }}" + + - name: "sap_update_hosts" + prompt: "Do you want the system to update /etc/hosts for SAP (y/n)" + private: false + default: "y" + + - name: "sap_update" + prompt: "Do you want to update the system? (y/n)" + private: false + default: "n" + + - name: "sap_fail_if_reboot_required" + prompt: "Do you want to stop with an error if the system needs a reboot? (y/n)" + private: false + default: "n" + + - name: "sap_reboot" + prompt: "Do you want to reboot the system if required? (y/n)" + private: false + default: "n" + + - name: "sap_path" + prompt: "Enter path to SAP HANA install files" + private: false + default: /sap-install + + - name: "sap_hana_sid" + prompt: "SAP HANA SID" + private: false + default: "HDB" + + - name: "sap_hana_instance_number" + prompt: "SAP HANA instance number" + private: false + default: "90" + + - name: "sap_pass" + prompt: "SAP HANA password" + private: true + unsafe: true + + tasks: + - name: Configure Role Variables + ansible.builtin.set_fact: + sap_domain: '{{ sap_domain }}' + ### redhat.sap_install.sap_general_preconfigure + sap_general_preconfigure_modify_etc_hosts: '{{ (sap_update_hosts == "y") | ternary(true, false) }}' + sap_general_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' + sap_general_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' + # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' + ### redhat.sap_install.sap_hana_preconfigure + sap_hana_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' + sap_hana_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' + sap_hana_preconfigure_reboot_ok: '{{ (sap_reboot == "n") | ternary(false, true) }}' + # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' + ## BEGIN sap_hana_install parameters + sap_hana_install_software_directory: '{{ sap_path }}' + sap_hana_install_software_extract_directory: /tmp/sap-hana-inst + sap_hana_install_master_password: '{{ sap_pass }}' + sap_hana_sid: '{{ sap_hana_sid }}' + sap_hana_instance_number: '{{ sap_hana_instance_number }}' + # sap_hana_install_restrict_max_mem: 'y' + # sap_hana_install_max_mem: 38912 + # sap_hana_install_system_roles_collection: 'redhat.rhel_system_roles' +## END sap_hana_install parameters + +- name: Prepare system for SAP HANA Installation + hosts: "{{ target_group | d('localhost') }}" + become: true + + tasks: + - name: Ansible Role Configuration + ansible.builtin.debug: + msg: |- + The Hana setup runs with the following configuration + - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' + - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' + - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' + - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' + - 'Update OS : {{ sap_hana_preconfigure_update }}' + - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' + - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' + - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' + + - name: Pause playbook execution to verify parameters + when: sap_playbook_disclaimer | d('true') + ansible.builtin.pause: + prompt: Press enter to continue + + - name: Prepare general preconfiguration + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure + + - name: Prepare system for HANA installation + ansible.builtin.include_role: + name: community.sap_install.sap_hana_preconfigure + + - name: Install SAP HANA + ansible.builtin.include_role: + name: community.sap_install.sap_hana_install diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml new file mode 100644 index 000000000..afe976d30 --- /dev/null +++ b/playbooks/sap_hana_preconfigure.yml @@ -0,0 +1,88 @@ +--- +## +# Call this playbook interactively with +# ansible-playbook community.sap_install.sap_hana_preconfigure +# +# or alternatively unattended with +# ansible-playbook community.sap_install.sap_hana_preconfigure -e @myvars.yml +# +# The file myvars. yaml needs to contain the following variables +# +- name: Disclaimer + ansible.builtin.import_playbook: disclaimer.yml # TODO: check if FQDN is required/optional + when: sap_playbook_disclaimer | d('true') + +- name: Collecting Variables + hosts: localhost + + vars_prompt: + - name: "sap_domain" + prompt: "Enter Domainname of your SAP systems (leave empty for using system default: " + private: false + default: "{{ sap_domain | d('') }}" + + - name: "sap_update_hosts" + prompt: "Do you want the system to update /etc/hosts for SAP (y/n)" + private: false + default: "y" + + - name: "sap_update" + prompt: "Do you want to update the system? (y/n)" + private: false + default: "n" + + - name: "sap_fail_if_reboot_required" + prompt: "Do you want to stop with an error if the system needs a reboot? (y/n)" + private: false + default: "n" + + - name: "sap_reboot" + prompt: "Do you want to reboot the system if required? (y/n)" + private: false + default: "n" + + tasks: + - name: Configure Role Variables + ansible.builtin.set_fact: + sap_domain: '{{ sap_domain }}' + ### redhat.sap_install.sap_general_preconfigure + sap_general_preconfigure_modify_etc_hosts: '{{ (sap_update_hosts == "y") | ternary(true, false) }}' + sap_general_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' + sap_general_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' + # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' + ### redhat.sap_install.sap_hana_preconfigure + sap_hana_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' + sap_hana_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' + sap_hana_preconfigure_reboot_ok: '{{ (sap_reboot == "n") | ternary(false, true) }}' + # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' + +- name: Prepare system for SAP HANA Installation + hosts: "{{ target_group | d('localhost') }}" + become: true + + tasks: + - name: Ansible Role Configuration + ansible.builtin.debug: + msg: |- + The Hana setup runs with the following configuration + - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' + - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' + - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' + - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' + - 'Update OS : {{ sap_hana_preconfigure_update }}' + - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' + - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' + - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' + + - name: Pause playbook execution to verify parameters + when: sap_playbook_disclaimer | d('true') + ansible.builtin.pause: + prompt: Press enter to continue + + - name: Prepare general preconfiguration + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure + + - name: Prepare system for HANA installation + ansible.builtin.include_role: + name: community.sap_install.sap_hana_preconfigure From 3ca7766bbfa8542a5569fd0ca70f7a531050b046 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:47:13 +0100 Subject: [PATCH 013/210] sap_swpm: legacy ascs ha code --- roles/sap_swpm/tasks/pre_install/create_os_user.yml | 3 +++ .../tasks/pre_install/install_type/ha_install.yml | 12 +++++++----- .../install_type/ha_maint_plan_stack_install.yml | 12 +++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/create_os_user.yml b/roles/sap_swpm/tasks/pre_install/create_os_user.yml index 397f81fa5..d87e7ce01 100644 --- a/roles/sap_swpm/tasks/pre_install/create_os_user.yml +++ b/roles/sap_swpm/tasks/pre_install/create_os_user.yml @@ -1,5 +1,8 @@ --- +# Legacy code, appears to serve no function but does cause ASCS HA adm to not default to C Shell +# As test without this code installed ASCS HA successfully, the call to this file has been commented out for removal at later date + - name: SAP SWPM Pre Install - Remove existing {{ sap_swpm_sid | lower + 'adm' }} block: diff --git a/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml index 91ce10f5a..1e4e7f878 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml @@ -8,8 +8,10 @@ ansible.builtin.set_fact: sap_swpm_swpm_command_virtual_hostname: "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" -# Create sidadm and sapsys when HA setup -- name: SAP SWPM Pre Install - HA Installation - Create User when ASCS (initial HA setup) - ansible.builtin.include_tasks: ../create_os_user.yml - when: - - "'_ASCS' in sap_swpm_product_catalog_id" +# Legacy code, appears to serve no function but does cause ASCS HA adm to not default to C Shell +# As test without this code installed ASCS HA successfully, commenting out for removal at later date +# # Create sidadm and sapsys when HA setup +# - name: SAP SWPM Pre Install - HA Installation - Create User when ASCS (initial HA setup) +# ansible.builtin.include_tasks: ../create_os_user.yml +# when: +# - "'_ASCS' in sap_swpm_product_catalog_id" diff --git a/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml index a1f7cbb6d..b8277cc9a 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml @@ -8,11 +8,13 @@ ansible.builtin.set_fact: sap_swpm_swpm_command_virtual_hostname: "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" -# Create sidadm and sapsys when HA setup -- name: SAP SWPM Pre Install - HA Installation - Create User when ASCS (initial HA setup) - ansible.builtin.include_tasks: ../create_os_user.yml - when: - - "'_ASCS' in sap_swpm_product_catalog_id" +# Legacy code, appears to serve no function but does cause ASCS HA adm to not default to C Shell +# As test without this code installed ASCS HA successfully, commenting out for removal at later date +# # Create sidadm and sapsys when HA setup +# - name: SAP SWPM Pre Install - HA Installation - Create User when ASCS (initial HA setup) +# ansible.builtin.include_tasks: ../create_os_user.yml +# when: +# - "'_ASCS' in sap_swpm_product_catalog_id" # Install using SAP Maintenance Planner Stack XML From 3d583c22c8afad78e439a7863a06d24cd9773d84 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Thu, 20 Jun 2024 13:07:42 +0100 Subject: [PATCH 014/210] sap_swpm_db_schema_password required due to anomaly in password_facts.yml --- ...bles-sap-swpm-default-mode-s4hana-distributed-aas-install.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml index 1a08940f0..7a031ac21 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml @@ -38,6 +38,7 @@ sap_swpm_db_system_password: "NewPass$321" sap_swpm_db_systemdb_password: "NewPass$321" sap_swpm_db_schema_abap: "SAPHANADB" sap_swpm_db_schema_abap_password: "NewPass$321" +sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" sap_swpm_db_sidadm_password: "NewPass$321" # NW Instance Parameters From 1380d0b253f58756c64b059d192bcdb74f932395 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:10:43 +0100 Subject: [PATCH 015/210] sap_swpm: legacy ascs ha comment out all --- .../tasks/pre_install/create_os_user.yml | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/create_os_user.yml b/roles/sap_swpm/tasks/pre_install/create_os_user.yml index d87e7ce01..e9ec2bab2 100644 --- a/roles/sap_swpm/tasks/pre_install/create_os_user.yml +++ b/roles/sap_swpm/tasks/pre_install/create_os_user.yml @@ -3,52 +3,52 @@ # Legacy code, appears to serve no function but does cause ASCS HA adm to not default to C Shell # As test without this code installed ASCS HA successfully, the call to this file has been commented out for removal at later date -- name: SAP SWPM Pre Install - Remove existing {{ sap_swpm_sid | lower + 'adm' }} - block: - -# Reason for noqa: We currently do not determine if there are processes to be killed - - name: SAP SWPM Pre Install - Kill all processes under {{ sap_swpm_sid | lower + 'adm' }} - ansible.builtin.shell: | - killall -u {{ sap_swpm_sid | lower }}adm - ignore_errors: yes - changed_when: true - - - name: SAP SWPM Pre Install - Remove user {{ sap_swpm_sid | lower + 'adm' }} - ansible.builtin.user: - name: '{{ sap_swpm_sid | lower }}adm' - state: absent - remove: yes - force: yes - - - name: SAP SWPM Pre Install - Remove group {{ sap_swpm_sid | lower + 'adm' }} - ansible.builtin.group: - name: '{{ sap_swpm_sid | lower }}adm' - state: absent - -- name: SAP SWPM Pre Install - Create sapsys group - ansible.builtin.group: - name: 'sapsys' - gid: '{{ sap_swpm_sapsys_gid }}' - state: present - -- name: SAP SWPM Pre Install - Create {{ sap_swpm_sid | lower + 'adm' }} - ansible.builtin.user: - name: '{{ sap_swpm_sid | lower }}adm' - comment: "SAP User - {{ sap_swpm_sid }}" - uid: '{{ sap_swpm_sidadm_uid }}' - group: '{{ sap_swpm_sapsys_gid }}' - -- name: SAP SWPM Pre Install - Create a /usr/sap/{{ sap_swpm_sid }} - ansible.builtin.file: - path: /usr/sap/{{ sap_swpm_sid }} - state: directory - owner: '{{ sap_swpm_sid | lower }}adm' - group: sapsys - recurse: yes - mode: '0755' - -# - name: SAP SWPM Pre Install - Purge parameters so it will not populate inifile.params to prevent SWPM from crashing -# ansible.builtin.set_facts: -# sap_swpm_sapadm_uid: "" -# sap_swpm_sapsys_gid: "" -# sap_swpm_sidadm_uid: "" +# - name: SAP SWPM Pre Install - Remove existing {{ sap_swpm_sid | lower + 'adm' }} +# block: + +# # Reason for noqa: We currently do not determine if there are processes to be killed +# - name: SAP SWPM Pre Install - Kill all processes under {{ sap_swpm_sid | lower + 'adm' }} +# ansible.builtin.shell: | +# killall -u {{ sap_swpm_sid | lower }}adm +# ignore_errors: yes +# changed_when: true + +# - name: SAP SWPM Pre Install - Remove user {{ sap_swpm_sid | lower + 'adm' }} +# ansible.builtin.user: +# name: '{{ sap_swpm_sid | lower }}adm' +# state: absent +# remove: yes +# force: yes + +# - name: SAP SWPM Pre Install - Remove group {{ sap_swpm_sid | lower + 'adm' }} +# ansible.builtin.group: +# name: '{{ sap_swpm_sid | lower }}adm' +# state: absent + +# - name: SAP SWPM Pre Install - Create sapsys group +# ansible.builtin.group: +# name: 'sapsys' +# gid: '{{ sap_swpm_sapsys_gid }}' +# state: present + +# - name: SAP SWPM Pre Install - Create {{ sap_swpm_sid | lower + 'adm' }} +# ansible.builtin.user: +# name: '{{ sap_swpm_sid | lower }}adm' +# comment: "SAP User - {{ sap_swpm_sid }}" +# uid: '{{ sap_swpm_sidadm_uid }}' +# group: '{{ sap_swpm_sapsys_gid }}' + +# - name: SAP SWPM Pre Install - Create a /usr/sap/{{ sap_swpm_sid }} +# ansible.builtin.file: +# path: /usr/sap/{{ sap_swpm_sid }} +# state: directory +# owner: '{{ sap_swpm_sid | lower }}adm' +# group: sapsys +# recurse: yes +# mode: '0755' + +# # - name: SAP SWPM Pre Install - Purge parameters so it will not populate inifile.params to prevent SWPM from crashing +# # ansible.builtin.set_facts: +# # sap_swpm_sapadm_uid: "" +# # sap_swpm_sapsys_gid: "" +# # sap_swpm_sidadm_uid: "" From 11c5397478cf0c333ad59ce2c17d805266330ef3 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Thu, 20 Jun 2024 14:41:47 +0100 Subject: [PATCH 016/210] Don't ignore DNS A/PTR record inconsistencies, this should fail the check --- .../RedHat/generic/check-dns-name-resolution.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index 562f8d16c..abbc01c24 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -1,17 +1,23 @@ --- -- name: Check dns forwarding settings +- name: Check forward dns record (A) ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false - ignore_errors: true + #ignore_errors: true + register: dug + failed_when: dug.rc != 0 ### BUG: dig does not use search path in resolv.con on PPCle - name: Check resolv.conf settings ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false - ignore_errors: true +#ignore_errors: true + register: dug + failed_when: dug.rc != 0 -- name: Check dns reverse settings +- name: Check reverse dns record (PTR) ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}." changed_when: false - ignore_errors: true + #ignore_errors: true + register: dug + failed_when: dug.rc != 0 From 3416f296f935e2a553459c5b906f081aa33363c1 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 21 Jun 2024 11:35:30 +0200 Subject: [PATCH 017/210] new interactive playbook and non interactive playbook --- playbooks/disclaimer.yml | 20 ------- playbooks/sap_hana_preconfigure.yml | 67 ++++++++++++------------ playbooks/sap_hana_preconfigure_exec.yml | 53 +++++++++++++++++++ 3 files changed, 87 insertions(+), 53 deletions(-) delete mode 100644 playbooks/disclaimer.yml create mode 100644 playbooks/sap_hana_preconfigure_exec.yml diff --git a/playbooks/disclaimer.yml b/playbooks/disclaimer.yml deleted file mode 100644 index 079129e90..000000000 --- a/playbooks/disclaimer.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Disclaimer for using playbooks - hosts: localhost - gather_facts: false - - tasks: - - name: Disclaimer - ansible.builtin.debug: - msg: |- - ********************************************************************************************************************* - The playbooks of this collections can be used interactively to reach a defined state. - Instead of answering questions interactively, you can pass a variable file - with the required values. - To turn off this diclaimer set sap_playbook_disclaimer to false. - This playbook runs against localhost only. - If you want to use the playbook against multiple hosts, create an inventory containing - these hosts and run the playbook with the options `-i inventory -e target_group=all` - where `inventory` is the filename of the inventory and `all` is the group the playbook is excuted against. - For details creating an inventory see: https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html - ********************************************************************************************************************* diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index afe976d30..6dec8cb89 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -8,16 +8,32 @@ # # The file myvars. yaml needs to contain the following variables # -- name: Disclaimer - ansible.builtin.import_playbook: disclaimer.yml # TODO: check if FQDN is required/optional - when: sap_playbook_disclaimer | d('true') +- name: Playbook Usage + hosts: localhost + tasks: + - name: Playbook Usage + ansible.builtin.debug: + msg: |- + ***************************************************************************** + * sap_hana_preconfigure * + * * + * This playbook is used to prepare an SAP HANA system. * + * The minimum viable parameters to succussfully prepare your system for an * + * SAP HANA installation will be asked. * + * Useful defaults will be set, so that it is save to just press enter * + ***************************************************************************** - name: Collecting Variables hosts: localhost vars_prompt: + - name: "sap_systems" + prompt: "Enter comma separated list of systems, you want to prepare for SAP HANA" + private: false + default: "localhost" + - name: "sap_domain" - prompt: "Enter Domainname of your SAP systems (leave empty for using system default: " + prompt: "Enter DNS Domainname of your SAP systems (leave empty for using system default: " private: false default: "{{ sap_domain | d('') }}" @@ -42,6 +58,13 @@ default: "n" tasks: + - name: Prepare inventory + when: sap_systems != 'localhost' + ansible.builtin.add_host: + groups: sap_hana_prepare_hosts + name: '{{ item }}' + loop: '{{ sap_systems | split(",") | list }}' + - name: Configure Role Variables ansible.builtin.set_fact: sap_domain: '{{ sap_domain }}' @@ -56,33 +79,11 @@ sap_hana_preconfigure_reboot_ok: '{{ (sap_reboot == "n") | ternary(false, true) }}' # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' -- name: Prepare system for SAP HANA Installation - hosts: "{{ target_group | d('localhost') }}" - become: true - - tasks: - - name: Ansible Role Configuration - ansible.builtin.debug: - msg: |- - The Hana setup runs with the following configuration - - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' - - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' - - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' - - 'Update OS : {{ sap_hana_preconfigure_update }}' - - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' - - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' - - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' - - - name: Pause playbook execution to verify parameters - when: sap_playbook_disclaimer | d('true') - ansible.builtin.pause: - prompt: Press enter to continue - - - name: Prepare general preconfiguration - ansible.builtin.include_role: - name: community.sap_install.sap_general_preconfigure +- name: Run sap_hana_prepare_exec playbook + ansible.builtin.import_playbook: sap_hana_preconfigure_exec.yml + vars: + sap_playbook_paramter_confirm: true + #sap_hana_group: 'sap_hana_prepare_hosts' + sap_domain: "{{ hostvars['localhost']['sap_domain'] }}" + sap_general_preconfigure_modify_etc_hosts: "{{ hostvars['localhost']['sap_general_preconfigure_modify_etc_hosts'] }}" - - name: Prepare system for HANA installation - ansible.builtin.include_role: - name: community.sap_install.sap_hana_preconfigure diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml new file mode 100644 index 000000000..a2069d487 --- /dev/null +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -0,0 +1,53 @@ +--- +## +# Call this playbook only with all variables defined. +# The minimum viable set of variables which need to be defined are: +# +# sap_hana_group: name of group in inventory - defaults to localhost if not set +# sap_domain: SAP domain - defaults to ansible_domain if not set, but must not be empty +# +# for redhat.sap_install.sap_general_preconfigure +# sap_general_preconfigure_modify_etc_hosts: defaults to true +# sap_general_preconfigure_update: defaults to false +# sap_general_preconfigure_fail_if_reboot_required: defaults to true +# +# for redhat.sap_install.sap_hana_preconfigure +# sap_hana_preconfigure_update: defaults to false +# sap_hana_preconfigure_fail_if_reboot_required: defaults to true +# sap_hana_preconfigure_reboot_ok: defaults to false + +- name: Prepare system for SAP HANA Installation + hosts: "{{ sap_hana_group | d('localhost') }}" + become: true + tasks: + - name: Ansible Role Configuration + ansible.builtin.debug: + + ### ACHTUNG VArs nur bei Localhost gesetzt, daher Zugriff via hostvars[localhost] + ### Wunsch Target_group wird automatisch aus -i gesetzt, falls nicht explizit angegeben. + + # sap_swpm_extract_directory testen !!! + + msg: |- + The Hana setup runs with the following configuration + - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' + - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' + - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' + - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' + - 'Update OS : {{ sap_hana_preconfigure_update }}' + - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' + - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' + - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' + + - name: Pause playbook execution to verify parameters + when: sap_playbook_paramter_confirm | d('false') + ansible.builtin.pause: + prompt: Press enter to continue + + - name: Prepare general preconfiguration + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure + + - name: Prepare system for HANA installation + ansible.builtin.include_role: + name: community.sap_install.sap_hana_preconfigure From b4c882844a9e936fd8ac13610dc59258ce9ba272 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 21 Jun 2024 12:24:15 +0200 Subject: [PATCH 018/210] Interactive Playbooks --- playbooks/README.md | 56 +++++++++++++++++++++--- playbooks/sap_hana_preconfigure.yml | 10 +++-- playbooks/sap_hana_preconfigure_exec.yml | 2 +- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 7362b9535..a46e52839 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -1,8 +1,52 @@ -# List of playbooks +# Ansible Collection Playbooks -- prepare-for-hana -- prepare-for-netweaver -- install-sap-hana -- install-sap-hana-cluster -- install-sap-hana-s4 +The playbooks in this directory can be used as templates for your own playbooks +(starting with sample-) and some can be called directly with interactive variable collection +or included in your own playbooks or workflows. + +## Usage of playbooks + +### sap-hana-prepare.yml + +This playbook collects information for preparing an SAP system for an SAP HANA installation. + +```[bash] +ansible-playbook community.sap_install.sap_hana_preconfigure.yml +``` + +When you call this playbook against a remote host make sure the user can connect and assume root without a password or pass the following parameters if necessary + +```[bash] + -u : User that establishes the ssh connection + -k: asks for password or passphrase of the connection user, if required for ssh + -K: asks for the privilige escalation password of the connection user to become root on the target host +``` + +If you want to embed this playbook or run non-interactive, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). + +```[yaml] +[my_hanas] +hana1 +hana2 +``` + +Prepare a variable config file with the following parameters (adapt to your needs): + +```[yaml] + # sap_playbook_parameter_confirm: false + sap_hana_group: 'my_hanas' + sap_domain: my.sap.domain + sap_general_preconfigure_modify_etc_hosts: true + sap_general_preconfigure_update: true + sap_general_preconfigure_fail_if_reboot_required: false + sap_hana_preconfigure_update: true + sap_hana_preconfigure_fail_if_reboot_required: false + sap_hana_preconfigure_reboot_ok: true +``` + +Now you can run the playbook with + +```[bash] +ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i inventory -e @my_vars.yml +``` diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 6dec8cb89..ddc2c8f7a 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -82,8 +82,12 @@ - name: Run sap_hana_prepare_exec playbook ansible.builtin.import_playbook: sap_hana_preconfigure_exec.yml vars: - sap_playbook_paramter_confirm: true - #sap_hana_group: 'sap_hana_prepare_hosts' + sap_playbook_parameter_confirm: true + sap_hana_group: "{{ ( groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts','localhost') }}" sap_domain: "{{ hostvars['localhost']['sap_domain'] }}" sap_general_preconfigure_modify_etc_hosts: "{{ hostvars['localhost']['sap_general_preconfigure_modify_etc_hosts'] }}" - + sap_general_preconfigure_update: "{{ hostvars['localhost']['sap_general_preconfigure_update'] }}" + sap_general_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_general_preconfigure_fail_if_reboot_required'] }}" + sap_hana_preconfigure_update: "{{ hostvars['localhost']['sap_hana_preconfigure_update'] }}" + sap_hana_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_hana_preconfigure_fail_if_reboot_required'] }}" + sap_hana_preconfigure_reboot_ok: "{{ hostvars['localhost']['sap_hana_preconfigure_reboot_ok'] }}" diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index a2069d487..2017500ac 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -40,7 +40,7 @@ - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' - name: Pause playbook execution to verify parameters - when: sap_playbook_paramter_confirm | d('false') + when: sap_playbook_parameter_confirm | d('false') ansible.builtin.pause: prompt: Press enter to continue From 7e4806720ada64d64db0c320dbd6b6f228ed3045 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 21 Jun 2024 12:35:30 +0200 Subject: [PATCH 019/210] Updates to README --- playbooks/README.md | 9 +++++++-- playbooks/sap_hana_preconfigure_exec.yml | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index a46e52839..8a47da0cc 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -10,6 +10,7 @@ or included in your own playbooks or workflows. ### sap-hana-prepare.yml This playbook collects information for preparing an SAP system for an SAP HANA installation. +Run the following command: ```[bash] ansible-playbook community.sap_install.sap_hana_preconfigure.yml @@ -25,6 +26,8 @@ When you call this playbook against a remote host make sure the user can connect If you want to embed this playbook or run non-interactive, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). +Create the file `my_inventory` with the following content: + ```[yaml] [my_hanas] hana1 @@ -33,6 +36,8 @@ hana2 Prepare a variable config file with the following parameters (adapt to your needs): +Create a parameter file `my_vars` with the following content: + ```[yaml] # sap_playbook_parameter_confirm: false sap_hana_group: 'my_hanas' @@ -45,8 +50,8 @@ Prepare a variable config file with the following parameters (adapt to your need sap_hana_preconfigure_reboot_ok: true ``` -Now you can run the playbook with +Now you can run the playbook non-interactively with ```[bash] -ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i inventory -e @my_vars.yml +ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml ``` diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 2017500ac..7aba5d088 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -22,10 +22,6 @@ tasks: - name: Ansible Role Configuration ansible.builtin.debug: - - ### ACHTUNG VArs nur bei Localhost gesetzt, daher Zugriff via hostvars[localhost] - ### Wunsch Target_group wird automatisch aus -i gesetzt, falls nicht explizit angegeben. - # sap_swpm_extract_directory testen !!! msg: |- From 0129e52e75e23abbb772297fd151d8fc025219a2 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 21 Jun 2024 12:37:34 +0200 Subject: [PATCH 020/210] Update im Readme --- playbooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/README.md b/playbooks/README.md index 8a47da0cc..4da773d28 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -7,7 +7,7 @@ or included in your own playbooks or workflows. ## Usage of playbooks -### sap-hana-prepare.yml +### Prepare System for SAP HANA installation (sap_hana_prepare.yml/sap_hana_prepare_exec.yml) This playbook collects information for preparing an SAP system for an SAP HANA installation. Run the following command: From 4145c1020ea3db4be43e15df4cb5b9f637a2f06c Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Fri, 21 Jun 2024 12:38:52 +0200 Subject: [PATCH 021/210] update to Readme --- playbooks/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 4da773d28..234655068 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -26,7 +26,7 @@ When you call this playbook against a remote host make sure the user can connect If you want to embed this playbook or run non-interactive, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). -Create the file `my_inventory` with the following content: +Create the file `my_inventory` similar to: ```[yaml] [my_hanas] @@ -36,7 +36,7 @@ hana2 Prepare a variable config file with the following parameters (adapt to your needs): -Create a parameter file `my_vars` with the following content: +Create a parameter file `my_vars` with similar content: ```[yaml] # sap_playbook_parameter_confirm: false From d779f7dae992a75d428cf1b55f06e4787b5bf766 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 21 Jun 2024 20:59:37 +0100 Subject: [PATCH 022/210] sap_install_media_detect: aws igw slow impact gpg key --- .../tasks/cleanup/disable-epel-repo.yml | 1 + .../tasks/prepare/enable_rar_handling.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml index c6668e1bd..f33657ba8 100644 --- a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml +++ b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml @@ -12,6 +12,7 @@ ansible.builtin.rpm_key: state: absent key: "{{ sap_install_media_detect_epel_gpg_key_url }}" + retries: 10 when: - sap_install_media_detect_use_rpm_key_module_for_removing_the_key - __sap_install_media_detect_register_rpm_q_gpg_pubkeys.stdout | length != 0 diff --git a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml index a829654ab..7f993905b 100644 --- a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml +++ b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml @@ -26,6 +26,7 @@ ansible.builtin.rpm_key: state: present key: "{{ sap_install_media_detect_epel_gpg_key_url }}" + retries: 10 # ansible.builtin.command: "rpm --import {{ eap_install_media_detect_epel_gpg_key_url }}" # changed_when: true @@ -38,6 +39,7 @@ # name: "{{ sap_install_media_detect_epel_url }}" name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" state: present + retries: 10 # Reason for noqa: We would need an extra call to /usr/bin/crb status to determine the current status - name: SAP Install Media Detect - Prepare - EPEL - Enable the CRB repo # noqa no-changed-when From 58b29740ec4b66fa9a5b31732b42d915573d31e2 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 24 Jun 2024 18:51:07 +0200 Subject: [PATCH 023/210] sap_swpm: Remove the pids module Solves issue #719. Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/swpm.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/roles/sap_swpm/tasks/swpm.yml b/roles/sap_swpm/tasks/swpm.yml index 997235277..091f85210 100644 --- a/roles/sap_swpm/tasks/swpm.yml +++ b/roles/sap_swpm/tasks/swpm.yml @@ -22,25 +22,9 @@ ### Async method -# Required for Ansible Module pids -- name: Install Python devel, Python pip and gcc to system Python - ansible.builtin.package: - name: - - python3-devel - - python3-pip - - gcc - state: present - -# Required for Ansible Module pids -- name: Install Python dependency psutil to system Python - ansible.builtin.pip: - name: - - psutil -# executable: pip3.6 - - name: Set fact for the sapinst command line ansible.builtin.set_fact: - __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | default('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }} + __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }} {{ sap_swpm_swpm_command_product_id }} {{ sap_swpm_swpm_command_extra_args }}" tags: sap_swpm_sapinst_commandline @@ -70,16 +54,14 @@ async: 86400 # Seconds for maximum runtime, set to 24 hours poll: 0 # Seconds between polls, use 0 to run Ansible Tasks concurrently -# Monitor sapinst process (i.e. ps aux | grep sapinst) and wait for exit +# Monitor sapinst process and wait for exit - name: SAP SWPM - Wait for sapinst process to exit, poll every 60 seconds - community.general.pids: - name: sapinst -# shell: ps -ef | awk '/sapinst/&&!/awk/&&!/ansible/{print}' - register: pids_sapinst - until: "pids_sapinst.pids | length == 0" -# until: "pids_sapinst.stdout | length == 0" + ansible.builtin.shell: set -o pipefail && ps -ef | awk '/\.\/sapinst /&&!/umask/&&!/ awk /{print}' + register: __sap_swpm_register_pids_sapinst + until: "__sap_swpm_register_pids_sapinst.stdout | length == 0" retries: 1440 delay: 60 + changed_when: false - name: SAP SWPM - Verify if sapinst process finished successfully ansible.builtin.async_status: From e01d6304406b1834680f14491c837491ef962f1b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:13:51 +0100 Subject: [PATCH 024/210] sap_install_media_detect: search known subdirs on re-run --- .../prepare/move_files_to_main_directory.yml | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 5bfae97f1..8d65c26ae 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -1,15 +1,18 @@ --- -- name: SAP Install Media Detect - Prepare - Initialize fact variables, phase 1b +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Initialize fact variables, phase 1b ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1b: [] # If any files have been moved to non-extract subdirectories already, move them back to the top level, making the role idempotent # Reason for noqa: When using pipefail and there is no result from the grep -v, this tail will fail but it should never fail -- name: SAP Install Media Detect - Prepare - Find the relevant non-extract subdirectories # noqa risky-shell-pipe +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Find the relevant non-extract subdirectories # noqa risky-shell-pipe ansible.builtin.shell: cmd: > - ls -d sap_hana sap_swpm sap_swpm_download_basket $({{ __sap_install_media_detect_sapfile_path }} -s) 2>/dev/null | + ls -d \ + sap_hana sap_swpm sap_swpm_download_basket \ + sapase sapmaxdb oracledb ibmdb2 sap_export_nwas_java sap_export_ecc sap_export_nwas_abap sap_export_solman_java sap_export_ecc_ides \ + $({{ __sap_install_media_detect_sapfile_path }} -s) 2>/dev/null | awk '{print ("'{{ __sap_install_media_detect_software_main_directory }}'/"$0"/")}' chdir: "{{ __sap_install_media_detect_software_main_directory }}" register: __sap_install_media_detect_register_subdirectories_phase_1b @@ -17,21 +20,21 @@ failed_when: false # Reason for noqa: When using pipefail and there is no result from the grep -v, this tail will fail but it should never fail -- name: SAP Install Media Detect - Prepare - Find existing extract subdirectories # noqa risky-shell-pipe +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Find existing extract subdirectories # noqa risky-shell-pipe ansible.builtin.shell: ls -d {{ __sap_install_media_detect_software_main_directory }}/*/ | grep '_extracted/$' register: __sap_install_media_detect_register_subdirectories_phase_1b_extracted changed_when: false failed_when: false -- name: SAP Install Media Detect - Prepare - Display the relevant non-extract subdirectories +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Display the relevant non-extract subdirectories ansible.builtin.debug: var: __sap_install_media_detect_register_subdirectories_phase_1b.stdout_lines -- name: SAP Install Media Detect - Prepare - Display existing extract subdirectories +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Display existing extract subdirectories ansible.builtin.debug: var: __sap_install_media_detect_register_subdirectories_phase_1b_extracted.stdout_lines -- name: SAP Install Media Detect - Prepare - Create list of all files one level below '{{ __sap_install_media_detect_software_main_directory }}' +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Create list of all files one level below '{{ __sap_install_media_detect_software_main_directory }}' ansible.builtin.find: paths: "{{ line_item }}" patterns: '*' @@ -43,7 +46,7 @@ loop_var: line_item register: __sap_install_media_detect_register_find_result_phase_1b -- name: SAP Install Media Detect - Prepare - Set fact from find result, phase 1b +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Set fact from find result, phase 1b ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1b: "{{ __sap_install_media_detect_fact_find_result_phase_1b + [item.1.path] }}" with_subelements: @@ -51,13 +54,13 @@ - files # Reason for noqa: Too much additional code required for determining if anything has changed or not -- name: SAP Install Media Detect - Prepare - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when ansible.builtin.command: "mv {{ line_item }} {{ __sap_install_media_detect_software_main_directory }}/" loop: "{{ __sap_install_media_detect_fact_find_result_phase_1b }}" loop_control: loop_var: line_item -- name: SAP Install Media Detect - Prepare - Remove the relevant non-extract subdirectories +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Remove the relevant non-extract subdirectories ansible.builtin.file: path: "{{ line_item }}" state: absent @@ -65,7 +68,7 @@ loop_control: loop_var: line_item -- name: SAP Install Media Detect - Prepare - Remove the extract subdirectories +- name: SAP Install Media Detect - Prepare - Search known subdirectories - Remove the extract subdirectories ansible.builtin.file: path: "{{ line_item }}" state: absent From 817e51d2ae40a865f726942a1fa8829c647b3471 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Tue, 25 Jun 2024 09:34:48 +0100 Subject: [PATCH 025/210] sap_general_preconfigure: DNS A/PTR check to fail if entries inconsistent --- .../RedHat/generic/check-dns-name-resolution.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index abbc01c24..79b209bfa 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -4,20 +4,20 @@ ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false #ignore_errors: true - register: dug - failed_when: dug.rc != 0 + register: __sap_general_preconfigure_register_dns_test_a + failed_when: __sap_general_preconfigure_register_dns_test_a.rc != 0 ### BUG: dig does not use search path in resolv.con on PPCle - name: Check resolv.conf settings ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false #ignore_errors: true - register: dug - failed_when: dug.rc != 0 + register: __sap_general_preconfigure_register_dns_test_resolvconf + failed_when: __sap_general_preconfigure_register_dns_test_resolvconf.rc != 0 - name: Check reverse dns record (PTR) ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}." changed_when: false #ignore_errors: true - register: dug - failed_when: dug.rc != 0 + register: __sap_general_preconfigure_register_dns_test_ptr + failed_when: __sap_general_preconfigure_register_dns_test_ptr.rc != 0 From 6198f0372779e00890edaf67a48f1a7e6d227fd4 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Tue, 25 Jun 2024 10:32:54 +0100 Subject: [PATCH 026/210] sap_swpm: observer mode, updated default behaviour and values --- roles/sap_swpm/defaults/main.yml | 6 +++--- roles/sap_swpm/tasks/pre_install.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index 08a84ecc1..26a23e064 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -197,11 +197,11 @@ sap_swpm_tms_tr_files_path: # --- Experimental - SWPM Observer mode --- # # Enables observer mode of SWPM - TO BE USED for debugging/troubleshooting mainly # This allows user to watch the installation progress from a browser (on standard port 4237) and possibly interact with it -# Note: Interaction can impact the automated installation and may result in the requirements for further manual actions in order to complete the installation +# Note: Interaction can impact the automated installation and may result in the need for further manual actions in order to complete the installation sap_swpm_swpm_observer_mode: false # Allows to specify a different remote access user (e.g. when root's password is unknown). Default SWPM behaviour is to use root. This may not be desirable as -# root's password may not be available for security reasons. The remote access user must exist before SWPM is executed (i.e. adm can't be used if it doesn't exist yet). -#sap_swpm_swpm_remote_access_user: admin +# root's password may not be available for security reasons. The remote access user must exist before SWPM is executed (i.e. adm can't be used if it doesn't exist yet). +sap_swpm_swpm_remote_access_user: # --- Experimental - SWPM Observer mode --- # sap_swpm_install_saphostagent: 'true' diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 93faba0d9..6790dfbf2 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -17,7 +17,7 @@ - name: SAP SWPM Pre Install - Set sapinst command vars: sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" From 621d232b981da5a2f074a89feb16ae2ca4c3e988 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Tue, 25 Jun 2024 18:00:08 +0200 Subject: [PATCH 027/210] docs(CONTRIBUTORS): update contributors file --- docs/CONTRIBUTORS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/CONTRIBUTORS.md b/docs/CONTRIBUTORS.md index 7aa38e371..9a31cb7ac 100644 --- a/docs/CONTRIBUTORS.md +++ b/docs/CONTRIBUTORS.md @@ -15,3 +15,7 @@ - **SVA** - **Thomas Bludau** - Origin developer of SAP installation Ansible automation (2019) and project co-owner - **Rainer Leber** - Developer of Ansible Collection (SLES code) +- **SUSE** + - SUSE SAP Emerging Technology Solutions + - **Marcel Mamula** - SAP solution architect and developer of Ansible Collection + - **Gabriele Puliti** - Developer of Ansible Collection From fa96b06eaf28844cadb6c08bae0b7e3ffafd0079 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:40:21 +0200 Subject: [PATCH 028/210] feat(*.yml): append license in the first line Closes #777 --- galaxy.yml | 1 + playbooks/sample-sap-ha-deployment-hana-2-node-cluster.yml | 1 + playbooks/sample-sap-hana-install.yml | 1 + playbooks/sample-sap-hana-preconfigure.yml | 1 + playbooks/sample-sap-nwas-ascs-ers-2-node-cluster.yml | 1 + playbooks/sample-sap-storage-prep.yml | 1 + playbooks/sample-sap-swpm-advanced-mode.yml | 1 + playbooks/sample-sap-swpm-advanced-templates-mode.yml | 1 + playbooks/sample-sap-swpm-all-modes-interactive.yml | 1 + playbooks/sample-sap-swpm-default-mode.yml | 1 + playbooks/sample-sap-swpm-default-templates-mode.yml | 1 + playbooks/sample-sap-swpm-inifile-reuse-mode.yml | 1 + playbooks/sample-storage_sap_s4hana_distributed.yml | 1 + playbooks/vars/sample-variables-sap-hana-install.yml | 1 + playbooks/vars/sample-variables-sap-storage-lvm-stripes.yml | 1 + playbooks/vars/sample-variables-sap-storage-lvm.yml | 1 + ...e-variables-sap-swpm-advanced-mode-s4hana-onehost-install.yml | 1 + .../vars/sample-variables-sap-swpm-advanced-templates-mode.yml | 1 + ...e-variables-sap-swpm-default-mode-bw4hana-onehost-install.yml | 1 + ...bles-sap-swpm-default-mode-s4hana-distributed-aas-install.yml | 1 + ...les-sap-swpm-default-mode-s4hana-distributed-ascs-install.yml | 1 + ...s-sap-swpm-default-mode-s4hana-distributed-dbload-install.yml | 1 + ...bles-sap-swpm-default-mode-s4hana-distributed-ers-install.yml | 1 + ...bles-sap-swpm-default-mode-s4hana-distributed-pas-install.yml | 1 + ...le-variables-sap-swpm-default-mode-s4hana-onehost-install.yml | 1 + ...le-variables-sap-swpm-default-mode-s4hana-onehost-restore.yml | 1 + ...es-sap-swpm-default-mode-solman-hana-abap-onehost-install.yml | 1 + ...es-sap-swpm-default-mode-solman-hana-java-onehost-install.yml | 1 + .../sample-variables-sap-swpm-default-mode-system-rename.yml | 1 + ...ariables-sap-swpm-default-mode-webdisp-standalone-install.yml | 1 + .../vars/sample-variables-sap-swpm-default-templates-mode.yml | 1 + roles/sap_anydb_install_oracle/.yamllint.yml | 1 + roles/sap_anydb_install_oracle/defaults/main.yml | 1 + roles/sap_anydb_install_oracle/handlers/main.yml | 1 + roles/sap_anydb_install_oracle/meta/main.yml | 1 + roles/sap_anydb_install_oracle/tasks/main.yml | 1 + .../tasks/oracledb_install_post_mopatch.yml | 1 + roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml | 1 + .../tasks/oracledb_installer_minimal.yml | 1 + .../tasks/oracledb_installer_responsefile.yml | 1 + roles/sap_general_preconfigure/.yamllint.yml | 1 + roles/sap_general_preconfigure/defaults/main.yml | 1 + roles/sap_general_preconfigure/handlers/main.yml | 1 + roles/sap_general_preconfigure/meta/argument_specs.yml | 1 + roles/sap_general_preconfigure/meta/collection-requirements.yml | 1 + roles/sap_general_preconfigure/meta/main.yml | 1 + .../tasks/RedHat/assert-configuration.yml | 1 + .../tasks/RedHat/assert-installation.yml | 1 + roles/sap_general_preconfigure/tasks/RedHat/configuration.yml | 1 + .../tasks/RedHat/generic/assert-dns-name-resolution.yml | 1 + .../tasks/RedHat/generic/assert-etc-hosts.yml | 1 + .../tasks/RedHat/generic/assert-firewall.yml | 1 + .../tasks/RedHat/generic/assert-hostname.yml | 1 + .../tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml | 1 + .../tasks/RedHat/generic/assert-kernel-parameters.yml | 1 + .../tasks/RedHat/generic/assert-limits-conf-file.yml | 1 + .../tasks/RedHat/generic/assert-nofile-limits.yml | 1 + .../tasks/RedHat/generic/assert-nproc-limits.yml | 1 + .../tasks/RedHat/generic/assert-selinux.yml | 1 + .../tasks/RedHat/generic/assert-systemd-tmpfiles.yml | 1 + .../tasks/RedHat/generic/assert-tmpfs.yml | 1 + .../tasks/RedHat/generic/assert-uuidd.yml | 1 + .../tasks/RedHat/generic/check-dns-name-resolution.yml | 1 + .../tasks/RedHat/generic/configure-etc-hosts.yml | 1 + .../tasks/RedHat/generic/configure-firewall.yml | 1 + .../tasks/RedHat/generic/configure-hostname.yml | 1 + .../tasks/RedHat/generic/configure-kernel-parameters.yml | 1 + .../tasks/RedHat/generic/configure-selinux.yml | 1 + .../tasks/RedHat/generic/configure-systemd-tmpfiles.yml | 1 + .../tasks/RedHat/generic/configure-tmpfs.yml | 1 + .../tasks/RedHat/generic/configure-uuidd.yml | 1 + .../tasks/RedHat/generic/increase-nofile-limits.yml | 1 + .../tasks/RedHat/generic/increase-nproc-limits.yml | 1 + roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 1 + .../sap_general_preconfigure/tasks/SLES/assert-configuration.yml | 1 + .../sap_general_preconfigure/tasks/SLES/assert-installation.yml | 1 + roles/sap_general_preconfigure/tasks/SLES/configuration.yml | 1 + roles/sap_general_preconfigure/tasks/SLES/installation.yml | 1 + roles/sap_general_preconfigure/tasks/main.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/0941735.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/1391070.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/1771258.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/2002167.yml | 1 + .../tasks/sapnote/2002167/02-assert-configuration-changes.yml | 1 + .../tasks/sapnote/2002167/02-configuration-changes.yml | 1 + .../tasks/sapnote/2002167/03-assert-setting-the-hostname.yml | 1 + .../tasks/sapnote/2002167/03-setting-the-hostname.yml | 1 + .../tasks/sapnote/2002167/04-assert-linux-kernel-parameters.yml | 1 + .../tasks/sapnote/2002167/04-linux-kernel-parameters.yml | 1 + .../tasks/sapnote/2002167/05-assert-process-resource-limits.yml | 1 + .../tasks/sapnote/2002167/05-process-resource-limits.yml | 1 + .../2002167/06-additional-notes-for-installing-sap-systems.yml | 1 + .../06-assert-additional-notes-for-installing-sap-systems.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/2772999.yml | 1 + .../tasks/sapnote/2772999/02-assert-selinux.yml | 1 + .../tasks/sapnote/2772999/02-configure-selinux.yml | 1 + .../tasks/sapnote/2772999/03-assert-hostname.yml | 1 + .../tasks/sapnote/2772999/03-configure-hostname.yml | 1 + .../tasks/sapnote/2772999/04-assert-network-time-and-date.yml | 1 + .../tasks/sapnote/2772999/04-configure-network-time-and-date.yml | 1 + .../tasks/sapnote/2772999/05-assert-firewall.yml | 1 + .../tasks/sapnote/2772999/05-configure-firewall.yml | 1 + .../tasks/sapnote/2772999/06-assert-uuidd.yml | 1 + .../tasks/sapnote/2772999/06-configure-uuidd.yml | 1 + .../tasks/sapnote/2772999/07-assert-tmpfs.yml | 1 + .../tasks/sapnote/2772999/07-configure-tmpfs.yml | 1 + .../tasks/sapnote/2772999/08-assert-linux-kernel-parameters.yml | 1 + .../sapnote/2772999/08-configure-linux-kernel-parameters.yml | 1 + .../tasks/sapnote/2772999/09-assert-process-resource-limits.yml | 1 + .../sapnote/2772999/09-configure-process-resource-limits.yml | 1 + .../tasks/sapnote/2772999/10-assert-systemd-tmpfiles.yml | 1 + .../tasks/sapnote/2772999/10-configure-systemd-tmpfiles.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/3108316.yml | 1 + .../tasks/sapnote/3108316/02-assert-selinux.yml | 1 + .../tasks/sapnote/3108316/02-configure-selinux.yml | 1 + .../tasks/sapnote/3108316/03-assert-hostname.yml | 1 + .../tasks/sapnote/3108316/03-configure-hostname.yml | 1 + .../tasks/sapnote/3108316/04-assert-network-time-and-date.yml | 1 + .../tasks/sapnote/3108316/04-configure-network-time-and-date.yml | 1 + .../tasks/sapnote/3108316/05-assert-firewall.yml | 1 + .../tasks/sapnote/3108316/05-configure-firewall.yml | 1 + .../tasks/sapnote/3108316/06-assert-uuidd.yml | 1 + .../tasks/sapnote/3108316/06-configure-uuidd.yml | 1 + .../tasks/sapnote/3108316/07-assert-tmpfs.yml | 1 + .../tasks/sapnote/3108316/07-configure-tmpfs.yml | 1 + .../tasks/sapnote/3108316/08-assert-linux-kernel-parameters.yml | 1 + .../sapnote/3108316/08-configure-linux-kernel-parameters.yml | 1 + .../tasks/sapnote/3108316/09-assert-process-resource-limits.yml | 1 + .../sapnote/3108316/09-configure-process-resource-limits.yml | 1 + .../tasks/sapnote/3108316/10-assert-systemd-tmpfiles.yml | 1 + .../tasks/sapnote/3108316/10-configure-systemd-tmpfiles.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-1391070.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-1771258.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-2002167.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-2772999.yml | 1 + roles/sap_general_preconfigure/tasks/sapnote/assert-3108316.yml | 1 + .../tests/sap_general_preconfigure-default-settings.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_7.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_8.0.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_8.1.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_8.2.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_8.yml | 1 + roles/sap_general_preconfigure/vars/RedHat_9.yml | 1 + roles/sap_general_preconfigure/vars/SLES_15.yml | 1 + roles/sap_general_preconfigure/vars/main.yml | 1 + roles/sap_ha_install_hana_hsr/.yamllint.yml | 1 + roles/sap_ha_install_hana_hsr/defaults/main.yml | 1 + roles/sap_ha_install_hana_hsr/meta/main.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/hdbuserstore.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/log_mode.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/main.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/pki_files.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/run_backup.yml | 1 + roles/sap_ha_install_hana_hsr/tasks/update_etchosts.yml | 1 + roles/sap_ha_pacemaker_cluster/.yamllint.yml | 1 + roles/sap_ha_pacemaker_cluster/defaults/main.yml | 1 + roles/sap_ha_pacemaker_cluster/handlers/main.yml | 1 + roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml | 1 + roles/sap_ha_pacemaker_cluster/meta/collection-requirements.yml | 1 + roles/sap_ha_pacemaker_cluster/meta/main.yml | 1 + .../tasks/RedHat/post_steps_hana_scaleup.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/RedHat/pre_steps_hana.yml | 1 + .../tasks/Suse/post_steps_hana_scaleup.yml | 1 + .../tasks/Suse/post_steps_nwas_abap_ascs_ers.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml | 1 + .../tasks/configure_nwas_ascs_ers_postinstallation.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml | 1 + .../tasks/construct_final_hacluster_vars.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml | 1 + .../tasks/construct_vars_hana_common.yml | 1 + .../tasks/construct_vars_hana_scaleout.yml | 1 + .../tasks/construct_vars_hana_scaleup.yml | 1 + .../tasks/construct_vars_hana_scaleup_angi.yml | 1 + .../tasks/construct_vars_haproxy_constraints_hana.yml | 1 + .../tasks/construct_vars_nwas_abap_ascs_ers.yml | 1 + .../tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml | 1 + .../tasks/construct_vars_nwas_abap_pas_aas.yml | 1 + .../tasks/construct_vars_nwas_common.yml | 1 + .../tasks/construct_vars_nwas_java_scs_ers.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml | 1 + .../tasks/construct_vars_vip_constraints_hana.yml | 1 + .../sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml | 1 + .../tasks/construct_vars_vip_resources_default.yml | 1 + .../tasks/import_hacluster_vars_from_inventory.yml | 1 + .../tasks/include_construct_vip_resources.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml | 1 + roles/sap_ha_pacemaker_cluster/tasks/main.yml | 1 + .../tasks/platform/ascertain_platform_type.yml | 1 + .../platform/construct_vars_vip_resources_cloud_aws_ec2_vs.yml | 1 + .../platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml | 1 + .../construct_vars_vip_resources_cloud_ibmcloud_powervs.yml | 1 + .../platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml | 1 + .../platform/construct_vars_vip_resources_cloud_msazure_vm.yml | 1 + .../platform/construct_vars_vip_resources_hyp_ibmpower_vm.yml | 1 + .../tasks/platform/include_vars_platform.yml | 1 + .../tasks/platform/preconfigure_cloud_aws_ec2_vs.yml | 1 + .../tasks/platform/preconfigure_cloud_gcp_ce_vm.yml | 1 + .../tasks/platform/preconfigure_cloud_ibmcloud_powervs.yml | 1 + .../tasks/platform/preconfigure_cloud_ibmcloud_vs.yml | 1 + .../tasks/platform/preconfigure_cloud_msazure_vm.yml | 1 + .../tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml | 1 + .../tasks/platform/register_sysinfo_cloud_ibmcloud_vs.yml | 1 + .../tasks/platform/register_sysinfo_hyp_ibmpower_vm.yml | 1 + .../sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/main.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml | 1 + .../sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml | 1 + .../vars/platform_cloud_ibmcloud_powervs.yml | 1 + .../sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml | 1 + .../sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/suse.yml | 1 + roles/sap_hana_install/.yamllint.yml | 1 + roles/sap_hana_install/defaults/main.yml | 1 + roles/sap_hana_install/meta/argument_specs.yml | 1 + roles/sap_hana_install/meta/collection-requirements.yml | 1 + roles/sap_hana_install/meta/main.yml | 1 + roles/sap_hana_install/tasks/assert-addhosts-loop-block.yml | 1 + roles/sap_hana_install/tasks/hana_addhosts.yml | 1 + roles/sap_hana_install/tasks/hana_exists.yml | 1 + roles/sap_hana_install/tasks/hana_install.yml | 1 + roles/sap_hana_install/tasks/main.yml | 1 + roles/sap_hana_install/tasks/post_install.yml | 1 + roles/sap_hana_install/tasks/post_install/firewall.yml | 1 + roles/sap_hana_install/tasks/post_install/hdbuserstore.yml | 1 + roles/sap_hana_install/tasks/post_install/license.yml | 1 + roles/sap_hana_install/tasks/post_install/log_mode.yml | 1 + .../tasks/post_install/recreate_tenant_database.yml | 1 + roles/sap_hana_install/tasks/post_install/update_etchosts.yml | 1 + roles/sap_hana_install/tasks/post_install/update_firewall.yml | 1 + roles/sap_hana_install/tasks/pre_install-loop-block.yml | 1 + roles/sap_hana_install/tasks/pre_install.yml | 1 + roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml | 1 + roles/sap_hana_install/tasks/pre_install/hdblcm_configfile.yml | 1 + roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml | 1 + roles/sap_hana_install/tasks/pre_install/prepare_sapcar.yml | 1 + roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml | 1 + roles/sap_hana_install/tasks/pre_install/verify_checksum.yml | 1 + roles/sap_hana_install/tests/install/hana-uninstall.yml | 1 + roles/sap_hana_install/tests/install/install-vars.yml | 1 + roles/sap_hana_install/tests/install/prepare-install-test-01.yml | 1 + roles/sap_hana_install/tests/install/prepare-install-test-02.yml | 1 + roles/sap_hana_install/tests/install/prepare-install-test-03.yml | 1 + .../tests/install/prepare-install-tests-ppc64le.yml | 1 + .../tests/install/prepare-install-tests-x86_64.yml | 1 + .../sap_hana_install/tests/install/remove-all-firewall-ports.yml | 1 + roles/sap_hana_install/tests/install/run-install-test-01.yml | 1 + roles/sap_hana_install/tests/install/run-install-test-02.yml | 1 + roles/sap_hana_install/tests/install/run-install-test-03.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-sapcar-tests.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-test-01.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-test-02.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-test-03.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-test-04.yml | 1 + roles/sap_hana_install/tests/sapcar/prepare-test-05.yml | 1 + roles/sap_hana_install/tests/sapcar/run-sapcar-test.yml | 1 + roles/sap_hana_install/tests/sapcar/sapcar-vars.yml | 1 + roles/sap_hana_install/vars/main.yml | 1 + roles/sap_hana_preconfigure/.yamllint.yml | 1 + roles/sap_hana_preconfigure/defaults/main.yml | 1 + roles/sap_hana_preconfigure/handlers/main.yml | 1 + roles/sap_hana_preconfigure/meta/argument_specs.yml | 1 + roles/sap_hana_preconfigure/meta/collection-requirements.yml | 1 + roles/sap_hana_preconfigure/meta/main.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/assert-configuration.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/configuration.yml | 1 + .../tasks/RedHat/generic/assert-2055470-loop-block.yml | 1 + .../tasks/RedHat/generic/assert-2382421-loop-block.yml | 1 + .../tasks/RedHat/generic/assert-2777782-01-loop-block.yml | 1 + .../tasks/RedHat/generic/assert-3024346-loop-block.yml | 1 + .../tasks/RedHat/generic/assert-abrt-ccpp.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/assert-abrtd.yml | 1 + .../tasks/RedHat/generic/assert-auto-numa-balancing.yml | 1 + .../tasks/RedHat/generic/assert-c-states-for-lower-latency.yml | 1 + .../tasks/RedHat/generic/assert-coredumps.yml | 1 + .../tasks/RedHat/generic/assert-cpu-governor-for-performance.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml | 1 + .../tasks/RedHat/generic/assert-firewalld.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/assert-kdump.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-ksm.yml | 1 + .../tasks/RedHat/generic/assert-selinux.yml | 1 + .../tasks/RedHat/generic/assert-services.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/assert-tuned.yml | 1 + .../RedHat/generic/configure-c-states-for-lower-latency.yml | 1 + .../RedHat/generic/configure-cpu-governor-for-performance.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml | 1 + .../tasks/RedHat/generic/configure-selinux.yml | 1 + .../tasks/RedHat/generic/configure-tuned.yml | 1 + .../tasks/RedHat/generic/disable-abrt-ccpp.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/disable-abrtd.yml | 1 + .../tasks/RedHat/generic/disable-coredumps.yml | 1 + .../tasks/RedHat/generic/disable-firewalld.yml | 1 + .../sap_hana_preconfigure/tasks/RedHat/generic/disable-kdump.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml | 1 + .../tasks/RedHat/generic/disable-services.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-thp.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml | 1 + .../tasks/RedHat/generic/turn-off-auto-numa-balancing.yml | 1 + roles/sap_hana_preconfigure/tasks/RedHat/installation.yml | 1 + roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml | 1 + roles/sap_hana_preconfigure/tasks/SLES/assert-installation.yml | 1 + roles/sap_hana_preconfigure/tasks/SLES/configuration.yml | 1 + roles/sap_hana_preconfigure/tasks/SLES/installation.yml | 1 + roles/sap_hana_preconfigure/tasks/main.yml | 1 + .../tasks/sapnote/1275776/configuration.yml | 1 + .../sap_hana_preconfigure/tasks/sapnote/1275776/installation.yml | 1 + .../tasks/sapnote/1944799/configuration.yml | 1 + .../sap_hana_preconfigure/tasks/sapnote/1944799/installation.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2292690.yml | 1 + .../tasks/sapnote/2292690/01-assert-tuned.yml | 1 + .../tasks/sapnote/2292690/01-configure-tuned.yml | 1 + .../tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml | 1 + .../tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml | 1 + .../tasks/sapnote/2292690/03-assert-thp.yml | 1 + .../tasks/sapnote/2292690/03-disable-thp.yml | 1 + .../sapnote/2292690/04-assert-c-states-for-lower-latency.yml | 1 + .../sapnote/2292690/04-configure-c-states-for-lower-latency.yml | 1 + .../tasks/sapnote/2292690/05-assert-cpu-governor.yml | 1 + .../tasks/sapnote/2292690/05-configure-cpu-governor.yml | 1 + .../tasks/sapnote/2292690/06-assert-epb.yml | 1 + .../tasks/sapnote/2292690/06-configure-epb.yml | 1 + .../tasks/sapnote/2292690/07-assert-ksm.yml | 1 + .../tasks/sapnote/2292690/07-disable-ksm.yml | 1 + .../tasks/sapnote/2292690/09-assert-etc-sudoers.yml | 1 + .../tasks/sapnote/2292690/09-check-etc-sudoers.yml | 1 + .../tasks/sapnote/2292690/10-assert-ibm-energyscale.yml | 1 + .../tasks/sapnote/2292690/10-ibm-energyscale.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 1 + .../tasks/sapnote/2578899/configuration.yml | 1 + .../sap_hana_preconfigure/tasks/sapnote/2578899/installation.yml | 1 + .../tasks/sapnote/2684254/configuration.yml | 1 + .../sap_hana_preconfigure/tasks/sapnote/2684254/installation.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml | 1 + .../tasks/sapnote/2777782/01-assert-selinux.yml | 1 + .../tasks/sapnote/2777782/01-configure-selinux.yml | 1 + .../tasks/sapnote/2777782/02-assert-tuned.yml | 1 + .../tasks/sapnote/2777782/02-configure-tuned.yml | 1 + .../tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml | 1 + .../tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml | 1 + .../tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml | 1 + .../tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml | 1 + .../tasks/sapnote/2777782/05-assert-thp.yml | 1 + .../tasks/sapnote/2777782/05-disable-thp.yml | 1 + .../sapnote/2777782/06-assert-c-states-for-lower-latency.yml | 1 + .../sapnote/2777782/06-configure-c-states-for-lower-latency.yml | 1 + .../tasks/sapnote/2777782/07-assert-cpu-governor.yml | 1 + .../tasks/sapnote/2777782/07-configure-cpu-governor.yml | 1 + .../tasks/sapnote/2777782/08-assert-epb.yml | 1 + .../tasks/sapnote/2777782/08-configure-epb.yml | 1 + .../tasks/sapnote/2777782/09-assert-ksm.yml | 1 + .../tasks/sapnote/2777782/09-disable-ksm.yml | 1 + .../tasks/sapnote/2777782/10-assert-pidmax.yml | 1 + .../tasks/sapnote/2777782/10-increase-pidmax.yml | 1 + .../tasks/sapnote/2777782/11-assert-tsx.yml | 1 + .../tasks/sapnote/2777782/11-enable-tsx.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml | 1 + .../tasks/sapnote/3108302/01-assert-selinux.yml | 1 + .../tasks/sapnote/3108302/01-configure-selinux.yml | 1 + .../tasks/sapnote/3108302/02-assert-tuned.yml | 1 + .../tasks/sapnote/3108302/02-configure-tuned.yml | 1 + .../tasks/sapnote/3108302/03-assert-abrt-coredumps-kdump.yml | 1 + .../tasks/sapnote/3108302/03-disable-abrt-coredumps-kdump.yml | 1 + .../tasks/sapnote/3108302/04-assert-auto-numa-balancing.yml | 1 + .../tasks/sapnote/3108302/04-turn-off-auto-numa-balancing.yml | 1 + .../tasks/sapnote/3108302/05-assert-thp.yml | 1 + .../tasks/sapnote/3108302/05-disable-thp.yml | 1 + .../sapnote/3108302/06-assert-c-states-for-lower-latency.yml | 1 + .../sapnote/3108302/06-configure-c-states-for-lower-latency.yml | 1 + .../tasks/sapnote/3108302/07-assert-cpu-governor.yml | 1 + .../tasks/sapnote/3108302/07-configure-cpu-governor.yml | 1 + .../tasks/sapnote/3108302/08-assert-epb.yml | 1 + .../tasks/sapnote/3108302/08-configure-epb.yml | 1 + .../tasks/sapnote/3108302/09-assert-ksm.yml | 1 + .../tasks/sapnote/3108302/09-disable-ksm.yml | 1 + .../tasks/sapnote/3108302/10-assert-pidmax.yml | 1 + .../tasks/sapnote/3108302/10-increase-pidmax.yml | 1 + .../tasks/sapnote/3108302/11-assert-tsx.yml | 1 + .../tasks/sapnote/3108302/11-enable-tsx.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2292690.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-2777782.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml | 1 + roles/sap_hana_preconfigure/tasks/sapnote/assert-3108302.yml | 1 + .../tests/sap_hana_preconfigure-default-settings.yml | 1 + roles/sap_hana_preconfigure/vars/RedHat_7.yml | 1 + roles/sap_hana_preconfigure/vars/RedHat_8.yml | 1 + roles/sap_hana_preconfigure/vars/RedHat_9.yml | 1 + roles/sap_hana_preconfigure/vars/SLES_15.yml | 1 + roles/sap_hana_preconfigure/vars/main.yml | 1 + roles/sap_hostagent/.yamllint.yml | 1 + roles/sap_hostagent/defaults/main.yml | 1 + roles/sap_hostagent/meta/main.yml | 1 + roles/sap_hostagent/tasks/common_post.yml | 1 + roles/sap_hostagent/tasks/common_pre.yml | 1 + roles/sap_hostagent/tasks/config_ssl.yml | 1 + roles/sap_hostagent/tasks/deploy_bundle.yml | 1 + roles/sap_hostagent/tasks/deploy_rpm.yml | 1 + roles/sap_hostagent/tasks/deploy_sar.yml | 1 + roles/sap_hostagent/tasks/deploy_sar_remote.yml | 1 + roles/sap_hostagent/tasks/main.yml | 1 + roles/sap_install_media_detect/.yamllint.yml | 1 + roles/sap_install_media_detect/defaults/main.yml | 1 + roles/sap_install_media_detect/meta/main.yml | 1 + .../sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml | 1 + .../tasks/cleanup/remove_sapfile_utility.yml | 1 + .../tasks/find_files_after_extraction.yml | 1 + roles/sap_install_media_detect/tasks/main.yml | 1 + roles/sap_install_media_detect/tasks/organize_files.yml | 1 + .../sap_install_media_detect/tasks/prepare/check_directories.yml | 1 + .../tasks/prepare/create_file_list_phase_1.yml | 1 + .../tasks/prepare/create_file_list_phase_2.yml | 1 + .../tasks/prepare/enable_rar_handling.yml | 1 + .../tasks/prepare/enable_zip_handling.yml | 1 + .../tasks/prepare/move_files_to_main_directory.yml | 1 + .../tasks/prepare/provide_sapfile_utility.yml | 1 + .../tasks/rename/add_exe_extension_loop_block.yml | 1 + .../sap_install_media_detect/tasks/rename/add_file_extension.yml | 1 + .../tasks/rename/add_rar_extension_loop_block.yml | 1 + .../tasks/rename/add_zip_extension_loop_block.yml | 1 + roles/sap_install_media_detect/tasks/set_global_vars.yml | 1 + roles/sap_maintain_etc_hosts/.yamllint.yml | 1 + roles/sap_maintain_etc_hosts/defaults/main.yml | 1 + roles/sap_maintain_etc_hosts/meta/argument_specs.yml | 1 + roles/sap_maintain_etc_hosts/meta/main.yml | 1 + roles/sap_maintain_etc_hosts/tasks/main.yml | 1 + roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml | 1 + roles/sap_maintain_etc_hosts/tasks/update_host_present.yml | 1 + roles/sap_maintain_etc_hosts/tests/test.yml | 1 + roles/sap_maintain_etc_hosts/vars/main.yml | 1 + roles/sap_netweaver_preconfigure/.yamllint.yml | 1 + roles/sap_netweaver_preconfigure/defaults/main.yml | 1 + roles/sap_netweaver_preconfigure/handlers/main.yml | 1 + roles/sap_netweaver_preconfigure/meta/argument_specs.yml | 1 + roles/sap_netweaver_preconfigure/meta/main.yml | 1 + .../tasks/RedHat/assert-configuration.yml | 1 + .../tasks/RedHat/assert-installation.yml | 1 + roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml | 1 + roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml | 1 + .../tasks/SLES/assert-configuration.yml | 1 + .../tasks/SLES/assert-installation.yml | 1 + roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml | 1 + roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml | 1 + roles/sap_netweaver_preconfigure/tasks/main.yml | 1 + .../tasks/sapnote/1275776/configuration.yml | 1 + .../tasks/sapnote/1275776/installation.yml | 1 + roles/sap_netweaver_preconfigure/tasks/sapnote/2526952.yml | 1 + roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml | 1 + .../sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml | 1 + .../sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml | 1 + .../tests/sap_netweaver_preconfigure-default-settings.yml | 1 + roles/sap_netweaver_preconfigure/vars/RedHat_7.yml | 1 + roles/sap_netweaver_preconfigure/vars/RedHat_8.yml | 1 + roles/sap_netweaver_preconfigure/vars/RedHat_9.yml | 1 + roles/sap_netweaver_preconfigure/vars/SLES_15.yml | 1 + roles/sap_netweaver_preconfigure/vars/main.yml | 1 + roles/sap_storage_setup/.yamllint.yml | 1 + roles/sap_storage_setup/defaults/main.yml | 1 + roles/sap_storage_setup/meta/argument_specs.yml | 1 + roles/sap_storage_setup/meta/main.yml | 1 + .../tasks/generic_tasks/configure_local_filesystems.yml | 1 + .../tasks/generic_tasks/configure_multipathing.yml | 1 + .../tasks/generic_tasks/configure_nfs_filesystems.yml | 1 + roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml | 1 + .../tasks/generic_tasks/map_single_disks_to_filesystems.yml | 1 + roles/sap_storage_setup/tasks/generic_tasks/remove_storage.yml | 1 + roles/sap_storage_setup/tasks/main.yml | 1 + roles/sap_storage_setup/tasks/platform_tasks/aws_main.yml | 1 + roles/sap_storage_setup/tasks/platform_tasks/az_main.yml | 1 + .../tasks/platform_tasks/prepare_storage_az.yml | 1 + .../sap_storage_setup/tasks/platform_tasks/remove_storage_az.yml | 1 + roles/sap_storage_setup/vars/RedHat.yml | 1 + roles/sap_storage_setup/vars/Suse.yml | 1 + roles/sap_swpm/.yamllint.yml | 1 + roles/sap_swpm/defaults/main.yml | 1 + roles/sap_swpm/meta/collection-requirements.yml | 1 + roles/sap_swpm/meta/main.yml | 1 + roles/sap_swpm/requirements.yml | 1 + roles/sap_swpm/tasks/main.yml | 1 + roles/sap_swpm/tasks/post_install.yml | 1 + roles/sap_swpm/tasks/post_install/firewall.yml | 1 + roles/sap_swpm/tasks/post_install/update_firewall.yml | 1 + roles/sap_swpm/tasks/pre_install.yml | 1 + roles/sap_swpm/tasks/pre_install/create_os_user.yml | 1 + roles/sap_swpm/tasks/pre_install/firewall.yml | 1 + roles/sap_swpm/tasks/pre_install/install_type.yml | 1 + .../sap_swpm/tasks/pre_install/install_type/general_install.yml | 1 + roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml | 1 + .../pre_install/install_type/ha_maint_plan_stack_install.yml | 1 + .../tasks/pre_install/install_type/maint_plan_stack_install.yml | 1 + .../sap_swpm/tasks/pre_install/install_type/restore_install.yml | 1 + roles/sap_swpm/tasks/pre_install/password_facts.yml | 1 + roles/sap_swpm/tasks/pre_install/update_etchosts.yml | 1 + roles/sap_swpm/tasks/pre_install/update_firewall.yml | 1 + roles/sap_swpm/tasks/swpm.yml | 1 + roles/sap_swpm/tasks/swpm/detect_variables.yml | 1 + roles/sap_swpm/tasks/swpm/prepare_software.yml | 1 + roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml | 1 + .../tasks/swpm/swpm_inifile_generate_advanced_templates.yml | 1 + roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml | 1 + .../tasks/swpm/swpm_inifile_generate_default_templates.yml | 1 + .../sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml | 1 + roles/sap_swpm/tasks/swpm/swpm_pre_install.yml | 1 + 522 files changed, 522 insertions(+) diff --git a/galaxy.yml b/galaxy.yml index 4a9423b09..e7b12a847 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ### REQUIRED diff --git a/playbooks/sample-sap-ha-deployment-hana-2-node-cluster.yml b/playbooks/sample-sap-ha-deployment-hana-2-node-cluster.yml index 46d6166a6..119bbd815 100644 --- a/playbooks/sample-sap-ha-deployment-hana-2-node-cluster.yml +++ b/playbooks/sample-sap-ha-deployment-hana-2-node-cluster.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # This playbook will # - prepare and install SAP HANA on 2 target nodes diff --git a/playbooks/sample-sap-hana-install.yml b/playbooks/sample-sap-hana-install.yml index f9489ac62..d0e5c2688 100644 --- a/playbooks/sample-sap-hana-install.yml +++ b/playbooks/sample-sap-hana-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Ansible Play for executing SAP HANA installation to all hosts in Ansible Inventory hosts: all diff --git a/playbooks/sample-sap-hana-preconfigure.yml b/playbooks/sample-sap-hana-preconfigure.yml index fd420d241..46e806ecc 100644 --- a/playbooks/sample-sap-hana-preconfigure.yml +++ b/playbooks/sample-sap-hana-preconfigure.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Ansible Play for executing preconfiguration activities for SAP HANA to all hosts in Ansible Inventory hosts: all diff --git a/playbooks/sample-sap-nwas-ascs-ers-2-node-cluster.yml b/playbooks/sample-sap-nwas-ascs-ers-2-node-cluster.yml index 0a2d80c35..337a96aa8 100644 --- a/playbooks/sample-sap-nwas-ascs-ers-2-node-cluster.yml +++ b/playbooks/sample-sap-nwas-ascs-ers-2-node-cluster.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # This playbook will # - install and configure a basic pacemaker cluster diff --git a/playbooks/sample-sap-storage-prep.yml b/playbooks/sample-sap-storage-prep.yml index ace34cc91..6a8cac0a6 100644 --- a/playbooks/sample-sap-storage-prep.yml +++ b/playbooks/sample-sap-storage-prep.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Experimental Ansible Role, do not suggest using this diff --git a/playbooks/sample-sap-swpm-advanced-mode.yml b/playbooks/sample-sap-swpm-advanced-mode.yml index 819b5ff47..dfe1fc32e 100644 --- a/playbooks/sample-sap-swpm-advanced-mode.yml +++ b/playbooks/sample-sap-swpm-advanced-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible in "Advanced Mode" diff --git a/playbooks/sample-sap-swpm-advanced-templates-mode.yml b/playbooks/sample-sap-swpm-advanced-templates-mode.yml index 508660a64..94a58856f 100644 --- a/playbooks/sample-sap-swpm-advanced-templates-mode.yml +++ b/playbooks/sample-sap-swpm-advanced-templates-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible in "Advanced Templates Mode" diff --git a/playbooks/sample-sap-swpm-all-modes-interactive.yml b/playbooks/sample-sap-swpm-all-modes-interactive.yml index 5b55ef7b0..0e643c90f 100644 --- a/playbooks/sample-sap-swpm-all-modes-interactive.yml +++ b/playbooks/sample-sap-swpm-all-modes-interactive.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible Role with interactive selection of mode (Inifile Reuse, Default, Advanced, Default Templates, Advanced Templates) diff --git a/playbooks/sample-sap-swpm-default-mode.yml b/playbooks/sample-sap-swpm-default-mode.yml index 0d8eab07b..08059c3c7 100644 --- a/playbooks/sample-sap-swpm-default-mode.yml +++ b/playbooks/sample-sap-swpm-default-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible in "Default Mode" diff --git a/playbooks/sample-sap-swpm-default-templates-mode.yml b/playbooks/sample-sap-swpm-default-templates-mode.yml index 1ed58153e..0d148e28b 100644 --- a/playbooks/sample-sap-swpm-default-templates-mode.yml +++ b/playbooks/sample-sap-swpm-default-templates-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible in "Default Templates Mode" diff --git a/playbooks/sample-sap-swpm-inifile-reuse-mode.yml b/playbooks/sample-sap-swpm-inifile-reuse-mode.yml index b7ff6938d..babd446c3 100644 --- a/playbooks/sample-sap-swpm-inifile-reuse-mode.yml +++ b/playbooks/sample-sap-swpm-inifile-reuse-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible Playbook for executing sap_swpm Ansible in "Inifile Reuse Mode" diff --git a/playbooks/sample-storage_sap_s4hana_distributed.yml b/playbooks/sample-storage_sap_s4hana_distributed.yml index 510d0b1a7..6e5b65d7a 100644 --- a/playbooks/sample-storage_sap_s4hana_distributed.yml +++ b/playbooks/sample-storage_sap_s4hana_distributed.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Complete Infrastructure setup diff --git a/playbooks/vars/sample-variables-sap-hana-install.yml b/playbooks/vars/sample-variables-sap-hana-install.yml index 7a0e73a72..f45c283ab 100644 --- a/playbooks/vars/sample-variables-sap-hana-install.yml +++ b/playbooks/vars/sample-variables-sap-hana-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # ----------------------------- Mandatory parameters ----------------------------- # diff --git a/playbooks/vars/sample-variables-sap-storage-lvm-stripes.yml b/playbooks/vars/sample-variables-sap-storage-lvm-stripes.yml index 8c736a99c..de52063a4 100644 --- a/playbooks/vars/sample-variables-sap-storage-lvm-stripes.yml +++ b/playbooks/vars/sample-variables-sap-storage-lvm-stripes.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_storage_dict: diff --git a/playbooks/vars/sample-variables-sap-storage-lvm.yml b/playbooks/vars/sample-variables-sap-storage-lvm.yml index f92fa8fe5..b32a29c83 100644 --- a/playbooks/vars/sample-variables-sap-storage-lvm.yml +++ b/playbooks/vars/sample-variables-sap-storage-lvm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_storage_dict: diff --git a/playbooks/vars/sample-variables-sap-swpm-advanced-mode-s4hana-onehost-install.yml b/playbooks/vars/sample-variables-sap-swpm-advanced-mode-s4hana-onehost-install.yml index 966068b08..228fbd181 100644 --- a/playbooks/vars/sample-variables-sap-swpm-advanced-mode-s4hana-onehost-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-advanced-mode-s4hana-onehost-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-advanced-templates-mode.yml b/playbooks/vars/sample-variables-sap-swpm-advanced-templates-mode.yml index fab324279..47f736957 100644 --- a/playbooks/vars/sample-variables-sap-swpm-advanced-templates-mode.yml +++ b/playbooks/vars/sample-variables-sap-swpm-advanced-templates-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-bw4hana-onehost-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-bw4hana-onehost-install.yml index 3a79a2a28..6c17903b3 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-bw4hana-onehost-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-bw4hana-onehost-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml index bceb19ee4..50d1e3cf1 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-aas-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ascs-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ascs-install.yml index a39c9c1aa..7282fece0 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ascs-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ascs-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-dbload-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-dbload-install.yml index 08d27d15f..cf772e476 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-dbload-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-dbload-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ers-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ers-install.yml index 3a053ff2a..edf8df111 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ers-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-ers-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-pas-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-pas-install.yml index 49379bf5e..340e28a2a 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-pas-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-distributed-pas-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-install.yml index d8e5cdf73..35272908e 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-restore.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-restore.yml index 1ec025002..28e77069d 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-restore.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-s4hana-onehost-restore.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-abap-onehost-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-abap-onehost-install.yml index b2ab307e3..f565cca12 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-abap-onehost-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-abap-onehost-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-java-onehost-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-java-onehost-install.yml index 5447ba3bc..5fa25924c 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-java-onehost-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-solman-hana-java-onehost-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-system-rename.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-system-rename.yml index b9dd62a3b..bf3e17a8e 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-system-rename.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-system-rename.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Product ID for System Rename diff --git a/playbooks/vars/sample-variables-sap-swpm-default-mode-webdisp-standalone-install.yml b/playbooks/vars/sample-variables-sap-swpm-default-mode-webdisp-standalone-install.yml index 346d4aabf..a6d92419b 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-mode-webdisp-standalone-install.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-mode-webdisp-standalone-install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/playbooks/vars/sample-variables-sap-swpm-default-templates-mode.yml b/playbooks/vars/sample-variables-sap-swpm-default-templates-mode.yml index bfeafde97..6d8dbc861 100644 --- a/playbooks/vars/sample-variables-sap-swpm-default-templates-mode.yml +++ b/playbooks/vars/sample-variables-sap-swpm-default-templates-mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect SAP HANA and SAP NetWeaver software diff --git a/roles/sap_anydb_install_oracle/.yamllint.yml b/roles/sap_anydb_install_oracle/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_anydb_install_oracle/.yamllint.yml +++ b/roles/sap_anydb_install_oracle/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_anydb_install_oracle/defaults/main.yml b/roles/sap_anydb_install_oracle/defaults/main.yml index 5090a8267..5fb993aae 100644 --- a/roles/sap_anydb_install_oracle/defaults/main.yml +++ b/roles/sap_anydb_install_oracle/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_anydb_install_oracle_prep_reboot_ok: yes diff --git a/roles/sap_anydb_install_oracle/handlers/main.yml b/roles/sap_anydb_install_oracle/handlers/main.yml index 873560edd..c7bf83b9f 100644 --- a/roles/sap_anydb_install_oracle/handlers/main.yml +++ b/roles/sap_anydb_install_oracle/handlers/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # handlers file for sap_anydb_install_oracle diff --git a/roles/sap_anydb_install_oracle/meta/main.yml b/roles/sap_anydb_install_oracle/meta/main.yml index 447bb830f..65a9563d7 100644 --- a/roles/sap_anydb_install_oracle/meta/main.yml +++ b/roles/sap_anydb_install_oracle/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_anydb_install_oracle/tasks/main.yml b/roles/sap_anydb_install_oracle/tasks/main.yml index d591fb8dc..a1512675c 100644 --- a/roles/sap_anydb_install_oracle/tasks/main.yml +++ b/roles/sap_anydb_install_oracle/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Oracle DB - Pre-installation diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml index 089f0c957..29352356b 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Oracle DB Patch - Copy the SBP diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml index b5cabd5b1..97caa405f 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # See further: diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml index 0b22b773b..36a2fb9a1 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Linux User 'oracle' uses C Shell, use setvar diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_responsefile.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_responsefile.yml index a43f94514..3cf85e2ce 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_responsefile.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_responsefile.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Oracle DB - Process Oracle Response File jina template and create file {{ sap_anydb_install_oracle_base }}/dvd/19.0.0/generated_db_install.rsp diff --git a/roles/sap_general_preconfigure/.yamllint.yml b/roles/sap_general_preconfigure/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_general_preconfigure/.yamllint.yml +++ b/roles/sap_general_preconfigure/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_general_preconfigure/defaults/main.yml b/roles/sap_general_preconfigure/defaults/main.yml index c7f353c3a..6824bcd15 100644 --- a/roles/sap_general_preconfigure/defaults/main.yml +++ b/roles/sap_general_preconfigure/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # BEGIN: Default Variables for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml index 533d3f49a..ae9345bf0 100644 --- a/roles/sap_general_preconfigure/handlers/main.yml +++ b/roles/sap_general_preconfigure/handlers/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # handlers file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/meta/argument_specs.yml b/roles/sap_general_preconfigure/meta/argument_specs.yml index 6ee5fa23d..aaf3cf4a1 100644 --- a/roles/sap_general_preconfigure/meta/argument_specs.yml +++ b/roles/sap_general_preconfigure/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_general_preconfigure/meta/collection-requirements.yml b/roles/sap_general_preconfigure/meta/collection-requirements.yml index 0a4e50f46..a1227178d 100644 --- a/roles/sap_general_preconfigure/meta/collection-requirements.yml +++ b/roles/sap_general_preconfigure/meta/collection-requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: diff --git a/roles/sap_general_preconfigure/meta/main.yml b/roles/sap_general_preconfigure/meta/main.yml index d7342621f..f117d3a1e 100644 --- a/roles/sap_general_preconfigure/meta/main.yml +++ b/roles/sap_general_preconfigure/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_general_preconfigure/tasks/RedHat/assert-configuration.yml b/roles/sap_general_preconfigure/tasks/RedHat/assert-configuration.yml index 1116afc6b..ff021f3a7 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/assert-configuration.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - List required SAP Notes diff --git a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml index a08b3e47a..135c2ccd4 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check enabled repos diff --git a/roles/sap_general_preconfigure/tasks/RedHat/configuration.yml b/roles/sap_general_preconfigure/tasks/RedHat/configuration.yml index 108af000f..3d5f80448 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/configuration.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - List required SAP Notes diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml index d0815faba..091a538d1 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that the DNS domain is set diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml index 93e602ead..282226b8b 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-etc-hosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display host and domain name, and IP address diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml index 5fc5cbd3d..4b0a0de8d 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Note: firewalld is not contained in ansible_facts.services. diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml index 38e843517..83ff80aa2 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check if hostname is set diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml index c87db29b0..a5d2fa4b5 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # loop block for sapnote/RedHat/generic/assert-kernel-parameters.yml diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters.yml index a6d2f49b0..72f59f782 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get info about file {{ sap_general_preconfigure_etc_sysctl_sap_conf }} diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-limits-conf-file.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-limits-conf-file.yml index 612edc4ce..309a66b0a 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-limits-conf-file.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-limits-conf-file.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get info about file /etc/security/limits.d/99-sap.conf diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml index 6d549b96d..ef40e8843 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nofile-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check if the hard limit of nofile for group sapsys is 1048576 diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml index 0a24bcd15..db05b0f1d 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-nproc-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check if the hard limit of nproc for group sapsys is unlimited diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml index bf9cf759a..36e1c0c7d 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get info about file '/etc/selinux/config' diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-systemd-tmpfiles.yml index 4c0b69601..f35531033 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get info about file /etc/tmpfiles.d/sap.conf diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml index 81e5e175c..290c9814c 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check the size of tmpfs diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml index cd78d9b42..51e462356 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that uuidd.service exists diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index 562f8d16c..79e1af8de 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Check dns forwarding settings diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml index 1c333e1bd..1b517f915 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-etc-hosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Display host and domain name, and IP address before the modification diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml index fc6cda109..643b39689 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Stop and disable service firewalld diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-hostname.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-hostname.yml index 3bb041928..23e68e64d 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The hostname module fails if it is run from an initrc_t context diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index 192d90042..a1d75dfd0 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Set kernel parameters diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml index 81592887c..d39c1883e 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Set SELinux state to '{{ sap_general_preconfigure_selinux_state }}' in /etc/selinux/config diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml index 3c81e526f..750d1e962 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Copy file /etc/tmpfiles.d/sap.conf, RHEL 7 or 8 diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml index ebda944a4..1f7197b13 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure tmpfs in /etc/fstab diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml index 16e3dbc0d..4e3e6cf70 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Enable and start service uuidd diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml index 43788f3e5..cdf2926f2 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reasons for noqa: 1. Tabs can increase readability; diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml index 81537d6ce..f34a85627 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reasons for noqa: 1. Tabs can increase readability; diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 79fd9eeec..1fa7b2afb 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Perform steps for enabling required repos diff --git a/roles/sap_general_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_general_preconfigure/tasks/SLES/assert-configuration.yml index dc12b02a3..d4e8b9341 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - List required SAP Notes diff --git a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml index 4b5e489e2..ecf4468e5 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that all required packages are installed diff --git a/roles/sap_general_preconfigure/tasks/SLES/configuration.yml b/roles/sap_general_preconfigure/tasks/SLES/configuration.yml index 8537434db..cde628b48 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - List required SAP Notes diff --git a/roles/sap_general_preconfigure/tasks/SLES/installation.yml b/roles/sap_general_preconfigure/tasks/SLES/installation.yml index 5f78c2e5d..2903064ae 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Ensure that the required packages are installed diff --git a/roles/sap_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index d9474cf63..5682a761f 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Display the role path diff --git a/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml b/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml index 94f6cb0e4..07a716c03 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Configure tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/1391070.yml b/roles/sap_general_preconfigure/tasks/sapnote/1391070.yml index 4d040f23e..6a38bcce2 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/1391070.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/1391070.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Linux-UUID-solutions diff --git a/roles/sap_general_preconfigure/tasks/sapnote/1771258.yml b/roles/sap_general_preconfigure/tasks/sapnote/1771258.yml index d392e9b9a..e09e6d758 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/1771258.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/1771258.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Set nofile diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167.yml index b067cfc15..57688d312 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 2002167 and its version diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-assert-configuration-changes.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-assert-configuration-changes.yml index 2c75cd689..deadda0ac 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-assert-configuration-changes.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-assert-configuration-changes.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2002167-2a diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-configuration-changes.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-configuration-changes.yml index ce5876fbe..88ac5b2cf 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-configuration-changes.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/02-configuration-changes.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2002167-2a diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-assert-setting-the-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-assert-setting-the-hostname.yml index 243080ea0..80ee9a327 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-assert-setting-the-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-assert-setting-the-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2002167-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml index 67d3659f8..610ad2dda 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2002167-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-assert-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-assert-linux-kernel-parameters.yml index ce765cb33..409dff69d 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-assert-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-assert-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2002167-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-linux-kernel-parameters.yml index e02ad0179..0993f7cc8 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/04-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2002167-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-assert-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-assert-process-resource-limits.yml index 0771eec83..f0e386856 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-assert-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-assert-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2002167-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-process-resource-limits.yml index 069b2dac7..f2f6d98e6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/05-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2002167-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-additional-notes-for-installing-sap-systems.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-additional-notes-for-installing-sap-systems.yml index 514748cfe..91e333368 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-additional-notes-for-installing-sap-systems.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-additional-notes-for-installing-sap-systems.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2002167-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-assert-additional-notes-for-installing-sap-systems.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-assert-additional-notes-for-installing-sap-systems.yml index afb8d04e4..295070eb8 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-assert-additional-notes-for-installing-sap-systems.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/06-assert-additional-notes-for-installing-sap-systems.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2002167-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999.yml index 45f614357..12907e391 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 2772999 and its version diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-assert-selinux.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-assert-selinux.yml index e0802a6e1..003d1925d 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-assert-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-2 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-configure-selinux.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-configure-selinux.yml index 5cf270376..f268b1465 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-configure-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/02-configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-2 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-assert-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-assert-hostname.yml index 723f623b7..e8df9f661 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-assert-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-assert-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml index 111821324..ecf8866b3 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml index 611771f0a..b23b7ca93 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-assert-network-time-and-date.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml index f2ed23418..e796f0e47 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/04-configure-network-time-and-date.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-assert-firewall.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-assert-firewall.yml index 9f8caf2ef..bc8bcb2ad 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-assert-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-assert-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-configure-firewall.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-configure-firewall.yml index 0fbc7d4d2..ad87f56e2 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-configure-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/05-configure-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-assert-uuidd.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-assert-uuidd.yml index 2d7512237..8c0d77080 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-assert-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-assert-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-configure-uuidd.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-configure-uuidd.yml index ba37631ed..b0006b96b 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-configure-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/06-configure-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml index d6159ecaf..591f2ee62 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-7 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml index b6de1449f..fb1df10fa 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-7 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-assert-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-assert-linux-kernel-parameters.yml index 30384384e..0127891c5 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-assert-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-assert-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-8 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml index 5f2c0be03..c7a62607b 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/08-configure-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-8 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-assert-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-assert-process-resource-limits.yml index c50358cd0..c5c30579f 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-assert-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-assert-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-9 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-configure-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-configure-process-resource-limits.yml index ac4dc7692..6c57c33e2 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-configure-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/09-configure-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-9 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-assert-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-assert-systemd-tmpfiles.yml index a067c5654..5543e8305 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-assert-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-assert-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2772999-10 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-configure-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-configure-systemd-tmpfiles.yml index b5fe023fa..a0299bdc4 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-configure-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/10-configure-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2772999-10 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316.yml index 18e94b534..54595601f 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 3108316 and its version diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-assert-selinux.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-assert-selinux.yml index 4bbb28495..7782afee4 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-assert-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-2 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-configure-selinux.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-configure-selinux.yml index da03345e5..8bf1b2342 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-configure-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/02-configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-2 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-assert-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-assert-hostname.yml index 21a437d8f..b83b7a146 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-assert-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-assert-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml index 891888978..0b2e96d04 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-3 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml index d773c14c2..4113c99ea 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-assert-network-time-and-date.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml index c175f1573..7bfb16d8b 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/04-configure-network-time-and-date.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-4 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-assert-firewall.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-assert-firewall.yml index 097978f1a..74dd36c79 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-assert-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-assert-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-configure-firewall.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-configure-firewall.yml index a97c67a9c..e69ab95d5 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-configure-firewall.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/05-configure-firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-5 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-assert-uuidd.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-assert-uuidd.yml index e5271b176..e1fb78b88 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-assert-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-assert-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-configure-uuidd.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-configure-uuidd.yml index b805561d0..30be6c160 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-configure-uuidd.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/06-configure-uuidd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-6 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml index 4b8fca006..f64c621f6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-7 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml index f07c4081c..44f130211 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-7 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-assert-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-assert-linux-kernel-parameters.yml index 46be59030..7160b861e 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-assert-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-assert-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-8 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-configure-linux-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-configure-linux-kernel-parameters.yml index 42a4b2415..b07996fc6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-configure-linux-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/08-configure-linux-kernel-parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-8 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-assert-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-assert-process-resource-limits.yml index 75f60ddb7..2f31d63de 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-assert-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-assert-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-9 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-configure-process-resource-limits.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-configure-process-resource-limits.yml index 0a57b7009..5512d2ac5 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-configure-process-resource-limits.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/09-configure-process-resource-limits.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-9 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-assert-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-assert-systemd-tmpfiles.yml index 5371d376a..4a56c51e7 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-assert-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-assert-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108316-10 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-configure-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-configure-systemd-tmpfiles.yml index 3fa4076a3..41de6a789 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-configure-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/10-configure-systemd-tmpfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108316-10 diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml index 895d68a87..8c8a501a9 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Configure tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-1391070.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-1391070.yml index f055f862c..217c1dfa1 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-1391070.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-1391070.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Linux-UUID-solutions diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-1771258.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-1771258.yml index 0a6a2be54..f0ed30947 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-1771258.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-1771258.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Configure tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2002167.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2002167.yml index 12040584c..06db42faa 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-2002167.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2002167.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 2002167 and its version diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-2772999.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-2772999.yml index 504404264..9034b2758 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-2772999.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-2772999.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 2772999 and its version diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-3108316.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-3108316.yml index b80204cd2..951ea6e69 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-3108316.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-3108316.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 3108316 and its version diff --git a/roles/sap_general_preconfigure/tests/sap_general_preconfigure-default-settings.yml b/roles/sap_general_preconfigure/tests/sap_general_preconfigure-default-settings.yml index a3c320b23..4802f0f19 100644 --- a/roles/sap_general_preconfigure/tests/sap_general_preconfigure-default-settings.yml +++ b/roles/sap_general_preconfigure/tests/sap_general_preconfigure-default-settings.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - hosts: all collections: diff --git a/roles/sap_general_preconfigure/vars/RedHat_7.yml b/roles/sap_general_preconfigure/vars/RedHat_7.yml index 429c2ff39..76f8dc464 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_7.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml index b04e188b8..0f952dcd1 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml index a665d8d78..3ffd289a8 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml index 61453a3b8..e47d88065 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.yml b/roles/sap_general_preconfigure/vars/RedHat_8.yml index 416cef098..aa05e96dd 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/RedHat_9.yml b/roles/sap_general_preconfigure/vars/RedHat_9.yml index ca0d473b7..9f22fefe0 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_9.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_general_preconfigure diff --git a/roles/sap_general_preconfigure/vars/SLES_15.yml b/roles/sap_general_preconfigure/vars/SLES_15.yml index cc3c2793b..b6b7f7bf0 100644 --- a/roles/sap_general_preconfigure/vars/SLES_15.yml +++ b/roles/sap_general_preconfigure/vars/SLES_15.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- __sap_general_preconfigure_sapnotes_versions: - '' diff --git a/roles/sap_general_preconfigure/vars/main.yml b/roles/sap_general_preconfigure/vars/main.yml index f3d4ba772..b0c25a8ec 100644 --- a/roles/sap_general_preconfigure/vars/main.yml +++ b/roles/sap_general_preconfigure/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # dummy entries for passing the arg spec validation: diff --git a/roles/sap_ha_install_hana_hsr/.yamllint.yml b/roles/sap_ha_install_hana_hsr/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_ha_install_hana_hsr/.yamllint.yml +++ b/roles/sap_ha_install_hana_hsr/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_ha_install_hana_hsr/defaults/main.yml b/roles/sap_ha_install_hana_hsr/defaults/main.yml index 5aed4c99f..b3ec79c56 100644 --- a/roles/sap_ha_install_hana_hsr/defaults/main.yml +++ b/roles/sap_ha_install_hana_hsr/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_ha_install_hana_hsr_sid: "{{ sap_hana_sid }}" sap_ha_install_hana_hsr_instance_number: "{{ sap_hana_instance_number }}" diff --git a/roles/sap_ha_install_hana_hsr/meta/main.yml b/roles/sap_ha_install_hana_hsr/meta/main.yml index 9a9a62cd8..673ea0a02 100644 --- a/roles/sap_ha_install_hana_hsr/meta/main.yml +++ b/roles/sap_ha_install_hana_hsr/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml b/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml index 04c108471..958ae00ba 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HSR - Check System Replication Status" ansible.builtin.shell: | diff --git a/roles/sap_ha_install_hana_hsr/tasks/hdbuserstore.yml b/roles/sap_ha_install_hana_hsr/tasks/hdbuserstore.yml index 290a8689c..8e004df44 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/hdbuserstore.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/hdbuserstore.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # ansible-lint: # become_user string is deduced from a variable + suffix with no spaces diff --git a/roles/sap_ha_install_hana_hsr/tasks/log_mode.yml b/roles/sap_ha_install_hana_hsr/tasks/log_mode.yml index 952abfa69..e05b8c034 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/log_mode.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/log_mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HSR - check log_mode" tags: hsr_logmode diff --git a/roles/sap_ha_install_hana_hsr/tasks/main.yml b/roles/sap_ha_install_hana_hsr/tasks/main.yml index 8af8c44ea..15f3ec5a9 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/main.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # CHECK: we need to define variables, when the Hana Replication interface != ansible_hostname diff --git a/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml b/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml index f93be1c3c..b0bbbd080 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Secondary nodes fetch PKI files from the primary node. # Setting up temporary direct connection if not yet present diff --git a/roles/sap_ha_install_hana_hsr/tasks/run_backup.yml b/roles/sap_ha_install_hana_hsr/tasks/run_backup.yml index 049c40d80..425608716 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/run_backup.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/run_backup.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HSR - Run backup for SYSTEMDB" ansible.builtin.shell: | diff --git a/roles/sap_ha_install_hana_hsr/tasks/update_etchosts.yml b/roles/sap_ha_install_hana_hsr/tasks/update_etchosts.yml index bad7b39da..d20e44dd7 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/update_etchosts.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/update_etchosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HSR - Check /etc/hosts for conflicting entries" ansible.builtin.shell: | diff --git a/roles/sap_ha_pacemaker_cluster/.yamllint.yml b/roles/sap_ha_pacemaker_cluster/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_ha_pacemaker_cluster/.yamllint.yml +++ b/roles/sap_ha_pacemaker_cluster/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index a6ddb9cc9..471f89155 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ################################################################################ # Role generic parameters diff --git a/roles/sap_ha_pacemaker_cluster/handlers/main.yml b/roles/sap_ha_pacemaker_cluster/handlers/main.yml index 7abbf7fc0..22db7dda0 100644 --- a/roles/sap_ha_pacemaker_cluster/handlers/main.yml +++ b/roles/sap_ha_pacemaker_cluster/handlers/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "Reload systemd daemon" ansible.builtin.systemd_service: diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 88883f8a1..db39493f8 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_ha_pacemaker_cluster/meta/collection-requirements.yml b/roles/sap_ha_pacemaker_cluster/meta/collection-requirements.yml index 0a4e50f46..a1227178d 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/collection-requirements.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/collection-requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: diff --git a/roles/sap_ha_pacemaker_cluster/meta/main.yml b/roles/sap_ha_pacemaker_cluster/meta/main.yml index 4ee8090fa..153be12f9 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/main.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml index fc15cb42b..1ec71cf64 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Starting SAPHana clone immediately after cluster configuration can lead to # HANA shutdown. Following steps will leave enough time for resource agents diff --git a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/pre_steps_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/pre_steps_hana.yml index c912295a5..f4b0dd297 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/pre_steps_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/pre_steps_hana.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Identify if SAPHanaSR-angi package is available for installation. # SAPHanaSR-angi replaces SAPHanaSR and SAPHanaSR-ScaleOut. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml index 9b04b12ec..0efb5b50e 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Starting SAPHana clone immediately after cluster configuration can lead to HANA shutdown. # Following steps will leave enough time for resource agents to load HANA configuration diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml index 1ef42ec61..cf78e8a84 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Recent crmsh changes have added default behavior, where all default metadata # op parameters are added and it cannot be controlled. Not adding them during diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml index 4a1697668..a55ca1afa 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Identify if SAPHanaSR-angi package is available for installation. # SAPHanaSR-angi replaces SAPHanaSR and SAPHanaSR-ScaleOut. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml b/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml index b6bdaaa58..eec0d36c5 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The following tasks will check which SAP landscape can be configured with # the provided parameters. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml index de55f3943..24e25f586 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # After NetWeaver ASCS/ERS instances were configured in the cluster, # they must be disabled from automatically (re)starting outside of diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml index fdc4610b3..94a4f86fa 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HA Pacemaker srHook - Check presence of global.ini" ansible.builtin.stat: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml index 2fc57e61e..2367aee08 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # After all of the previous construction flows, the final parameters must # be translated to 'ha_cluster' Linux System Role syntax. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index 0361368ec..3c5455e1c 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Combine input parameters with inherited vars from the 'ha_cluster' role. # The inherited values take precedence. Some parameters are not required to be set. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_common.yml index f83af514a..41893dbc6 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_common.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleout.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleout.yml index 03df61fb8..f72bcae17 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleout.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleout.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into an included role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml index 3a004d36b..2cfd1fab5 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HA Prepare Pacemaker - Add resource: SAP HANA Topology" ansible.builtin.set_fact: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml index c3dd1c54d..479475806 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HA Prepare Pacemaker - Add resource: SAP HANA Topology" ansible.builtin.set_fact: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml index a1fb86bf1..e3b235b35 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml index 6e3bc2803..67d2ad991 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml index 6a8441df6..a3eb6d998 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_pas_aas.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_pas_aas.yml index 17be8c306..45284a055 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_pas_aas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_pas_aas.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 5d624d549..f26b6fb14 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml index 42867c02c..f5fd0b540 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables containing variables must be constructed with values # to be fed into the included ha_cluster role diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index e3311324d..a525ced88 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The following variables are constructed here in order to be provided as # input for the included 'ha_cluster' system role. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml index 2e1b18977..bf3fd7a7a 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Included in: tasks/main.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml index 18c634f19..d8be1d4b7 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Currently this is only used for HANA scenarios. - name: "SAP HA Prepare Pacemaker - Group the related VIP and healthcheck resources together" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml index b274fbda9..eb3867790 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_resources_default.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. # Included in: tasks/include_construct_vip_resources.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml index ad449ce7b..f0905e1a6 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # If there are "ha_cluster" Linux System Role parameters already defined in the # inventory, we will include these custom specifications and they take precedence. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml index 617429931..43176a186 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # For the sake of readability and maintainability, suppress cosmetical ansible-lint warnings. - name: "SAP HA Prepare Pacemaker - Make a list of potential VIP definitions" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml index f132a6738..38b7e3aea 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_common.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Gather specific subsets of facts if the required facts are not yet available. - name: "SAP HA Prepare Pacemaker - Collect required facts" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml index 6c7f8c906..446e2c981 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect presence of SAPHanaSR-angi package before loading HANA variables # Detection of package availability was chosen instead of OS version check. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml index 7ffa92e8b..388ef55d9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HA Prepare Pacemaker - Include NETWEAVER landscape specific variables ansible.builtin.include_vars: "{{ role_path }}/vars/{{ include_item }}.yml" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/main.yml b/roles/sap_ha_pacemaker_cluster/tasks/main.yml index 4b2119e92..673225be8 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/main.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # 1. Role arguments are validated through meta/arguments_spec.yml (ansible >= 2.11) # 2. Detect SAP solution to be configured (scale-up, scale-out, etc.) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml index 95196df6f..4ebd242bd 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/ascertain_platform_type.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Platform detection for cloud and other infrastructure platforms. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_aws_ec2_vs.yml index 25cf812c5..fb2c5e918 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_aws_ec2_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. # Included in: tasks/include_construct_vip_resources.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml index 0e5cb6a16..8ef851629 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. # Included in: tasks/include_construct_vip_resources.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_powervs.yml index b8a2abac2..6a76ad02b 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_powervs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml index 57137edbc..3ddec3b6f 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. # Included in: tasks/include_construct_vip_resources.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_msazure_vm.yml index 255a2b420..e29e04ef3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_msazure_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. # Included in: tasks/include_construct_vip_resources.yml diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_hyp_ibmpower_vm.yml index b2ebfb1a7..ab5c57ab8 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_hyp_ibmpower_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reminder: This file is included in a loop over a dictionary. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml index 0a7199bc3..79f1e5592 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/include_vars_platform.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Include vars files based on the environment. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml index 87c181d5d..c4f90bce1 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requirement to enable the fencing resource to function. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index 76e4dfc12..d148454b7 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "SAP HA Install Pacemaker - GCP CE VM - Install haproxy" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_powervs.yml index 33c4f2d5a..96bf786f6 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_powervs.yml @@ -1,2 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requirement to enable the fencing resource to function. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml index 2547a28e9..e9603fe6f 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requirement to enable the fencing resource to function. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_msazure_vm.yml index 94d09abb3..e13eee0a3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_msazure_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requirement to enable the fencing resource to function. # diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml index 2445e4c2d..f53320b67 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible facts rely on SMBIOS/DMI, which does not exist on ppc64le CPU Architecture. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_vs.yml index 298804b72..1828d7e55 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # There is no ansible fact with the fully qualified VM instance ID. # We get this information from the SMBIOS/DMI. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_hyp_ibmpower_vm.yml index f703571ec..eac6a8ad7 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_hyp_ibmpower_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible facts rely on SMBIOS/DMI, which does not exist on ppc64le CPU Architecture. # Use Open Firmware (OF) device tree values diff --git a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml index 43702c91d..f1090d416 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The SAP ID must follow a strict format and not use reserved special values - name: "SAP HA Prepare Pacemaker - (SAP HANA) Validate SAP System ID" diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml index dce1d0639..1002e9f61 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP HANA Scale-Out specific parameter values # diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml index 7d05279fb..dcc1539a1 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP HANA Scale-Up specific parameter values # diff --git a/roles/sap_ha_pacemaker_cluster/vars/main.yml b/roles/sap_ha_pacemaker_cluster/vars/main.yml index b784dc511..16f9feb04 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/main.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP System IDs that are reserved and must not be used # Reference: SAP Note 1979280 diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml index c9f42abb6..b98247c7e 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The following directories are appended to the 'nfs_path' of the '/usr/sap' storage # definition. diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml index fb9b65cd5..9ad1bd68c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP NetWeaver ABAP specific parameter values # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index 07dc54ecc..91022e8f0 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on AWS platform, EC2 Virtual Servers # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index abf0104ea..0dda1bcd3 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on Google Cloud platform, Compute Engine Virtual Machines # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index dfd234172..ec31fda05 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on IBM Cloud platform, IBM Power Virtual Servers (ppc64le) # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index 412fd2001..81e13f417 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on IBM Cloud platform, Virtual Servers (x86_64) # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index 26c2afee8..1c13cae73 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on MS Azure platform, Virtual Machines # diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index 8572b600f..d20cbd8b6 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Variables specific on IBM PowerVM hypervisor, Virtual Machines (LPAR) # TODO: rename this file to match the actual "chassis_asset_tag" output diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 477f9e82b..9d4fcac49 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Overwrite HA_CLUSTER repository ID to use E4S repository # - an alternative logic could be to enable the repo before running ha_cluster diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index 48036d288..f2aa1b8cc 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- __sap_ha_pacemaker_cluster_halib_package: sap-suse-cluster-connector diff --git a/roles/sap_hana_install/.yamllint.yml b/roles/sap_hana_install/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_hana_install/.yamllint.yml +++ b/roles/sap_hana_install/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_hana_install/defaults/main.yml b/roles/sap_hana_install/defaults/main.yml index 0e82c8e5d..51f47e023 100644 --- a/roles/sap_hana_install/defaults/main.yml +++ b/roles/sap_hana_install/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ################ diff --git a/roles/sap_hana_install/meta/argument_specs.yml b/roles/sap_hana_install/meta/argument_specs.yml index 563a282af..cda7f0b71 100644 --- a/roles/sap_hana_install/meta/argument_specs.yml +++ b/roles/sap_hana_install/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- argument_specs: main: diff --git a/roles/sap_hana_install/meta/collection-requirements.yml b/roles/sap_hana_install/meta/collection-requirements.yml index 0a4e50f46..a1227178d 100644 --- a/roles/sap_hana_install/meta/collection-requirements.yml +++ b/roles/sap_hana_install/meta/collection-requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: diff --git a/roles/sap_hana_install/meta/main.yml b/roles/sap_hana_install/meta/main.yml index 9c72ba4ec..be9d08d7a 100644 --- a/roles/sap_hana_install/meta/main.yml +++ b/roles/sap_hana_install/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_hana_install/tasks/assert-addhosts-loop-block.yml b/roles/sap_hana_install/tasks/assert-addhosts-loop-block.yml index 55581576f..b87641727 100644 --- a/roles/sap_hana_install/tasks/assert-addhosts-loop-block.yml +++ b/roles/sap_hana_install/tasks/assert-addhosts-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Add Hosts - Check for SAP HANA instance profile for '{{ line_item }}' diff --git a/roles/sap_hana_install/tasks/hana_addhosts.yml b/roles/sap_hana_install/tasks/hana_addhosts.yml index 63d202d98..7c415fed4 100644 --- a/roles/sap_hana_install/tasks/hana_addhosts.yml +++ b/roles/sap_hana_install/tasks/hana_addhosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Add Hosts - Fill new variable __sap_hana_install_addhosts_hosts diff --git a/roles/sap_hana_install/tasks/hana_exists.yml b/roles/sap_hana_install/tasks/hana_exists.yml index 3f352b830..c97c88f7e 100644 --- a/roles/sap_hana_install/tasks/hana_exists.yml +++ b/roles/sap_hana_install/tasks/hana_exists.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ## Try to use saphostctrl to figure out if HANA or other SID is installed diff --git a/roles/sap_hana_install/tasks/hana_install.yml b/roles/sap_hana_install/tasks/hana_install.yml index 198196f3f..967addebf 100644 --- a/roles/sap_hana_install/tasks/hana_install.yml +++ b/roles/sap_hana_install/tasks/hana_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ansible does not support streaming of stdout, so we offer a workaround. diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index 1a8f2eb7a..a695c9494 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Rename some variables used by hdblcm configfile diff --git a/roles/sap_hana_install/tasks/post_install.yml b/roles/sap_hana_install/tasks/post_install.yml index 0af5f8773..c276775b3 100644 --- a/roles/sap_hana_install/tasks/post_install.yml +++ b/roles/sap_hana_install/tasks/post_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Tasks for new HANA Systems diff --git a/roles/sap_hana_install/tasks/post_install/firewall.yml b/roles/sap_hana_install/tasks/post_install/firewall.yml index a11661b66..aa7ede64e 100644 --- a/roles/sap_hana_install/tasks/post_install/firewall.yml +++ b/roles/sap_hana_install/tasks/post_install/firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Enable and start the firewalld service diff --git a/roles/sap_hana_install/tasks/post_install/hdbuserstore.yml b/roles/sap_hana_install/tasks/post_install/hdbuserstore.yml index 24d8ecc7a..a4fa40e78 100644 --- a/roles/sap_hana_install/tasks/post_install/hdbuserstore.yml +++ b/roles/sap_hana_install/tasks/post_install/hdbuserstore.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Create and Store Connection Info in hdbuserstore diff --git a/roles/sap_hana_install/tasks/post_install/license.yml b/roles/sap_hana_install/tasks/post_install/license.yml index df4f4e56c..409cfadd9 100644 --- a/roles/sap_hana_install/tasks/post_install/license.yml +++ b/roles/sap_hana_install/tasks/post_install/license.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Apply the SAP HANA license diff --git a/roles/sap_hana_install/tasks/post_install/log_mode.yml b/roles/sap_hana_install/tasks/post_install/log_mode.yml index 9590f00f8..75338cdac 100644 --- a/roles/sap_hana_install/tasks/post_install/log_mode.yml +++ b/roles/sap_hana_install/tasks/post_install/log_mode.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Set log_mode to overwrite, no initial tenant diff --git a/roles/sap_hana_install/tasks/post_install/recreate_tenant_database.yml b/roles/sap_hana_install/tasks/post_install/recreate_tenant_database.yml index 66041ce7e..8c2cfc8b6 100644 --- a/roles/sap_hana_install/tasks/post_install/recreate_tenant_database.yml +++ b/roles/sap_hana_install/tasks/post_install/recreate_tenant_database.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Recreate the tenant database diff --git a/roles/sap_hana_install/tasks/post_install/update_etchosts.yml b/roles/sap_hana_install/tasks/post_install/update_etchosts.yml index 584252e3f..79c922a33 100644 --- a/roles/sap_hana_install/tasks/post_install/update_etchosts.yml +++ b/roles/sap_hana_install/tasks/post_install/update_etchosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Post Install - Deduplicate values from /etc/hosts diff --git a/roles/sap_hana_install/tasks/post_install/update_firewall.yml b/roles/sap_hana_install/tasks/post_install/update_firewall.yml index b2dfdb84c..a00d83048 100644 --- a/roles/sap_hana_install/tasks/post_install/update_firewall.yml +++ b/roles/sap_hana_install/tasks/post_install/update_firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # This task requires the variable passed_port diff --git a/roles/sap_hana_install/tasks/pre_install-loop-block.yml b/roles/sap_hana_install/tasks/pre_install-loop-block.yml index cf756e017..c27dbdc57 100644 --- a/roles/sap_hana_install/tasks/pre_install-loop-block.yml +++ b/roles/sap_hana_install/tasks/pre_install-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Pre Install - Set __sap_hana_install_fact_tmp_dirname diff --git a/roles/sap_hana_install/tasks/pre_install.yml b/roles/sap_hana_install/tasks/pre_install.yml index df158848c..22fef6159 100644 --- a/roles/sap_hana_install/tasks/pre_install.yml +++ b/roles/sap_hana_install/tasks/pre_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ################ # Password Facts diff --git a/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml b/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml index 7cfed7751..2a43ff6f8 100644 --- a/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml +++ b/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA hdblcm prepare - Set fact for temporary extraction directory, default diff --git a/roles/sap_hana_install/tasks/pre_install/hdblcm_configfile.yml b/roles/sap_hana_install/tasks/pre_install/hdblcm_configfile.yml index 6e807c63a..f6aa1e565 100644 --- a/roles/sap_hana_install/tasks/pre_install/hdblcm_configfile.yml +++ b/roles/sap_hana_install/tasks/pre_install/hdblcm_configfile.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA Pre Install - Create the hdblcm configfile directory '{{ sap_hana_install_configfile_directory }}' if it does not exist diff --git a/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml b/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml index 0a5119087..bdff8d74d 100644 --- a/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml +++ b/roles/sap_hana_install/tasks/pre_install/hdblcm_prepare.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # hdblcm prepare diff --git a/roles/sap_hana_install/tasks/pre_install/prepare_sapcar.yml b/roles/sap_hana_install/tasks/pre_install/prepare_sapcar.yml index 051feb27d..159d02efa 100644 --- a/roles/sap_hana_install/tasks/pre_install/prepare_sapcar.yml +++ b/roles/sap_hana_install/tasks/pre_install/prepare_sapcar.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # hdblcm prepare SAPCAR diff --git a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml index a77c50ed9..17868b21e 100644 --- a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml +++ b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # hdblcm prepare sarfiles diff --git a/roles/sap_hana_install/tasks/pre_install/verify_checksum.yml b/roles/sap_hana_install/tasks/pre_install/verify_checksum.yml index c8f6ee2f7..9f189983e 100644 --- a/roles/sap_hana_install/tasks/pre_install/verify_checksum.yml +++ b/roles/sap_hana_install/tasks/pre_install/verify_checksum.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HANA hdblcm prepare - Check if checksum file exists diff --git a/roles/sap_hana_install/tests/install/hana-uninstall.yml b/roles/sap_hana_install/tests/install/hana-uninstall.yml index 24b8b16b6..73846c06c 100644 --- a/roles/sap_hana_install/tests/install/hana-uninstall.yml +++ b/roles/sap_hana_install/tests/install/hana-uninstall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - hosts: all diff --git a/roles/sap_hana_install/tests/install/install-vars.yml b/roles/sap_hana_install/tests/install/install-vars.yml index ce679444a..b5de8429d 100644 --- a/roles/sap_hana_install/tests/install/install-vars.yml +++ b/roles/sap_hana_install/tests/install/install-vars.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_hana_install_new_system: true diff --git a/roles/sap_hana_install/tests/install/prepare-install-test-01.yml b/roles/sap_hana_install/tests/install/prepare-install-test-01.yml index fd9272862..c473b254f 100644 --- a/roles/sap_hana_install/tests/install/prepare-install-test-01.yml +++ b/roles/sap_hana_install/tests/install/prepare-install-test-01.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: diff --git a/roles/sap_hana_install/tests/install/prepare-install-test-02.yml b/roles/sap_hana_install/tests/install/prepare-install-test-02.yml index eaf463da9..0c83798bb 100644 --- a/roles/sap_hana_install/tests/install/prepare-install-test-02.yml +++ b/roles/sap_hana_install/tests/install/prepare-install-test-02.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: diff --git a/roles/sap_hana_install/tests/install/prepare-install-test-03.yml b/roles/sap_hana_install/tests/install/prepare-install-test-03.yml index eaf463da9..0c83798bb 100644 --- a/roles/sap_hana_install/tests/install/prepare-install-test-03.yml +++ b/roles/sap_hana_install/tests/install/prepare-install-test-03.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: diff --git a/roles/sap_hana_install/tests/install/prepare-install-tests-ppc64le.yml b/roles/sap_hana_install/tests/install/prepare-install-tests-ppc64le.yml index 42040793f..7233ef38a 100644 --- a/roles/sap_hana_install/tests/install/prepare-install-tests-ppc64le.yml +++ b/roles/sap_hana_install/tests/install/prepare-install-tests-ppc64le.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: diff --git a/roles/sap_hana_install/tests/install/prepare-install-tests-x86_64.yml b/roles/sap_hana_install/tests/install/prepare-install-tests-x86_64.yml index 0e5c1111d..31c3ccf1a 100644 --- a/roles/sap_hana_install/tests/install/prepare-install-tests-x86_64.yml +++ b/roles/sap_hana_install/tests/install/prepare-install-tests-x86_64.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: diff --git a/roles/sap_hana_install/tests/install/remove-all-firewall-ports.yml b/roles/sap_hana_install/tests/install/remove-all-firewall-ports.yml index 7e958b532..5e82bb651 100644 --- a/roles/sap_hana_install/tests/install/remove-all-firewall-ports.yml +++ b/roles/sap_hana_install/tests/install/remove-all-firewall-ports.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Remove all defined firewall ports as per field 'ports' in 'firewall-cmd --list-all' diff --git a/roles/sap_hana_install/tests/install/run-install-test-01.yml b/roles/sap_hana_install/tests/install/run-install-test-01.yml index a5ab13647..d092769b0 100644 --- a/roles/sap_hana_install/tests/install/run-install-test-01.yml +++ b/roles/sap_hana_install/tests/install/run-install-test-01.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: test diff --git a/roles/sap_hana_install/tests/install/run-install-test-02.yml b/roles/sap_hana_install/tests/install/run-install-test-02.yml index a5ab13647..d092769b0 100644 --- a/roles/sap_hana_install/tests/install/run-install-test-02.yml +++ b/roles/sap_hana_install/tests/install/run-install-test-02.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: test diff --git a/roles/sap_hana_install/tests/install/run-install-test-03.yml b/roles/sap_hana_install/tests/install/run-install-test-03.yml index ad91b88eb..bdb9dd5ba 100644 --- a/roles/sap_hana_install/tests/install/run-install-test-03.yml +++ b/roles/sap_hana_install/tests/install/run-install-test-03.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: test diff --git a/roles/sap_hana_install/tests/sapcar/prepare-sapcar-tests.yml b/roles/sap_hana_install/tests/sapcar/prepare-sapcar-tests.yml index f3960658d..585b7289a 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-sapcar-tests.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-sapcar-tests.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare sapcar tests diff --git a/roles/sap_hana_install/tests/sapcar/prepare-test-01.yml b/roles/sap_hana_install/tests/sapcar/prepare-test-01.yml index abdd86069..1a77f30ad 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-test-01.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-test-01.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare test 01 diff --git a/roles/sap_hana_install/tests/sapcar/prepare-test-02.yml b/roles/sap_hana_install/tests/sapcar/prepare-test-02.yml index 3a0420839..2f9316289 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-test-02.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-test-02.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare test 02 diff --git a/roles/sap_hana_install/tests/sapcar/prepare-test-03.yml b/roles/sap_hana_install/tests/sapcar/prepare-test-03.yml index 7864eb5dc..5656ae9da 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-test-03.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-test-03.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare test 03 diff --git a/roles/sap_hana_install/tests/sapcar/prepare-test-04.yml b/roles/sap_hana_install/tests/sapcar/prepare-test-04.yml index a8b9a765a..869413bfd 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-test-04.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-test-04.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare test 04 diff --git a/roles/sap_hana_install/tests/sapcar/prepare-test-05.yml b/roles/sap_hana_install/tests/sapcar/prepare-test-05.yml index 58ed19334..cf9e299e7 100644 --- a/roles/sap_hana_install/tests/sapcar/prepare-test-05.yml +++ b/roles/sap_hana_install/tests/sapcar/prepare-test-05.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Prepare test 05 diff --git a/roles/sap_hana_install/tests/sapcar/run-sapcar-test.yml b/roles/sap_hana_install/tests/sapcar/run-sapcar-test.yml index 8bc6b9852..3bac2df7b 100644 --- a/roles/sap_hana_install/tests/sapcar/run-sapcar-test.yml +++ b/roles/sap_hana_install/tests/sapcar/run-sapcar-test.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: test diff --git a/roles/sap_hana_install/tests/sapcar/sapcar-vars.yml b/roles/sap_hana_install/tests/sapcar/sapcar-vars.yml index 0b904f627..9242ad578 100644 --- a/roles/sap_hana_install/tests/sapcar/sapcar-vars.yml +++ b/roles/sap_hana_install/tests/sapcar/sapcar-vars.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_hana_install_sid: T01 diff --git a/roles/sap_hana_install/vars/main.yml b/roles/sap_hana_install/vars/main.yml index b01f0a70d..5b23ad4a6 100644 --- a/roles/sap_hana_install/vars/main.yml +++ b/roles/sap_hana_install/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP System IDs that are reserved and must not be used diff --git a/roles/sap_hana_preconfigure/.yamllint.yml b/roles/sap_hana_preconfigure/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_hana_preconfigure/.yamllint.yml +++ b/roles/sap_hana_preconfigure/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index 8b95b4982..de9bb3efd 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # BEGIN: Default Variables for sap_hana_preconfigure diff --git a/roles/sap_hana_preconfigure/handlers/main.yml b/roles/sap_hana_preconfigure/handlers/main.yml index ee7eb5c9d..92c36eb21 100644 --- a/roles/sap_hana_preconfigure/handlers/main.yml +++ b/roles/sap_hana_preconfigure/handlers/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: "Check if server is booted in BIOS or UEFI mode" diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index c1b59e3bb..1d3427b70 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_hana_preconfigure/meta/collection-requirements.yml b/roles/sap_hana_preconfigure/meta/collection-requirements.yml index 0a4e50f46..a1227178d 100644 --- a/roles/sap_hana_preconfigure/meta/collection-requirements.yml +++ b/roles/sap_hana_preconfigure/meta/collection-requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: diff --git a/roles/sap_hana_preconfigure/meta/main.yml b/roles/sap_hana_preconfigure/meta/main.yml index 5baea0a64..c4271d479 100644 --- a/roles/sap_hana_preconfigure/meta/main.yml +++ b/roles/sap_hana_preconfigure/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/assert-configuration.yml b/roles/sap_hana_preconfigure/tasks/RedHat/assert-configuration.yml index c98be6d14..d0cba4756 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/assert-configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - List required SAP Notes diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml index 1a829bacc..2b05f9c47 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that the system is running a RHEL release which is supported for SAP HANA diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/configuration.yml b/roles/sap_hana_preconfigure/tasks/RedHat/configuration.yml index 24815aa52..5d334ef0d 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - List required SAP Notes diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2055470-loop-block.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2055470-loop-block.yml index 99033b7fe..7456017a9 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2055470-loop-block.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2055470-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # loop block for sapnote/assert-2055470.yml diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2382421-loop-block.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2382421-loop-block.yml index acc436cac..ec6f093ab 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2382421-loop-block.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2382421-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # loop block for sapnote/assert-2382421.yml diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2777782-01-loop-block.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2777782-01-loop-block.yml index 6dc476aaf..d321f06bb 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2777782-01-loop-block.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-2777782-01-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: 2777782-01 - Check if the directory '{{ line_item }}' exists diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-3024346-loop-block.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-3024346-loop-block.yml index bb1d1dd76..ec51662c4 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-3024346-loop-block.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-3024346-loop-block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # loop block for sapnote/assert-3024346.yml diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrt-ccpp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrt-ccpp.yml index fc96e8365..9c955b025 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrt-ccpp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrt-ccpp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that service abrt-ccpp is disabled, and inactive or stopped diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrtd.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrtd.yml index 36a63798a..9b3196b14 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrtd.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-abrtd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that service abrtd is disabled, and inactive or stopped diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-auto-numa-balancing.yml index 94628b8ae..7cacc9189 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml index 070e212ae..8a4a54cd9 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-coredumps.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-coredumps.yml index 572ad8d54..71eacff52 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-coredumps.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-coredumps.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get info about file /etc/security/limits.d/99-sap.conf diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml index 42355de1a..789fa2df9 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml index 7dee8c28e..164fcacab 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-firewalld.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-firewalld.yml index 5cb157679..c212b4cce 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-firewalld.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-firewalld.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that service firewalld is disabled, and inactive or stopped diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-kdump.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-kdump.yml index de5c370fc..f1e61ef5d 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that service kdump is disabled, and inactive or stopped diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-ksm.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-ksm.yml index ef35913cc..98af0080f 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Get info about file /etc/init.d/boot.local diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-selinux.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-selinux.yml index f1ecf86a9..2a1893327 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reason for noqa: Both yum and dnf support "state: latest" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-services.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-services.yml index cd01228d3..37c7e6fe4 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-services.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-services.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that service {{ __sap_hana_preconfigure_packages_and_services_svc }} is disabled diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index f365fc88b..e97efd54d 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml index 3a64d2d3c..f7ec8413b 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Perform steps for checking TSX diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tuned.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tuned.yml index 91ca78fc4..729c6bfac 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Display the version of tuned diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml index 8c1d3b55f..4f66c7392 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml index 29d77964e..ba9efc261 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml index 42195b1e4..635a0b00e 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml index 8a24bedf5..e432e2e09 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Set a new SELinux mode variable to the SELinux status if 'disabled' or otherwise to diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml index 152d6d0ee..8bfd2801c 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Perform specific steps for tuned profile on RHEL 8.0 ppc64le diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrt-ccpp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrt-ccpp.yml index 0f54d0bd5..d8d37cdf3 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrt-ccpp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrt-ccpp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable abrt-ccpp diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrtd.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrtd.yml index 6d4f5e08b..73debe69e 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrtd.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-abrtd.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable abrtd diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml index a82bb1ada..c52a036ce 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reasons for noqa: 1. Tabs can increase readability; diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-firewalld.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-firewalld.yml index 76c8c8a06..485c34b79 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-firewalld.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-firewalld.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable firewalld diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-kdump.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-kdump.yml index b9728bc10..463776c86 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable kdump diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml index 2e9f64c2f..399aa7b27 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Get info about file /etc/init.d/boot.local diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-services.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-services.yml index f379b3576..c32cb90df 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-services.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-services.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable service {{ __sap_hana_preconfigure_packages_and_services[line_item].svc }} diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-thp.yml index 99a446771..b462cabb3 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml index 4566cd726..c0418df43 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get boot command line diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml index ff15decb6..9cd4317f4 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml index c93046e30..a7a51f79f 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Get the current RHEL release diff --git a/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml index 198c5238e..b2d29f5fa 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Populate service facts ansible.builtin.service_facts: diff --git a/roles/sap_hana_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_hana_preconfigure/tasks/SLES/assert-installation.yml index 79e9442a5..c04f406a5 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/assert-installation.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Capture all patterns along with their install status - name: Get zypper pattern information diff --git a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml index d91792f22..30da5463d 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Takover saptune and enable when: __sap_hana_preconfigure_run_saptune diff --git a/roles/sap_hana_preconfigure/tasks/SLES/installation.yml b/roles/sap_hana_preconfigure/tasks/SLES/installation.yml index a01037e27..e5810687a 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reason for noqa: Both yum and dnf support "state: latest" - name: Ensure that the system is updated to the latest patchlevel # noqa package-latest diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index ca32ccc4c..e977d796d 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Display the role path diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/1275776/configuration.yml b/roles/sap_hana_preconfigure/tasks/sapnote/1275776/configuration.yml index 867647236..de00bca37 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/1275776/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/1275776/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # - name: "1275776 - Tips & Advice (start sapconf)" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/1275776/installation.yml b/roles/sap_hana_preconfigure/tasks/sapnote/1275776/installation.yml index 4a6ef5ba6..e4b24f0c9 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/1275776/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/1275776/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: 1275776 - Installation saptune ansible.builtin.package: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/1944799/configuration.yml b/roles/sap_hana_preconfigure/tasks/sapnote/1944799/configuration.yml index ed97d539c..51a15ea73 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/1944799/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/1944799/configuration.yml @@ -1 +1,2 @@ +# SPDX-License-Identifier: Apache-2.0 --- diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/1944799/installation.yml b/roles/sap_hana_preconfigure/tasks/sapnote/1944799/installation.yml index 6288c9fa8..c4d2ba26b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/1944799/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/1944799/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # base pattern defined in installation pdf # sap-hana and sap_server added by SVA (Thomas Bludau) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml index a3c35f2fa..debcc6295 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 6.x, 7.x # Check EUS Channels diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml index 44babf850..06ff0cb2f 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7.x # Check EUS Channels diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 21a0a7512..286c35ee5 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7 # Platform: PPC64LE diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690.yml index 93bb800e6..703eb6d5e 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 2292690 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-assert-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-assert-tuned.yml index a83b9025c..49efc74aa 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-assert-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-assert-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2292690-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-configure-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-configure-tuned.yml index cd1a6d95e..c45d9d48c 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-configure-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/01-configure-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2292690-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml index e3296d036..d4d3f506f 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml index aabf98d86..f52fc71bd 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-assert-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-assert-thp.yml index 9935ea665..24ed217e7 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-assert-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-disable-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-disable-thp.yml index 7f4e24d57..106371743 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-disable-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/03-disable-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml index 5481358a0..acb11d6d6 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml index fb3b5f7d1..b856f1c67 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-assert-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-assert-cpu-governor.yml index e2549b68d..973690912 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-assert-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-assert-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-configure-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-configure-cpu-governor.yml index 8728d411c..9563328ff 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-configure-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/05-configure-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-assert-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-assert-epb.yml index 032b463f1..1a098e89d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-assert-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-assert-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-configure-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-configure-epb.yml index a02b2aae5..2a5e3a9f1 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/06-configure-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-assert-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-assert-ksm.yml index 886a8af70..d582c5a54 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-assert-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-assert-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2292690-7 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-disable-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-disable-ksm.yml index e96f62341..cc38ab1db 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-disable-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/07-disable-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2292690-7 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-assert-etc-sudoers.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-assert-etc-sudoers.yml index 8311241ed..19c3b59e3 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-assert-etc-sudoers.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-assert-etc-sudoers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2292690-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-check-etc-sudoers.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-check-etc-sudoers.yml index 23750c1cf..5eed177a1 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-check-etc-sudoers.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/09-check-etc-sudoers.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2292690-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml index e2bec3177..f1765d28b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- #### Special recommendations for Power 8 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml index d6f9dfae7..a30e82ca3 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- #### Special recommendations for Power 8 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index 3593e8daf..b9f0985d6 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP Note: 2382421 - Optimizing the Network Configuration on HANA- and OS-Level # diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2578899/configuration.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2578899/configuration.yml index 140d15bcb..7ee50bfb0 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2578899/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2578899/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: 2588899 - I/O scheduler diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2578899/installation.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2578899/installation.yml index 11508c4e9..76685b377 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2578899/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2578899/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires SLE-Module-Legacy15 Module - name: "2578899 - SAP HANA database" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml index 8d44d73d2..2f1bb679d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Disable numa_balancing at boot diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/installation.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/installation.yml index d2b7ed823..d3de8971b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Additional notes for the installation of HANA 1.0 SPS12 and HANA 2.0 SPS03 - name: 2777782 - Additional notes for the installation of HANA 1.0 SPS12 and HANA 2.0 SPS03 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml index bd1184e2e..9dce5fb8a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 2777782 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-assert-selinux.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-assert-selinux.yml index 715819c85..98a9d12ab 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-assert-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-configure-selinux.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-configure-selinux.yml index 0aead6a74..0ab87b25f 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-configure-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/01-configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-assert-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-assert-tuned.yml index b61b61b5a..049d94ecb 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-assert-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-assert-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-2 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-configure-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-configure-tuned.yml index 3cc3f7a27..c7dbd6a2a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-configure-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/02-configure-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-2 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml index f995add3b..1bc02908c 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-3 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml index 738e06f07..465b0157e 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-3 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml index e685c4677..66c9373c1 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml index 81d95a43f..965aad60f 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-assert-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-assert-thp.yml index a7000dd85..5babd2edd 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-assert-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml index 5ee91783b..8430fbba3 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml index 9ed6cc068..d50169c03 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml index 445a43654..1c794352b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-assert-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-assert-cpu-governor.yml index 8a600b0fb..19f369abc 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-assert-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-assert-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-configure-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-configure-cpu-governor.yml index 40d22dcbf..30aaee040 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-configure-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/07-configure-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-assert-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-assert-epb.yml index d7fb09e88..8f7b969f8 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-assert-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-assert-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-configure-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-configure-epb.yml index 0d6c3a2ee..892e14cb1 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/08-configure-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-assert-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-assert-ksm.yml index 3393445b9..ca887c23a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-assert-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-assert-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-disable-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-disable-ksm.yml index a9cde0c26..6924720f1 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-disable-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/09-disable-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-assert-pidmax.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-assert-pidmax.yml index 3239fb7fc..2a0ee37f7 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-assert-pidmax.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-assert-pidmax.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-10 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-increase-pidmax.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-increase-pidmax.yml index 9099120d3..a39ebbe99 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-increase-pidmax.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/10-increase-pidmax.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-10 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-assert-tsx.yml index bf8e695ca..95b5a6e34 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-assert-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 2777782-11 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-enable-tsx.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-enable-tsx.yml index 509e152a3..433bc926d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-enable-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/11-enable-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 2777782-11 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 67c92ac5f..9055a84f4 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP Note: 3024346 - Linux Kernel Settings for NetApp NFS # diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml index 984f8246d..81f00d5f5 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 3108302 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-assert-selinux.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-assert-selinux.yml index 7113eef72..97f88397d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-assert-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-assert-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-configure-selinux.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-configure-selinux.yml index ec9812923..2a7e7699d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-configure-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/01-configure-selinux.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-assert-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-assert-tuned.yml index ba912890c..547775cdf 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-assert-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-assert-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-2 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-configure-tuned.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-configure-tuned.yml index e766b63bd..a14675024 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-configure-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/02-configure-tuned.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-2 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-assert-abrt-coredumps-kdump.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-assert-abrt-coredumps-kdump.yml index 86ba78076..3e4d41aee 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-assert-abrt-coredumps-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-assert-abrt-coredumps-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-3 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-disable-abrt-coredumps-kdump.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-disable-abrt-coredumps-kdump.yml index 228a32783..6c05d9c8b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-disable-abrt-coredumps-kdump.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/03-disable-abrt-coredumps-kdump.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-3 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-assert-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-assert-auto-numa-balancing.yml index d3abd862e..5519d38f2 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-assert-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-assert-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-turn-off-auto-numa-balancing.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-turn-off-auto-numa-balancing.yml index 3250fa04f..fd8d81b6a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-turn-off-auto-numa-balancing.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/04-turn-off-auto-numa-balancing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml index a2d0f88b9..58e3d400e 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml index d280bacc0..bf2db0e63 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-assert-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-assert-c-states-for-lower-latency.yml index fd9171ffc..b2e2792d0 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-assert-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-assert-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-configure-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-configure-c-states-for-lower-latency.yml index 53de721d0..dcd9ffe52 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-configure-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/06-configure-c-states-for-lower-latency.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "force_latency=70" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-assert-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-assert-cpu-governor.yml index 5e1c131f1..16e74941d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-assert-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-assert-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-configure-cpu-governor.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-configure-cpu-governor.yml index ad1fddfbf..788422636 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-configure-cpu-governor.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/07-configure-cpu-governor.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "governor=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-assert-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-assert-epb.yml index 92636137d..93c6988d7 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-assert-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-assert-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-configure-epb.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-configure-epb.yml index cfad92ada..65a062565 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/08-configure-epb.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-assert-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-assert-ksm.yml index 114b551ed..773b89713 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-assert-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-assert-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-disable-ksm.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-disable-ksm.yml index a8416b8a8..46e6011c3 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-disable-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/09-disable-ksm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-9 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-assert-pidmax.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-assert-pidmax.yml index 6fa9f56c0..e8599f69b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-assert-pidmax.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-assert-pidmax.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-10 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-increase-pidmax.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-increase-pidmax.yml index d4962aeb2..64c7e4041 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-increase-pidmax.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/10-increase-pidmax.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-10 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-assert-tsx.yml index 2210cc460..f6c4e663f 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-assert-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert 3108302-11 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-enable-tsx.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-enable-tsx.yml index 55ec8538a..56d81f745 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-enable-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/11-enable-tsx.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure 3108302-11 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml index ce2b1519a..296f33413 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 6.x, 7.x # Check EUS Channels diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml index f6176b580..f65962c4d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7.x # Check EUS Channels diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml index 00d4215b4..39bc50b0c 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7 # Platform: PPC64LE diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2292690.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2292690.yml index 783edd6b4..6532f50e7 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2292690.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2292690.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 2292690 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml index e847d374e..824684ffb 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7 # SAP Note: 2382421 - Optimizing the Network Configuration on HANA- and OS-Level diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2777782.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2777782.yml index 8efa90274..cd5195bf2 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2777782.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2777782.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 2777782 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml index 8910a1dd0..62ea19343 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SAP Note: 3024346 - Linux Kernel Settings for NetApp NFS # diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3108302.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3108302.yml index 1727a0c5b..972a11a61 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3108302.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3108302.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 3108302 and its version ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tests/sap_hana_preconfigure-default-settings.yml b/roles/sap_hana_preconfigure/tests/sap_hana_preconfigure-default-settings.yml index 561b391e8..0de4167b1 100644 --- a/roles/sap_hana_preconfigure/tests/sap_hana_preconfigure-default-settings.yml +++ b/roles/sap_hana_preconfigure/tests/sap_hana_preconfigure-default-settings.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - hosts: all collections: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_7.yml b/roles/sap_hana_preconfigure/vars/RedHat_7.yml index 182813add..ba44937f8 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_7.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # supported RHEL 7 minor releases for SAP HANA: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_8.yml b/roles/sap_hana_preconfigure/vars/RedHat_8.yml index 5b77385af..d040ea03e 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_8.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # supported RHEL 8 minor releases for SAP HANA: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 2eaa8ed3d..495f1ef06 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # supported RHEL 9 minor releases for SAP HANA: diff --git a/roles/sap_hana_preconfigure/vars/SLES_15.yml b/roles/sap_hana_preconfigure/vars/SLES_15.yml index 32dac1dea..a52238bad 100644 --- a/roles/sap_hana_preconfigure/vars/SLES_15.yml +++ b/roles/sap_hana_preconfigure/vars/SLES_15.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # required SAP Notes for SLES 15 diff --git a/roles/sap_hana_preconfigure/vars/main.yml b/roles/sap_hana_preconfigure/vars/main.yml index 48003185c..ab2df93c4 100644 --- a/roles/sap_hana_preconfigure/vars/main.yml +++ b/roles/sap_hana_preconfigure/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # define variables here that will not change diff --git a/roles/sap_hostagent/.yamllint.yml b/roles/sap_hostagent/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_hostagent/.yamllint.yml +++ b/roles/sap_hostagent/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_hostagent/defaults/main.yml b/roles/sap_hostagent/defaults/main.yml index 83db2b33c..ed1d754d9 100644 --- a/roles/sap_hostagent/defaults/main.yml +++ b/roles/sap_hostagent/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Global Default variables # Adapt to your default settings diff --git a/roles/sap_hostagent/meta/main.yml b/roles/sap_hostagent/meta/main.yml index 31cef273e..ddbb94eac 100644 --- a/roles/sap_hostagent/meta/main.yml +++ b/roles/sap_hostagent/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: author: IBM Lab for SAP Solutions, Red Hat for SAP Community of Practice diff --git a/roles/sap_hostagent/tasks/common_post.yml b/roles/sap_hostagent/tasks/common_post.yml index 2d877f8f6..70469b491 100644 --- a/roles/sap_hostagent/tasks/common_post.yml +++ b/roles/sap_hostagent/tasks/common_post.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ensure {{ sap_hostagent_agent_tmp_directory }} directory is removed from the target host diff --git a/roles/sap_hostagent/tasks/common_pre.yml b/roles/sap_hostagent/tasks/common_pre.yml index 4c2e5acc2..cd2ac8214 100644 --- a/roles/sap_hostagent/tasks/common_pre.yml +++ b/roles/sap_hostagent/tasks/common_pre.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ensure {{ sap_hostagent_agent_tmp_directory }} directory exists on the target host diff --git a/roles/sap_hostagent/tasks/config_ssl.yml b/roles/sap_hostagent/tasks/config_ssl.yml index 3cdb5510c..f20506a48 100644 --- a/roles/sap_hostagent/tasks/config_ssl.yml +++ b/roles/sap_hostagent/tasks/config_ssl.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Ensure 'sapadm' user home directory exists diff --git a/roles/sap_hostagent/tasks/deploy_bundle.yml b/roles/sap_hostagent/tasks/deploy_bundle.yml index 0e859ae4f..39a83290e 100644 --- a/roles/sap_hostagent/tasks/deploy_bundle.yml +++ b/roles/sap_hostagent/tasks/deploy_bundle.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Extract the SAPHOSTAGENT TGZ file from the Bundle diff --git a/roles/sap_hostagent/tasks/deploy_rpm.yml b/roles/sap_hostagent/tasks/deploy_rpm.yml index 8b53a8496..6281af2ea 100644 --- a/roles/sap_hostagent/tasks/deploy_rpm.yml +++ b/roles/sap_hostagent/tasks/deploy_rpm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Copy RPM based SAPHOSTAGENT to the target host diff --git a/roles/sap_hostagent/tasks/deploy_sar.yml b/roles/sap_hostagent/tasks/deploy_sar.yml index 121da7254..8a6ecc71d 100644 --- a/roles/sap_hostagent/tasks/deploy_sar.yml +++ b/roles/sap_hostagent/tasks/deploy_sar.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Copy SAR based SAPHOSTAGENT to the target host diff --git a/roles/sap_hostagent/tasks/deploy_sar_remote.yml b/roles/sap_hostagent/tasks/deploy_sar_remote.yml index f99763ed8..e7e46e868 100644 --- a/roles/sap_hostagent/tasks/deploy_sar_remote.yml +++ b/roles/sap_hostagent/tasks/deploy_sar_remote.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Extract the SAPHOSTAGENT archive using SAPCAR diff --git a/roles/sap_hostagent/tasks/main.yml b/roles/sap_hostagent/tasks/main.yml index 17d29203a..f106a42c8 100644 --- a/roles/sap_hostagent/tasks/main.yml +++ b/roles/sap_hostagent/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Execute common pre installation tasks diff --git a/roles/sap_install_media_detect/.yamllint.yml b/roles/sap_install_media_detect/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_install_media_detect/.yamllint.yml +++ b/roles/sap_install_media_detect/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_install_media_detect/defaults/main.yml b/roles/sap_install_media_detect/defaults/main.yml index a1a1fe264..d832612ed 100644 --- a/roles/sap_install_media_detect/defaults/main.yml +++ b/roles/sap_install_media_detect/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Set this parameter to use either the unar package from EPEL or another software package for handling RAR files. diff --git a/roles/sap_install_media_detect/meta/main.yml b/roles/sap_install_media_detect/meta/main.yml index bc6c3b9f1..1aa398f10 100644 --- a/roles/sap_install_media_detect/meta/main.yml +++ b/roles/sap_install_media_detect/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml index f33657ba8..f76d70fe1 100644 --- a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml +++ b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Note: This file is only included from tasks/main.yml if the epel-release package had not been initially detected. diff --git a/roles/sap_install_media_detect/tasks/cleanup/remove_sapfile_utility.yml b/roles/sap_install_media_detect/tasks/cleanup/remove_sapfile_utility.yml index 0e95e08bb..ace2e6811 100644 --- a/roles/sap_install_media_detect/tasks/cleanup/remove_sapfile_utility.yml +++ b/roles/sap_install_media_detect/tasks/cleanup/remove_sapfile_utility.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Remove temporary directory diff --git a/roles/sap_install_media_detect/tasks/find_files_after_extraction.yml b/roles/sap_install_media_detect/tasks/find_files_after_extraction.yml index 7118e343e..782a4ad3d 100644 --- a/roles/sap_install_media_detect/tasks/find_files_after_extraction.yml +++ b/roles/sap_install_media_detect/tasks/find_files_after_extraction.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Find files after extraction - Initialize fact variables diff --git a/roles/sap_install_media_detect/tasks/main.yml b/roles/sap_install_media_detect/tasks/main.yml index 9f69cf1d3..d98e06d35 100644 --- a/roles/sap_install_media_detect/tasks/main.yml +++ b/roles/sap_install_media_detect/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The sapcar (SAPCAR.EXE) program is required for the detection of the SAP file types. It is detected in create_file_list_phase_1.yml diff --git a/roles/sap_install_media_detect/tasks/organize_files.yml b/roles/sap_install_media_detect/tasks/organize_files.yml index afa6c496f..2b7095137 100644 --- a/roles/sap_install_media_detect/tasks/organize_files.yml +++ b/roles/sap_install_media_detect/tasks/organize_files.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Organize all files - Copy files to {{ sap_install_media_detect_target_directory }} diff --git a/roles/sap_install_media_detect/tasks/prepare/check_directories.yml b/roles/sap_install_media_detect/tasks/prepare/check_directories.yml index a66b3acf7..caac7f4d0 100644 --- a/roles/sap_install_media_detect/tasks/prepare/check_directories.yml +++ b/roles/sap_install_media_detect/tasks/prepare/check_directories.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Get info of 'sap_install_media_detect_source_directory' diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml index 56f0835f7..dc19a9233 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The fact variables are appended in tasks of this file, so they need to be initialized explicitly. diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index 355836b98..8015363a2 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # The fact variables are appended in tasks of this file, so they need to be initialized explicitly. diff --git a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml index 7f993905b..3746b07c8 100644 --- a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml +++ b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Install the unar package from EPEL diff --git a/roles/sap_install_media_detect/tasks/prepare/enable_zip_handling.yml b/roles/sap_install_media_detect/tasks/prepare/enable_zip_handling.yml index 3c154e896..22b174ee5 100644 --- a/roles/sap_install_media_detect/tasks/prepare/enable_zip_handling.yml +++ b/roles/sap_install_media_detect/tasks/prepare/enable_zip_handling.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Ensure the presence of the 'unzip' package diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 5bfae97f1..09f56833e 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Initialize fact variables, phase 1b diff --git a/roles/sap_install_media_detect/tasks/prepare/provide_sapfile_utility.yml b/roles/sap_install_media_detect/tasks/prepare/provide_sapfile_utility.yml index 971233b18..4e2157510 100644 --- a/roles/sap_install_media_detect/tasks/prepare/provide_sapfile_utility.yml +++ b/roles/sap_install_media_detect/tasks/prepare/provide_sapfile_utility.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Prepare - Create temporary directory to store various files diff --git a/roles/sap_install_media_detect/tasks/rename/add_exe_extension_loop_block.yml b/roles/sap_install_media_detect/tasks/rename/add_exe_extension_loop_block.yml index 3a5e565ec..500b9003c 100644 --- a/roles/sap_install_media_detect/tasks/rename/add_exe_extension_loop_block.yml +++ b/roles/sap_install_media_detect/tasks/rename/add_exe_extension_loop_block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Rename - Loop Block - Get info about target self-extracting rar file '{{ line_item.file }}.exe' diff --git a/roles/sap_install_media_detect/tasks/rename/add_file_extension.yml b/roles/sap_install_media_detect/tasks/rename/add_file_extension.yml index 45abd78fa..b95d9a22e 100644 --- a/roles/sap_install_media_detect/tasks/rename/add_file_extension.yml +++ b/roles/sap_install_media_detect/tasks/rename/add_file_extension.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Rename - Add 'zip' extension to zip files diff --git a/roles/sap_install_media_detect/tasks/rename/add_rar_extension_loop_block.yml b/roles/sap_install_media_detect/tasks/rename/add_rar_extension_loop_block.yml index 0f6c3f71d..9460a2327 100644 --- a/roles/sap_install_media_detect/tasks/rename/add_rar_extension_loop_block.yml +++ b/roles/sap_install_media_detect/tasks/rename/add_rar_extension_loop_block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Rename - Loop Block - Get info about target rar file '{{ line_item.file }}.rar' diff --git a/roles/sap_install_media_detect/tasks/rename/add_zip_extension_loop_block.yml b/roles/sap_install_media_detect/tasks/rename/add_zip_extension_loop_block.yml index 20892ed68..3e6226e15 100644 --- a/roles/sap_install_media_detect/tasks/rename/add_zip_extension_loop_block.yml +++ b/roles/sap_install_media_detect/tasks/rename/add_zip_extension_loop_block.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Rename - Loop Block - Get info about target zip file '{{ line_item.file }}.zip' diff --git a/roles/sap_install_media_detect/tasks/set_global_vars.yml b/roles/sap_install_media_detect/tasks/set_global_vars.yml index 7f449371f..845fc9386 100644 --- a/roles/sap_install_media_detect/tasks/set_global_vars.yml +++ b/roles/sap_install_media_detect/tasks/set_global_vars.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Install Media Detect - Detection completed - Initialize variables for collecting and displaying all variables diff --git a/roles/sap_maintain_etc_hosts/.yamllint.yml b/roles/sap_maintain_etc_hosts/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_maintain_etc_hosts/.yamllint.yml +++ b/roles/sap_maintain_etc_hosts/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_maintain_etc_hosts/defaults/main.yml b/roles/sap_maintain_etc_hosts/defaults/main.yml index 718730176..302ce0a1a 100644 --- a/roles/sap_maintain_etc_hosts/defaults/main.yml +++ b/roles/sap_maintain_etc_hosts/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # defaults file for sap_maintain_etc_hosts # BEGIN: Default Variables for sap_maintain_etc_hosts diff --git a/roles/sap_maintain_etc_hosts/meta/argument_specs.yml b/roles/sap_maintain_etc_hosts/meta/argument_specs.yml index a52430bf7..721ab9b5e 100644 --- a/roles/sap_maintain_etc_hosts/meta/argument_specs.yml +++ b/roles/sap_maintain_etc_hosts/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_maintain_etc_hosts/meta/main.yml b/roles/sap_maintain_etc_hosts/meta/main.yml index ec0dd8471..9e6bfe4f2 100644 --- a/roles/sap_maintain_etc_hosts/meta/main.yml +++ b/roles/sap_maintain_etc_hosts/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_maintain_etc_hosts/tasks/main.yml b/roles/sap_maintain_etc_hosts/tasks/main.yml index 0fc42f203..f18877aa8 100644 --- a/roles/sap_maintain_etc_hosts/tasks/main.yml +++ b/roles/sap_maintain_etc_hosts/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # tasks file for sap_maintain_etc_hosts #- name: Double check that list entries with state present do not have duplicate IP addresses diff --git a/roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml b/roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml index 9155ba151..8fb34ca98 100644 --- a/roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml +++ b/roles/sap_maintain_etc_hosts/tasks/update_host_absent.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Verify that variable node_ip is in the correct format ansible.builtin.assert: diff --git a/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml b/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml index c3c22fdc0..000ab6707 100644 --- a/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml +++ b/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Verify that variable node_ip is set ansible.builtin.assert: diff --git a/roles/sap_maintain_etc_hosts/tests/test.yml b/roles/sap_maintain_etc_hosts/tests/test.yml index 6bfeec021..23b26aa46 100644 --- a/roles/sap_maintain_etc_hosts/tests/test.yml +++ b/roles/sap_maintain_etc_hosts/tests/test.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # you can run 'ansible-playbook test.yml -K -e __sap_maintain_etc_hosts_file=./test.hosts' for testing this role - name: Test play diff --git a/roles/sap_maintain_etc_hosts/vars/main.yml b/roles/sap_maintain_etc_hosts/vars/main.yml index c65271322..ebb59dfb2 100644 --- a/roles/sap_maintain_etc_hosts/vars/main.yml +++ b/roles/sap_maintain_etc_hosts/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_maintain_etc_hosts __sap_maintain_etc_hosts_file: /etc/hosts diff --git a/roles/sap_netweaver_preconfigure/.yamllint.yml b/roles/sap_netweaver_preconfigure/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_netweaver_preconfigure/.yamllint.yml +++ b/roles/sap_netweaver_preconfigure/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_netweaver_preconfigure/defaults/main.yml b/roles/sap_netweaver_preconfigure/defaults/main.yml index b49137da0..6b46f5183 100644 --- a/roles/sap_netweaver_preconfigure/defaults/main.yml +++ b/roles/sap_netweaver_preconfigure/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # defaults file for sap_netweaver_preconfigure diff --git a/roles/sap_netweaver_preconfigure/handlers/main.yml b/roles/sap_netweaver_preconfigure/handlers/main.yml index dacebbbf8..1c3157ad6 100644 --- a/roles/sap_netweaver_preconfigure/handlers/main.yml +++ b/roles/sap_netweaver_preconfigure/handlers/main.yml @@ -1,2 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 --- # handlers file for sap_netweaver_preconfigure diff --git a/roles/sap_netweaver_preconfigure/meta/argument_specs.yml b/roles/sap_netweaver_preconfigure/meta/argument_specs.yml index 595c9e090..4f4554643 100644 --- a/roles/sap_netweaver_preconfigure/meta/argument_specs.yml +++ b/roles/sap_netweaver_preconfigure/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_netweaver_preconfigure/meta/main.yml b/roles/sap_netweaver_preconfigure/meta/main.yml index 9bc882c90..0ed0946aa 100644 --- a/roles/sap_netweaver_preconfigure/meta/main.yml +++ b/roles/sap_netweaver_preconfigure/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml index 496f5c88d..c1bc7b7ac 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - List required SAP Notes diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml index 14fd4eb25..d5d271e27 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert that all required packages are installed diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml index 026b91138..7ab03d9dd 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - List required SAP Notes diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml index 08610f9a4..551c046f8 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Ensure required packages for SAP NetWeaver are installed diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml index a3a4a87b8..8c0ff3c3c 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Populate service facts ansible.builtin.service_facts: diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml index b4e51604f..077317a4b 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- #- name: Enable Debugging # debug: diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml index f3401bb7f..2dcedf5f4 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Takover saptune and enable when: __sap_netweaver_preconfigure_run_saptune diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml index feef1ae71..14764a4f4 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Ensure required packages for SAP NetWeaver are installed diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index c2855bb89..016d3a7a7 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Display the role path diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/configuration.yml index ccdf2bef8..14f2b1308 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/configuration.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # - name: "1275776 - Tips & Advice (start sapconf)" diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/installation.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/installation.yml index f149aca40..8e26bee9f 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/1275776/installation.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: 1275776 - Installation saptune diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/2526952.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/2526952.yml index 19997a328..ab3bd37cc 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/2526952.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/2526952.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # OS RELEASE: RHEL 7 and RHEL 8 # SAP Note: 2526952 - Red Hat Enterprise Linux for SAP Solutions diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml index 37883f1cd..60ca5ae7e 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/3119751.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 3119751 and its version diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml index 6fc7a4b61..d0fe88b23 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Assert - Display SAP note number 2526952 and its version diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml index 54391eba0..d846c5552 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-3119751.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: Configure - Display SAP note number 3119751 and its version diff --git a/roles/sap_netweaver_preconfigure/tests/sap_netweaver_preconfigure-default-settings.yml b/roles/sap_netweaver_preconfigure/tests/sap_netweaver_preconfigure-default-settings.yml index e9e772a79..da625fb24 100644 --- a/roles/sap_netweaver_preconfigure/tests/sap_netweaver_preconfigure-default-settings.yml +++ b/roles/sap_netweaver_preconfigure/tests/sap_netweaver_preconfigure-default-settings.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - hosts: all collections: diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml index 551082a14..4e8fe4de5 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_netweaver_preconfigure diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml index 9bd5223a0..c74c0a8b7 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_netweaver_preconfigure diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml index 6fccccd37..07320f104 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # vars file for sap_netweaver_preconfigure diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml index 86ce492f5..454c589b0 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # required SAP Notes for SLES 15 diff --git a/roles/sap_netweaver_preconfigure/vars/main.yml b/roles/sap_netweaver_preconfigure/vars/main.yml index 5684d51f3..42ac22571 100644 --- a/roles/sap_netweaver_preconfigure/vars/main.yml +++ b/roles/sap_netweaver_preconfigure/vars/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # define variables here that will not change diff --git a/roles/sap_storage_setup/.yamllint.yml b/roles/sap_storage_setup/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_storage_setup/.yamllint.yml +++ b/roles/sap_storage_setup/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_storage_setup/defaults/main.yml b/roles/sap_storage_setup/defaults/main.yml index 8abea7e81..3cfc3bd3e 100644 --- a/roles/sap_storage_setup/defaults/main.yml +++ b/roles/sap_storage_setup/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Inherit from global parameters, if they exist diff --git a/roles/sap_storage_setup/meta/argument_specs.yml b/roles/sap_storage_setup/meta/argument_specs.yml index 55fe57cbb..b91499549 100644 --- a/roles/sap_storage_setup/meta/argument_specs.yml +++ b/roles/sap_storage_setup/meta/argument_specs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Requires: ansible 2.11 # Argument specifications in this separate file maintain backwards compatibility. diff --git a/roles/sap_storage_setup/meta/main.yml b/roles/sap_storage_setup/meta/main.yml index 452b2c05a..d8f19f847 100644 --- a/roles/sap_storage_setup/meta/main.yml +++ b/roles/sap_storage_setup/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_local_filesystems.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_local_filesystems.yml index 1b00eccd0..ab99b9740 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_local_filesystems.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_local_filesystems.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Storage Setup - Create LVM volume groups community.general.lvg: diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_multipathing.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_multipathing.yml index 7274b25d5..cca1f4bfd 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_multipathing.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_multipathing.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Storage Setup - (Multipathing) Install OS packages ansible.builtin.package: diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml index 303174207..309bcde46 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # These tasks are executed in a loop over all NFS filesystems # defined in sap_storage_setup_definition. diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml index b09f3ee2c..4a4db5ea4 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Storage Setup - Block handling the swap file # Block parameters diff --git a/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml b/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml index b70e6574e..004c9b85f 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ########## # Creating a list of unused devices that match the requested filesystem sizes, using diff --git a/roles/sap_storage_setup/tasks/generic_tasks/remove_storage.yml b/roles/sap_storage_setup/tasks/generic_tasks/remove_storage.yml index d55ee4738..31a482186 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/remove_storage.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/remove_storage.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ## Unmount Filesystem diff --git a/roles/sap_storage_setup/tasks/main.yml b/roles/sap_storage_setup/tasks/main.yml index 91f3bb4af..92c813af1 100644 --- a/roles/sap_storage_setup/tasks/main.yml +++ b/roles/sap_storage_setup/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP Storage Setup - Get facts about the OS diff --git a/roles/sap_storage_setup/tasks/platform_tasks/aws_main.yml b/roles/sap_storage_setup/tasks/platform_tasks/aws_main.yml index 4fe7915fb..d417c63b9 100644 --- a/roles/sap_storage_setup/tasks/platform_tasks/aws_main.yml +++ b/roles/sap_storage_setup/tasks/platform_tasks/aws_main.yml @@ -1,2 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Placeholder for AWS platform tasks diff --git a/roles/sap_storage_setup/tasks/platform_tasks/az_main.yml b/roles/sap_storage_setup/tasks/platform_tasks/az_main.yml index 9c5416bda..d092966a1 100644 --- a/roles/sap_storage_setup/tasks/platform_tasks/az_main.yml +++ b/roles/sap_storage_setup/tasks/platform_tasks/az_main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # TODO: review and adjust for Azure platform diff --git a/roles/sap_storage_setup/tasks/platform_tasks/prepare_storage_az.yml b/roles/sap_storage_setup/tasks/platform_tasks/prepare_storage_az.yml index c3f5f35b4..563290a8e 100644 --- a/roles/sap_storage_setup/tasks/platform_tasks/prepare_storage_az.yml +++ b/roles/sap_storage_setup/tasks/platform_tasks/prepare_storage_az.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ## Striped volume #- name: SAP Storage Preparation - {{ sap_storage_setup_cloud_type | upper }} - {{ sap_storage_setup_az_vmsize }} - {{ item.value.name }} - Striped diff --git a/roles/sap_storage_setup/tasks/platform_tasks/remove_storage_az.yml b/roles/sap_storage_setup/tasks/platform_tasks/remove_storage_az.yml index e7c8fe9bc..e3ea83328 100644 --- a/roles/sap_storage_setup/tasks/platform_tasks/remove_storage_az.yml +++ b/roles/sap_storage_setup/tasks/platform_tasks/remove_storage_az.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ## Unmount Filesystem diff --git a/roles/sap_storage_setup/vars/RedHat.yml b/roles/sap_storage_setup/vars/RedHat.yml index ef952716b..189c90d18 100644 --- a/roles/sap_storage_setup/vars/RedHat.yml +++ b/roles/sap_storage_setup/vars/RedHat.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # RHEL specific variables diff --git a/roles/sap_storage_setup/vars/Suse.yml b/roles/sap_storage_setup/vars/Suse.yml index 376d35e19..96b71ae8e 100644 --- a/roles/sap_storage_setup/vars/Suse.yml +++ b/roles/sap_storage_setup/vars/Suse.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # SLES specific variables diff --git a/roles/sap_swpm/.yamllint.yml b/roles/sap_swpm/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_swpm/.yamllint.yml +++ b/roles/sap_swpm/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index c3956bf99..66181a14d 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ######################################## diff --git a/roles/sap_swpm/meta/collection-requirements.yml b/roles/sap_swpm/meta/collection-requirements.yml index a6d0e8348..c7f1b1f6d 100644 --- a/roles/sap_swpm/meta/collection-requirements.yml +++ b/roles/sap_swpm/meta/collection-requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: diff --git a/roles/sap_swpm/meta/main.yml b/roles/sap_swpm/meta/main.yml index 30b769844..68c1f88a5 100644 --- a/roles/sap_swpm/meta/main.yml +++ b/roles/sap_swpm/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_swpm/requirements.yml b/roles/sap_swpm/requirements.yml index ab387e515..57520f357 100644 --- a/roles/sap_swpm/requirements.yml +++ b/roles/sap_swpm/requirements.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- collections: - name: https://github.com/ansible-collections/community.general diff --git a/roles/sap_swpm/tasks/main.yml b/roles/sap_swpm/tasks/main.yml index aa16a779e..aa784ef91 100644 --- a/roles/sap_swpm/tasks/main.yml +++ b/roles/sap_swpm/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP SWPM - run pre_install tasks diff --git a/roles/sap_swpm/tasks/post_install.yml b/roles/sap_swpm/tasks/post_install.yml index 4e0d39968..adefb01ff 100644 --- a/roles/sap_swpm/tasks/post_install.yml +++ b/roles/sap_swpm/tasks/post_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Reason for noqa: The command might change things but we do not yet attempt to find out diff --git a/roles/sap_swpm/tasks/post_install/firewall.yml b/roles/sap_swpm/tasks/post_install/firewall.yml index e8c5b3904..fb7b1a219 100644 --- a/roles/sap_swpm/tasks/post_install/firewall.yml +++ b/roles/sap_swpm/tasks/post_install/firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP SWPM Post Install - Firewall Setup diff --git a/roles/sap_swpm/tasks/post_install/update_firewall.yml b/roles/sap_swpm/tasks/post_install/update_firewall.yml index bf77074d1..331e88daa 100644 --- a/roles/sap_swpm/tasks/post_install/update_firewall.yml +++ b/roles/sap_swpm/tasks/post_install/update_firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # This task requires the variable passed_port diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 7e0cb7a6f..aba951749 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ################ diff --git a/roles/sap_swpm/tasks/pre_install/create_os_user.yml b/roles/sap_swpm/tasks/pre_install/create_os_user.yml index e9ec2bab2..03e9cfe62 100644 --- a/roles/sap_swpm/tasks/pre_install/create_os_user.yml +++ b/roles/sap_swpm/tasks/pre_install/create_os_user.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Legacy code, appears to serve no function but does cause ASCS HA adm to not default to C Shell diff --git a/roles/sap_swpm/tasks/pre_install/firewall.yml b/roles/sap_swpm/tasks/pre_install/firewall.yml index 804e8675e..f27aea554 100644 --- a/roles/sap_swpm/tasks/pre_install/firewall.yml +++ b/roles/sap_swpm/tasks/pre_install/firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP SWPM Pre Install - Firewall Setup diff --git a/roles/sap_swpm/tasks/pre_install/install_type.yml b/roles/sap_swpm/tasks/pre_install/install_type.yml index 1eabb2157..ced5bbc98 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP SWPM Pre Install - Determine Installation Type diff --git a/roles/sap_swpm/tasks/pre_install/install_type/general_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/general_install.yml index 9a31c6eee..ef3e6deb1 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/general_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/general_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Placeholder for future if required diff --git a/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml index 1e4e7f878..327bc30f9 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/ha_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # High Availability installation diff --git a/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml index b8277cc9a..483628b5a 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/ha_maint_plan_stack_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # High Availability installation diff --git a/roles/sap_swpm/tasks/pre_install/install_type/maint_plan_stack_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/maint_plan_stack_install.yml index 9bf39bded..91d437bc4 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/maint_plan_stack_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/maint_plan_stack_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Install using SAP Maintenance Planner Stack XML diff --git a/roles/sap_swpm/tasks/pre_install/install_type/restore_install.yml b/roles/sap_swpm/tasks/pre_install/install_type/restore_install.yml index 6dcd13347..e4e72e00b 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type/restore_install.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type/restore_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # System Copy restore installation diff --git a/roles/sap_swpm/tasks/pre_install/password_facts.yml b/roles/sap_swpm/tasks/pre_install/password_facts.yml index aa74a597e..850283d88 100644 --- a/roles/sap_swpm/tasks/pre_install/password_facts.yml +++ b/roles/sap_swpm/tasks/pre_install/password_facts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP SWPM Pre Install - Set password facts when ABAP diff --git a/roles/sap_swpm/tasks/pre_install/update_etchosts.yml b/roles/sap_swpm/tasks/pre_install/update_etchosts.yml index 5044e5d2b..4adbdcf34 100644 --- a/roles/sap_swpm/tasks/pre_install/update_etchosts.yml +++ b/roles/sap_swpm/tasks/pre_install/update_etchosts.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Update etc hosts for NW diff --git a/roles/sap_swpm/tasks/pre_install/update_firewall.yml b/roles/sap_swpm/tasks/pre_install/update_firewall.yml index bf77074d1..331e88daa 100644 --- a/roles/sap_swpm/tasks/pre_install/update_firewall.yml +++ b/roles/sap_swpm/tasks/pre_install/update_firewall.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # This task requires the variable passed_port diff --git a/roles/sap_swpm/tasks/swpm.yml b/roles/sap_swpm/tasks/swpm.yml index 997235277..bac7595dc 100644 --- a/roles/sap_swpm/tasks/swpm.yml +++ b/roles/sap_swpm/tasks/swpm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ### Deprecated standard method, can fail to detect process exit (e.g. hang errors with SAP SWPM 2.0 SP11) diff --git a/roles/sap_swpm/tasks/swpm/detect_variables.yml b/roles/sap_swpm/tasks/swpm/detect_variables.yml index 7b1d299f9..557c988ad 100644 --- a/roles/sap_swpm/tasks/swpm/detect_variables.yml +++ b/roles/sap_swpm/tasks/swpm/detect_variables.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Detect Product ID diff --git a/roles/sap_swpm/tasks/swpm/prepare_software.yml b/roles/sap_swpm/tasks/swpm/prepare_software.yml index e52042570..62ca21d1f 100644 --- a/roles/sap_swpm/tasks/swpm/prepare_software.yml +++ b/roles/sap_swpm/tasks/swpm/prepare_software.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ################ diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml index 3228f97f4..234dfb5db 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Remove Existing inifile.params diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml index efeeab6f4..b6685e343 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Set facts based on the install dictionary diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml index cc4357f9f..b04362cb6 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Determine Installation Type diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml index 68abe9de2..b51706218 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Set facts based on the install dictionary diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml index 2513a7971..b22ef3481 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Copy reused inifile diff --git a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml b/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml index 3a3158c38..360df233f 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Create temporary directory From 4c57cbd968f15466658262111b5d0e32da3b24d5 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 26 Jun 2024 00:28:37 +0100 Subject: [PATCH 029/210] sap_install_media_detect: amend task prefix --- .../prepare/move_files_to_main_directory.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 8d65c26ae..53a1487cc 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -1,12 +1,12 @@ --- -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Initialize fact variables, phase 1b +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Initialize fact variables, phase 1b ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1b: [] # If any files have been moved to non-extract subdirectories already, move them back to the top level, making the role idempotent # Reason for noqa: When using pipefail and there is no result from the grep -v, this tail will fail but it should never fail -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Find the relevant non-extract subdirectories # noqa risky-shell-pipe +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Find the relevant non-extract subdirectories # noqa risky-shell-pipe ansible.builtin.shell: cmd: > ls -d \ @@ -20,21 +20,21 @@ failed_when: false # Reason for noqa: When using pipefail and there is no result from the grep -v, this tail will fail but it should never fail -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Find existing extract subdirectories # noqa risky-shell-pipe +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Find existing extract subdirectories # noqa risky-shell-pipe ansible.builtin.shell: ls -d {{ __sap_install_media_detect_software_main_directory }}/*/ | grep '_extracted/$' register: __sap_install_media_detect_register_subdirectories_phase_1b_extracted changed_when: false failed_when: false -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Display the relevant non-extract subdirectories +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Display the relevant non-extract subdirectories ansible.builtin.debug: var: __sap_install_media_detect_register_subdirectories_phase_1b.stdout_lines -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Display existing extract subdirectories +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Display existing extract subdirectories ansible.builtin.debug: var: __sap_install_media_detect_register_subdirectories_phase_1b_extracted.stdout_lines -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Create list of all files one level below '{{ __sap_install_media_detect_software_main_directory }}' +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Create list of all files one level below '{{ __sap_install_media_detect_software_main_directory }}' ansible.builtin.find: paths: "{{ line_item }}" patterns: '*' @@ -46,7 +46,7 @@ loop_var: line_item register: __sap_install_media_detect_register_find_result_phase_1b -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Set fact from find result, phase 1b +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Set fact from find result, phase 1b ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1b: "{{ __sap_install_media_detect_fact_find_result_phase_1b + [item.1.path] }}" with_subelements: @@ -54,13 +54,13 @@ - files # Reason for noqa: Too much additional code required for determining if anything has changed or not -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when ansible.builtin.command: "mv {{ line_item }} {{ __sap_install_media_detect_software_main_directory }}/" loop: "{{ __sap_install_media_detect_fact_find_result_phase_1b }}" loop_control: loop_var: line_item -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Remove the relevant non-extract subdirectories +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Remove the relevant non-extract subdirectories ansible.builtin.file: path: "{{ line_item }}" state: absent @@ -68,7 +68,7 @@ loop_control: loop_var: line_item -- name: SAP Install Media Detect - Prepare - Search known subdirectories - Remove the extract subdirectories +- name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Remove the extract subdirectories ansible.builtin.file: path: "{{ line_item }}" state: absent From 9977eb4016f891302daecfce17a917ce1479432a Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 26 Jun 2024 01:11:59 +0100 Subject: [PATCH 030/210] sap_install_media_detect: append loop labels --- .../tasks/prepare/create_file_list_phase_1.yml | 2 ++ .../tasks/prepare/create_file_list_phase_2.yml | 4 ++++ .../tasks/prepare/move_files_to_main_directory.yml | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml index 56f0835f7..a6dc3b570 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_1.yml @@ -25,6 +25,8 @@ ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1: "{{ __sap_install_media_detect_fact_find_result_phase_1 + [item.path] }}" loop: "{{ __sap_install_media_detect_register_find_result_phase_1.files }}" + loop_control: + label: "{{ item.path }}" # If more than one SAPCAR file is found, we will use the last one. - name: SAP Install Media Detect - Prepare - Identify sapcar diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index 355836b98..3219e613c 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -21,6 +21,8 @@ ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_2: "{{ __sap_install_media_detect_fact_find_result_phase_2 + [item.path] }}" loop: "{{ __sap_install_media_detect_register_find_result_phase_2.files }}" + loop_control: + label: "{{ item.path }}" - name: SAP Install Media Detect - Prepare - Iterate over files and determine file type ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --lsar_file={{ __sap_install_media_detect_rar_list.split(' ')[0] }} --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" @@ -34,6 +36,8 @@ ansible.builtin.set_fact: __sap_install_media_detect_fact_files_sapfile_results: "{{ __sap_install_media_detect_fact_files_sapfile_results + [__new_dict] }}" loop: "{{ __sap_install_media_detect_register_files_phase_2.results }}" + loop_control: + label: "{{ item.stdout.split(';')[0] }}" vars: __new_dict: dir: "{{ item.stdout.split(';')[0] | dirname }}" diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 5bfae97f1..667370aa0 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -46,9 +46,9 @@ - name: SAP Install Media Detect - Prepare - Set fact from find result, phase 1b ansible.builtin.set_fact: __sap_install_media_detect_fact_find_result_phase_1b: "{{ __sap_install_media_detect_fact_find_result_phase_1b + [item.1.path] }}" - with_subelements: - - "{{ __sap_install_media_detect_register_find_result_phase_1b.results }}" - - files + loop: "{{ __sap_install_media_detect_register_find_result_phase_1b.results | subelements('files') }}" + loop_control: + label: "{{ item.path }}" # Reason for noqa: Too much additional code required for determining if anything has changed or not - name: SAP Install Media Detect - Prepare - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when From 7572e1213d851ca32bb6438cc06e43c8fb42a1e7 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 26 Jun 2024 01:35:16 +0100 Subject: [PATCH 031/210] sap_install_media_detect: fix label list reference --- .../tasks/prepare/move_files_to_main_directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 667370aa0..2290863ef 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -48,7 +48,7 @@ __sap_install_media_detect_fact_find_result_phase_1b: "{{ __sap_install_media_detect_fact_find_result_phase_1b + [item.1.path] }}" loop: "{{ __sap_install_media_detect_register_find_result_phase_1b.results | subelements('files') }}" loop_control: - label: "{{ item.path }}" + label: "{{ item.1.path }}" # Reason for noqa: Too much additional code required for determining if anything has changed or not - name: SAP Install Media Detect - Prepare - Move files back to '{{ __sap_install_media_detect_software_main_directory }}' # noqa no-changed-when From 8da68b348b2624286ec63e6c99591e9da92721f9 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:08:18 +0200 Subject: [PATCH 032/210] docs(CONTRIBUTORS): update with more names taken from galaxy.yml --- docs/CONTRIBUTORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/CONTRIBUTORS.md b/docs/CONTRIBUTORS.md index 9a31cb7ac..06e92afc0 100644 --- a/docs/CONTRIBUTORS.md +++ b/docs/CONTRIBUTORS.md @@ -12,10 +12,13 @@ - **Bernd Finger** - Developer of sap_*_preconfigure Ansible Roles and project co-owner - **Marcos Entenza** - Primary Developer of Ansible Roles - **Ricardo Garcia** - Primary Developer of Ansible Roles + - **Janine Fuchs** - Developer of Ansible Roles + - **Markus Moster** - Developer of Ansible Roles - **SVA** - **Thomas Bludau** - Origin developer of SAP installation Ansible automation (2019) and project co-owner - **Rainer Leber** - Developer of Ansible Collection (SLES code) - **SUSE** - SUSE SAP Emerging Technology Solutions + - **Steven Stringer** - Developer of Ansible Collection - **Marcel Mamula** - SAP solution architect and developer of Ansible Collection - **Gabriele Puliti** - Developer of Ansible Collection From 25962591e9513682570c945f125e0c3fcf9cdca7 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 26 Jun 2024 16:58:11 +0200 Subject: [PATCH 033/210] sap_hana_preconfigure: Add RHEL 9.4 requirements Solves issue #776. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/vars/RedHat_9.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 495f1ef06..8c3b476b6 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -5,6 +5,7 @@ __sap_hana_preconfigure_supported_rhel_minor_releases: - "9.0" - "9.2" + - "9.4" # required repos for RHEL 9: __sap_hana_preconfigure_req_repos_redhat_9_0_x86_64: @@ -119,13 +120,13 @@ __sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: # required SAP notes for RHEL 9: __sap_hana_preconfigure_sapnotes_versions_x86_64: - - { number: '3108302', version: '8' } + - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - { number: '3024346', version: '3' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '90' } - - { number: '3108302', version: '8' } + - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - { number: '3024346', version: '3' } @@ -159,8 +160,10 @@ __sap_hana_preconfigure_min_packages_9_3_x86_64: __sap_hana_preconfigure_min_packages_9_3_ppc64le: __sap_hana_preconfigure_min_packages_9_4_x86_64: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] __sap_hana_preconfigure_min_packages_9_4_ppc64le: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] __sap_hana_preconfigure_min_packages_9_5_x86_64: From 9f4671dbc629ad342c7f17a588cbf1c18f84b0c8 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 26 Jun 2024 16:52:56 +0100 Subject: [PATCH 034/210] sap_general_preconfigure: Improvements to DNS A/PTR checks and task texts --- .../RedHat/generic/check-dns-name-resolution.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index 79b209bfa..fb354bd6f 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -1,23 +1,20 @@ --- -- name: Check forward dns record (A) +- name: "Verify the correct DNS hostname to IP address resolution (A record) for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}" ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false - #ignore_errors: true register: __sap_general_preconfigure_register_dns_test_a failed_when: __sap_general_preconfigure_register_dns_test_a.rc != 0 ### BUG: dig does not use search path in resolv.con on PPCle -- name: Check resolv.conf settings +- name: "Verify the correct DNS hostname to IP address resolution (A record) using the hostname and the search list for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}" ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false -#ignore_errors: true - register: __sap_general_preconfigure_register_dns_test_resolvconf - failed_when: __sap_general_preconfigure_register_dns_test_resolvconf.rc != 0 + register: __sap_general_preconfigure_register_dns_test_searchlist + failed_when: __sap_general_preconfigure_register_dns_test_searchlist.rc != 0 -- name: Check reverse dns record (PTR) +- name: "Verify the correct DNS IP address to FQDN resolution (PTR record) for {{ sap_general_preconfigure_ip }}" ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}." - changed_when: false - #ignore_errors: true + changed_when: false register: __sap_general_preconfigure_register_dns_test_ptr failed_when: __sap_general_preconfigure_register_dns_test_ptr.rc != 0 From d1c0d9dc03497ef6cb1ac3cd653c000bb7bda0c4 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 26 Jun 2024 16:57:55 +0100 Subject: [PATCH 035/210] sap_general_preconfigure: Improvements to DNS A/PTR checks and task texts --- .../tasks/RedHat/generic/check-dns-name-resolution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index fb354bd6f..2ceae2075 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -15,6 +15,6 @@ - name: "Verify the correct DNS IP address to FQDN resolution (PTR record) for {{ sap_general_preconfigure_ip }}" ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}." - changed_when: false + changed_when: false register: __sap_general_preconfigure_register_dns_test_ptr failed_when: __sap_general_preconfigure_register_dns_test_ptr.rc != 0 From fad0b4cffae6b06aa08355267f6da7bc20db76d7 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Wed, 26 Jun 2024 16:59:17 +0100 Subject: [PATCH 036/210] sap_general_preconfigure: Improvements to DNS A/PTR checks and task texts and comments --- .../tasks/RedHat/generic/check-dns-name-resolution.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index 2ceae2075..2efbcc93b 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -6,7 +6,7 @@ register: __sap_general_preconfigure_register_dns_test_a failed_when: __sap_general_preconfigure_register_dns_test_a.rc != 0 -### BUG: dig does not use search path in resolv.con on PPCle +### BUG: dig does not use search path in resolv.conf on PPCle - name: "Verify the correct DNS hostname to IP address resolution (A record) using the hostname and the search list for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}" ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false From b402fd22bce2a7ad6641ee74205b37cb6c7ec0f3 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 27 Jun 2024 13:31:57 +0200 Subject: [PATCH 037/210] sap_general_preconfigure: Revert to ignoring DNS failures Solves issue #784. Signed-off-by: Bernd Finger --- roles/sap_general_preconfigure/defaults/main.yml | 4 ++++ .../tasks/RedHat/generic/check-dns-name-resolution.yml | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/roles/sap_general_preconfigure/defaults/main.yml b/roles/sap_general_preconfigure/defaults/main.yml index 6824bcd15..5cef8b737 100644 --- a/roles/sap_general_preconfigure/defaults/main.yml +++ b/roles/sap_general_preconfigure/defaults/main.yml @@ -146,6 +146,10 @@ sap_general_preconfigure_kernel_parameters: "{{ __sap_general_preconfigure_kerne sap_general_preconfigure_max_hostname_length: '13' # The maximum length of the hostname. See SAP note 611361. +sap_general_preconfigure_ignore_dns_failures: true +# Set to `false` for failing the role if one of the DNS name resolution check fails. The default is to +# report such errors and continue running the role. + # If "global" variables are set, use those. If not, default to the values from gather_facts: sap_general_preconfigure_ip: "{{ sap_ip | d(ansible_default_ipv4.address) }}" # The IPV4 address to be used for updating or checking `/etc/hosts` entries. diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml index 8c6106e9f..8abf1fc55 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/check-dns-name-resolution.yml @@ -1,21 +1,24 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: "Verify the correct DNS hostname to IP address resolution (A record) for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}" +- name: "Verify the correct DNS hostname to IP address resolution (A record)" ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false register: __sap_general_preconfigure_register_dns_test_a failed_when: __sap_general_preconfigure_register_dns_test_a.rc != 0 + ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}" ### BUG: dig does not use search path in resolv.conf on PPCle -- name: "Verify the correct DNS hostname to IP address resolution (A record) using the hostname and the search list for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}" +- name: "Verify the correct DNS hostname to IP address resolution (A record) using hostname and search list" ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}" changed_when: false register: __sap_general_preconfigure_register_dns_test_searchlist failed_when: __sap_general_preconfigure_register_dns_test_searchlist.rc != 0 + ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}" -- name: "Verify the correct DNS IP address to FQDN resolution (PTR record) for {{ sap_general_preconfigure_ip }}" +- name: "Verify the correct DNS IP address to FQDN resolution (PTR record)" ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}." changed_when: false register: __sap_general_preconfigure_register_dns_test_ptr failed_when: __sap_general_preconfigure_register_dns_test_ptr.rc != 0 + ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}" From 034ec74070d1f72301d2b0e299c0e6aae74eebb6 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:04:46 +0100 Subject: [PATCH 038/210] sap_ha_install_anydb_ibmdb2: fix ssh keygen command exec --- roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 8602eff50..0bfd28487 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -22,7 +22,7 @@ ansible.builtin.shell: | [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] && \ [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ - ssh-keygen -t rsa -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} -N "" -q && + ssh-keygen -t rsa -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} -N "" -q args: creates: /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub failed_when: false From 40f8e4e8889ad67b5102cfc374d7cb602ff6e17b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:05:32 +0100 Subject: [PATCH 039/210] sap_ha_install_anydb_ibmdb2: comment out platforms to detect --- .../platform/ascertain_platform_type.yml | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index baeac8265..613c11a8a 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -57,11 +57,11 @@ ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_gcp_ce_vm -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server - when: - - ansible_chassis_asset_tag == 'ibmcloud' - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server +# when: +# - ansible_chassis_asset_tag == 'ibmcloud' +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Microsoft Azure Virtual Machine when: @@ -70,45 +70,45 @@ ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_msazure_vm -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check - ansible.builtin.shell: | - set -o pipefail && rpm -qa | grep -E -e "rsct.basic" - register: __sap_ha_install_anydb_ibmdb2_power_rsct_check - changed_when: false - when: ansible_architecture == "ppc64le" +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check +# ansible.builtin.shell: | +# set -o pipefail && rpm -qa | grep -E -e "rsct.basic" +# register: __sap_ha_install_anydb_ibmdb2_power_rsct_check +# changed_when: false +# when: ansible_architecture == "ppc64le" -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check - ansible.builtin.fail: - msg: Please install RSCT from IBM Power Systems service and productivity tools repository - when: - - ansible_architecture == "ppc64le" - - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout == "" +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check +# ansible.builtin.fail: +# msg: Please install RSCT from IBM Power Systems service and productivity tools repository +# when: +# - ansible_architecture == "ppc64le" +# - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout == "" -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check - ansible.builtin.shell: | - /opt/rsct/bin/ctgethscid - register: __sap_ha_install_anydb_ibmdb2_power_rsct_hscid - changed_when: false - when: - - ansible_architecture == "ppc64le" - - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout != "" +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check +# ansible.builtin.shell: | +# /opt/rsct/bin/ctgethscid +# register: __sap_ha_install_anydb_ibmdb2_power_rsct_hscid +# changed_when: false +# when: +# - ansible_architecture == "ppc64le" +# - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout != "" -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power Virtual Server from IBM Cloud - when: - - ansible_architecture == "ppc64le" - - '"ibmcloud" in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power Virtual Server from IBM Cloud +# when: +# - ansible_architecture == "ppc64le" +# - '"ibmcloud" in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs -- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM PowerVM - when: - - ansible_architecture == "ppc64le" - - '"ibmcloud" not in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM PowerVM +# when: +# - ansible_architecture == "ppc64le" +# - '"ibmcloud" not in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm -#- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is VMware vSphere" -# when: -# - ansible_virtualization_type == 'VMware' -# ansible.builtin.set_fact: -# __sap_ha_install_anydb_ibmdb2_platform: hyp_vmware_vsphere_vm +# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is VMware vSphere" +# when: +# - ansible_virtualization_type == 'VMware' +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: hyp_vmware_vsphere_vm From a783a05ea829f461baaae0bcee2bc49414ebe886 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:17:28 +0100 Subject: [PATCH 040/210] sap_ha_install_anydb_ibmdb2: update structure and exec logic --- roles/sap_ha_install_anydb_ibmdb2/README.md | 21 ++- .../defaults/main.yml | 28 +++- .../tasks/main.yml | 128 ++++++++++++++++-- .../tasks/platform/db2cm_cloud_aws_ec2_vs.yml | 76 +++++++++++ .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 1 + .../tasks/platform/db2cm_cloud_msazure_vm.yml | 104 ++++++++++++++ .../execute_db2cm_cloud_aws_ec2_vs.yml | 9 -- 7 files changed, 336 insertions(+), 31 deletions(-) create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml delete mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index d81f584d7..ef5d34a2a 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -25,6 +25,22 @@ Download IBM Db2 installation media from SAP Download Center on host, and set An These are listed in the default variables file, but commented-out to enforce the required variables: - [**sap_ha_install_anydb_ibmdb2** default parameters](defaults/main.yml) +## Requirements and Dependencies + +This Ansible Role is applicable to IBM Db2 11.5.8 and later, where the + +### Target host - Infrastructure Platforms + +Applicable for: + +- Amazon Web Services +- Google Cloud +- Microsoft Azure + +### Target host - Operating System requirements + +Designed for Linux operating systems, e.g. RHEL (7.x and 8.x) and SLES (15.x). + ## Execution Sample Ansible Playbook Execution: @@ -40,7 +56,6 @@ Sample Ansible Playbook Execution: ```yaml --- - hosts: all - become: true collections: - community.sap_install @@ -52,8 +67,8 @@ Sample Ansible Playbook Execution: sap_ha_install_anydb_ibmdb2_software_directory: /software/ibmdb2_extracted - name: Execute Ansible Role sap_ha_install_anydb_ibmdb2 - include_role: - name: { role: community.sap_install.sap_ha_install_anydb_ibmdb2 } + ansible.builtin.include_role: + name: community.sap_install.sap_ha_install_anydb_ibmdb2 ``` ## License diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml index 5b1305788..b1dc5b280 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -1,6 +1,26 @@ --- -# sap_ha_install_anydb_ibmdb2_hostname_primary: -# sap_ha_install_anydb_ibmdb2_hostname_secondary: -# sap_ha_install_anydb_ibmdb2_sid: -# sap_ha_install_anydb_ibmdb2_software_directory: +sap_ha_install_anydb_ibmdb2_sid: + +sap_ha_install_anydb_ibmdb2_hostname_primary: +sap_ha_install_anydb_ibmdb2_hostname_secondary: + +sap_ha_install_anydb_ibmdb2_software_directory: + + +sap_ha_install_anydb_ibmdb2_vip_primary_ip_address: "" + + +sap_ha_pacemaker_cluster_aws_access_key_id: "" +sap_ha_pacemaker_cluster_aws_secret_access_key: "" +sap_ha_install_anydb_ibmdb2_aws_vip_update_rt: "" + + +sap_ha_install_anydb_ibmdb2_msazure_app_client_id: "" +sap_ha_install_anydb_ibmdb2_msazure_app_client_secret: "" +sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port: 62500 + + +# WIP, unused at the moment but may be required +# sap_ha_install_anydb_ibmdb2_msazure_subscription_id: "" +# sap_ha_install_anydb_ibmdb2_msazure_tenant_id: "" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 841ff0d39..5298bd83f 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -15,6 +15,9 @@ # See Admin documentation for IBM Db2 with Integrated Cluster Manager (Linux Pacemaker) - https://www.ibm.com/docs/en/db2/11.5?topic=feature-integrated-solution-using-pacemaker # See Installation documentation for IBM Db2 with Integrated Cluster Manager (Linux Pacemaker) - https://www.ibm.com/docs/en/db2/11.5?topic=manager-installing-pacemaker-cluster +- name: SAP HA AnyDB - IBM Db2 HADR - Collect required facts + ansible.builtin.setup: + gather_subset: hardware,interfaces - name: SAP HA AnyDB - IBM Db2 HADR - Confirm IBM Db2 installation media is available ansible.builtin.find: @@ -71,19 +74,23 @@ paths: "{{ (__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path | dirname) + '/Linux/' + ('rhel' if ansible_os_family == 'RedHat' else 'suse' if ansible_os_family == 'Suse') }}" recurse: true file_type: file - patterns: "*.rpm" + patterns: + - "*.rpm" + excludes: + - "*debuginfo*" + - "*debugsource*" register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL ansible.builtin.dnf: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list }}" + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" state: present disable_gpg_check: true when: ansible_os_family == 'RedHat' - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES community.general.zypper: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list }}" + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" state: present disable_gpg_check: true when: ansible_os_family == 'Suse' @@ -106,7 +113,13 @@ recurse: true file_type: file patterns: db2cm - register: __sap_anydb_ibmdb2_db2cm + register: __sap_ha_install_anydb_ibmdb2_db2cm + failed_when: (__sap_ha_install_anydb_ibmdb2_db2cm.files | length) > 1 + + - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 cluster manager (db2cm) utility is not available + ansible.builtin.fail: + msg: IBM Db2 cluster manager (db2cm) utility is not available, cannot find file db2cm + when: not (__sap_ha_install_anydb_ibmdb2_db2cm.files | length > 0) - name: SAP HA AnyDB - IBM Db2 HADR - Ensure directory for db2cm binary ansible.builtin.file: @@ -116,7 +129,7 @@ - name: SAP HA AnyDB - IBM Db2 HADR - Copy db2cm binary to binary path ansible.builtin.copy: - src: "{{ __sap_anydb_ibmdb2_db2cm.files[0].path }}" + src: "{{ __sap_ha_install_anydb_ibmdb2_db2cm.files[0].path }}" remote_src: true dest: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin mode: '0755' @@ -126,40 +139,125 @@ - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script ansible.builtin.shell: | {{ __sap_ha_install_anydb_ibmdb2_pcmk.files[0].path }} -i + register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run + failed_when: not __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc == 0 and not 'Online Pacemaker service detected' in __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.stdout + + - name: SAP HA AnyDB - IBM Db2 HADR - Identify db2cppcmk shell script + ansible.builtin.find: + paths: "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + recurse: true + file_type: file + patterns: db2cppcmk + register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk + - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 resource agent scripts (db2cppcmk) utility is not available + ansible.builtin.fail: + msg: IBM Db2 resource agent scripts (db2cppcmk) utility is not available, cannot find file db2cppcmk + when: not (__sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files | length > 0) -- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block to create Linux Pacemaker cluster from AnyDB Primary node - when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - block: + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2cppcmk shell script + ansible.builtin.shell: | + {{ __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files[0].path }} -i # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Create Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout and create Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + # Assume 1 OS Network Interface until improvements can be made export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + + sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - sleep 90 + failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary + failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config2.stdout + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary + failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout - # - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker infrastructure platform resources using db2cm - # ansible.builtin.include_tasks: "platform/execute_db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" + # Use the IBM Db2 Command Line Processor + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm + register: __sap_ha_install_anydb_ibmdb2_config5 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + become: true + become_user: db2{{ sap_system_anydb_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 + db2 deactivate db $ibmdb2_sid + db2 activate db $ibmdb2_sid + failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + + - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm + ansible.builtin.include_tasks: "platform/db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" +# end of block + + +- name: SAP HA AnyDB - IBM Db2 HADR - Verify crm for IBM Db2 HA Linux Pacemaker initialisation + register: __sap_ha_install_anydb_ibmdb2_pcmk_check + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + crm --display=plain status full # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR - Verify AnyDB HA Linux Pacemaker initialisation +- name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisation register: __sap_ha_install_anydb_ibmdb2_init_check + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -list -- name: SAP HA AnyDB - IBM Db2 HADR - Display AnyDB HA config +- name: SAP HA AnyDB - IBM Db2 HADR - Display crm for IBM Db2 HA Linux Pacemaker initialisation + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_check.stdout_lines }}" + +- name: SAP HA AnyDB - IBM Db2 HADR - Display db2cm for IBM Db2 HA Linux Pacemaker initialisation + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_init_check.stdout_lines }}" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml new file mode 100644 index 000000000..0134693f0 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml @@ -0,0 +1,76 @@ +--- + +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Fence Agent Packages + ansible.builtin.package: + name: + - fence-agents-aws + - awscli + state: present + + +# IBM Db2 HADR on AWS EC2 VS +# www.ibm.com/support/pages/node/6829815 +# www.ibm.com/support/pages/node/6830009 +# Older documentation - www.ibm.com/support/pages/node/6359159 +# Older documentation - www.ibm.com/support/pages/node/6359155 + + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Virtual IP address for Primary Node using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_aws_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_aws_1.stdout + + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Provide AWS credentials and create Linux Pacemaker Fence Agent instantiation using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_aws_2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + #aws configure set aws_access_key_id "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" + #aws configure set aws_secret_access_key "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -fence + failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_aws_2.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for aws-vpc-move-ip using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_aws_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + #aws configure set aws_access_key_id "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" + #aws configure set aws_secret_access_key "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -rtb "{{ sap_ha_install_anydb_ibmdb2_aws_vip_update_rt }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_aws_3.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality + register: __sap_ha_install_anydb_ibmdb2_config_aws_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + + # Assume 1 OS Network Interface until improvements can be made + export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" + export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -0,0 +1 @@ +--- diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml new file mode 100644 index 000000000..21fa574af --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml @@ -0,0 +1,104 @@ +--- + +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Fence Agent Packages + ansible.builtin.package: + name: + - fence-agents-azure-arm + - socat + state: present + + +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Key + ansible.builtin.rpm_key: + state: present + key: https://packages.microsoft.com/keys/microsoft.asc + +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Repo Package for RHEL 9 + ansible.builtin.package: + name: https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm + state: present + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version == "9" + +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Repo Package for RHEL 8 + ansible.builtin.package: + name: https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm + state: present + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version == "8" + +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Package + ansible.builtin.package: + name: azure-cli + state: present + + +# IBM Db2 HADR on MS Azure VMs +# www.ibm.com/support/pages/node/6830479 +# Older documentation - www.ibm.com/support/pages/node/6829813 +# Legacy documentation - www.ibm.com/support/pages/node/6465977 + + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Virtual IP address for Primary Node using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_msazure_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_msazure_1.stdout + + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Provide MS Azure credentials and create Linux Pacemaker Fence Agent instantiation using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_msazure_2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" + export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" + #az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -fence + failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_msazure_2.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for azure-lb using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_msazure_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" + export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" + #az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -primarylbl "{{ sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_msazure_3.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality + register: __sap_ha_install_anydb_ibmdb2_config_msazure_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + + # Assume 1 OS Network Interface until improvements can be made + export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" + export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml deleted file mode 100644 index bc5043843..000000000 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/execute_db2cm_cloud_aws_ec2_vs.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -# # db2cm script must run as root -# - name: SAP HA AnyDB - IBM Db2 HADR - Update Infrastructure Platform configuration for Linux Pacemaker cluster using db2cm -# register: __sap_ha_install_anydb_ibmdb2_fence_config -# ansible.builtin.shell: | -# db2cm -create -aws -fence -# db2cm -create -aws -primaryVIP -rtb -profile -db -instance - From 79dd556299f50a34db8289650e427ec8207a12cf Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 30 Jun 2024 02:22:57 +0100 Subject: [PATCH 041/210] sap_ha_install_anydb_ibmdb2: update execution logic --- .../defaults/main.yml | 14 +- .../tasks/main.yml | 100 +++++++++++--- .../tasks/platform/db2cm_cloud_aws_ec2_vs.yml | 29 ++++- .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 123 ++++++++++++++++++ .../tasks/platform/db2cm_cloud_msazure_vm.yml | 30 ++++- 5 files changed, 259 insertions(+), 37 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml index b1dc5b280..20bd2d898 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -10,17 +10,11 @@ sap_ha_install_anydb_ibmdb2_software_directory: sap_ha_install_anydb_ibmdb2_vip_primary_ip_address: "" - -sap_ha_pacemaker_cluster_aws_access_key_id: "" -sap_ha_pacemaker_cluster_aws_secret_access_key: "" +sap_ha_install_anydb_ibmdb2_aws_access_key_id: "" +sap_ha_install_anydb_ibmdb2_aws_secret_access_key: "" sap_ha_install_anydb_ibmdb2_aws_vip_update_rt: "" - +sap_ha_install_anydb_ibmdb2_msazure_tenant_id: "" sap_ha_install_anydb_ibmdb2_msazure_app_client_id: "" sap_ha_install_anydb_ibmdb2_msazure_app_client_secret: "" -sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port: 62500 - - -# WIP, unused at the moment but may be required -# sap_ha_install_anydb_ibmdb2_msazure_subscription_id: "" -# sap_ha_install_anydb_ibmdb2_msazure_tenant_id: "" +sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port: 62700 diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 5298bd83f..89b0083bf 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -38,6 +38,7 @@ ansible.builtin.import_tasks: platform/ascertain_platform_type.yml # See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat +# These are the HADR Ports used for internode communication, and are unrelated to Health Check probe port from a Load Balancer - name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services ansible.builtin.lineinfile: path: /etc/services @@ -160,11 +161,10 @@ {{ __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files[0].path }} -i # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout and create Linux Pacemaker cluster using db2cm + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm register: __sap_ha_install_anydb_ibmdb2_config1 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" @@ -175,10 +175,19 @@ export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" - sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + # db2cm script must run as root + # Setting to be performed on both Primary and Secondary node + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster + register: __sap_ha_install_anydb_ibmdb2_config1 + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf + failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + # db2cm script must run as root - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm register: __sap_ha_install_anydb_ibmdb2_config2 @@ -201,33 +210,50 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout - # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance - failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout - # Use the IBM Db2 Command Line Processor + # Setting to be performed on both Primary and Secondary node - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm register: __sap_ha_install_anydb_ibmdb2_config5 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short become: true - become_user: db2{{ sap_system_anydb_sid | lower }} + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 + failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + + # Use the IBM Db2 Command Line Processor + # Address SQL1363W - database must be shutdown and reactivated before the configuration parameter changes become effective + - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate + register: __sap_ha_install_anydb_ibmdb2_config5 + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 activate db $ibmdb2_sid failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + # db2cm script must run as root + # Ensure parameter HADR_PEER_WINDOW is set, otherwise will clustering-supported-cluster-management-software + # "Error: Please configure HADR_PEER_WINDOW for on instance on to a value of at least 60 seconds." + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout + - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm ansible.builtin.include_tasks: "platform/db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" @@ -239,6 +265,8 @@ when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | + crm --display=plain configure show + echo -e "\n\n" crm --display=plain status full # db2cm script must run as root @@ -250,6 +278,32 @@ export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -list +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration + register: __sap_ha_install_anydb_ibmdb2_hadr_config + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR status + register: __sap_ha_install_anydb_ibmdb2_hadr_status + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2pd -hadr -db $ibmdb2_sid + - name: SAP HA AnyDB - IBM Db2 HADR - Display crm for IBM Db2 HA Linux Pacemaker initialisation when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -261,3 +315,15 @@ - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_init_check.stdout_lines }}" + +- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR configuration + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_hadr_config.stdout_lines }}" + +- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR status + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_hadr_status.stdout_lines }}" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml index 0134693f0..0870e3ebf 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml @@ -16,6 +16,9 @@ # db2cm script must run as root +# When Virtual IP is already attached to OS Network Interface as Secondary IP +# (in advance by sap_vm_temp_vip or previous db2cm run), will cause +# "Error: ip address is pingable, use another ip address in the subnet that is not pingable." - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Virtual IP address for Primary Node using db2cm register: __sap_ha_install_anydb_ibmdb2_config_aws_1 when: @@ -27,9 +30,17 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_aws_1.stdout +# Setting to be performed on both Primary and Secondary node +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary and Secondary Node - Provide AWS CLI credentials + register: __sap_ha_install_anydb_ibmdb2_config_aws_credentials + when: + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" + ansible.builtin.shell: | + aws configure set aws_access_key_id "{{ sap_ha_install_anydb_ibmdb2_aws_access_key_id }}" + aws configure set aws_secret_access_key "{{ sap_ha_install_anydb_ibmdb2_aws_secret_access_key }}" # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Provide AWS credentials and create Linux Pacemaker Fence Agent instantiation using db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm register: __sap_ha_install_anydb_ibmdb2_config_aws_2 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -37,8 +48,6 @@ ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - #aws configure set aws_access_key_id "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" - #aws configure set aws_secret_access_key "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -fence failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_aws_2.stdout @@ -51,8 +60,6 @@ ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - #aws configure set aws_access_key_id "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" - #aws configure set aws_secret_access_key "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -rtb "{{ sap_ha_install_anydb_ibmdb2_aws_vip_update_rt }}" -db $ibmdb2_sid -instance $ibmdb2_instance failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_aws_3.stdout @@ -74,3 +81,15 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + + +# Deletion commands: +# export ibmdb2_sid="" +# export ibmdb2_instance="" +# export anydb_primary="" +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -primaryVIP -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -aws -primaryVIP -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -aws -fence +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -instance $ibmdb2_instance -host $anydb_primary +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -cluster -db $ibmdb2_sid -instance $ibmdb2_instance diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml index ed97d539c..c95236bce 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -1 +1,124 @@ --- + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages + ansible.builtin.package: + name: + - fence-agents-gce + # - resource-agents-gcp + state: present + + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Key + ansible.builtin.rpm_key: + state: present + key: https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Add + ansible.builtin.yum_repository: + name: Google Cloud CLI + baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64 + enabled: true + gpgcheck: true + repo_gpgcheck: false + gpgkey: + - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud CLI Package + ansible.builtin.package: + name: google-cloud-cli + state: present + + +# IBM Db2 HADR on GCP CE VMs +# https://www.ibm.com/support/pages/node/7071284 + +# db2cm script must run as root +# When Virtual IP is already attached to OS Network Interface as Secondary IP +# (in advance by sap_vm_temp_vip or previous db2cm run), will cause +# "Error: ip address is pingable, use another ip address in the subnet that is not pingable." +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Virtual IP address for Primary Node using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_gcp_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_gcp_1.stdout + +# # Setting to be performed on both Primary and Secondary node +# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials +# register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials +# when: +# - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" +# ansible.builtin.shell: | +# gcloud auth activate-service-account --key-file=file.json --project=name + +# # VERIFY - Missing fence_gce ? +# # db2cm script must run as root +# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm +# register: __sap_ha_install_anydb_ibmdb2_config_gcp_2 +# when: +# - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short +# - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" +# ansible.builtin.shell: | +# export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" +# export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -fence +# failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_gcp_2.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for gcp-ilb using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_gcp_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -primarylbl "{{ sap_ha_install_anydb_ibmdb2_gcp_lb_health_check_port }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_3.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for Virtual IP via IPAddr2 using db2cm + register: __sap_ha_install_anydb_ibmdb2_config_gcp_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_4.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_4.stdout + +# db2cm script must run as root +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality + register: __sap_ha_install_anydb_ibmdb2_config_gcp_5 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + + # Assume 1 OS Network Interface until improvements can be made + export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" + export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all + /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + + +# Deletion commands: +# export ibmdb2_sid="" +# export ibmdb2_instance="" +# export anydb_primary="" +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -primaryVIP -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -gcp -primaryVIP -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -gcp -primarylbl -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -instance $ibmdb2_instance -host $anydb_primary +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -cluster -db $ibmdb2_sid -instance $ibmdb2_instance diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml index 21fa574af..1e0251e4f 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml @@ -8,7 +8,7 @@ state: present -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Key +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Repo Key ansible.builtin.rpm_key: state: present key: https://packages.microsoft.com/keys/microsoft.asc @@ -42,6 +42,9 @@ # db2cm script must run as root +# When Virtual IP is already attached to OS Network Interface as Secondary IP +# (in advance by sap_vm_temp_vip or previous db2cm run), will cause +# "Error: ip address is pingable, use another ip address in the subnet that is not pingable." - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Virtual IP address for Primary Node using db2cm register: __sap_ha_install_anydb_ibmdb2_config_msazure_1 when: @@ -51,11 +54,18 @@ export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance - failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_msazure_1.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_msazure_1.stdout +# Setting to be performed on both Primary and Secondary node +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary and Secondary Node - Provide MS Azure CLI credentials + register: __sap_ha_install_anydb_ibmdb2_config_msazure_credentials + when: + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" + ansible.builtin.shell: | + az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant "{{ sap_ha_install_anydb_ibmdb2_msazure_tenant_id }}" # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Provide MS Azure credentials and create Linux Pacemaker Fence Agent instantiation using db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm register: __sap_ha_install_anydb_ibmdb2_config_msazure_2 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -65,7 +75,6 @@ export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" - #az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -fence failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_msazure_2.stdout @@ -80,7 +89,6 @@ export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" - #az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -primarylbl "{{ sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port }}" -db $ibmdb2_sid -instance $ibmdb2_instance failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_msazure_3.stdout @@ -102,3 +110,15 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + + +# Deletion commands: +# export ibmdb2_sid="" +# export ibmdb2_instance="" +# export anydb_primary="" +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -primaryVIP -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -azure -primarylbl -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -azure -fence +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -instance $ibmdb2_instance -host $anydb_primary +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -db $ibmdb2_sid -instance $ibmdb2_instance +# /db2/$ibmdb2_instance/sqllib/bin/db2cm -delete -cluster -db $ibmdb2_sid -instance $ibmdb2_instance From 368c6135e4d4263ece911dea629608127b07398d Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:13:18 +0100 Subject: [PATCH 042/210] sap_ha_install_anydb_ibmdb2: append tasks for cfg and start db2 hadr --- .../defaults/main.yml | 4 + .../tasks/main.yml | 85 +++++++++++++++++++ .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 27 +++--- 3 files changed, 103 insertions(+), 13 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml index 20bd2d898..dfcddcac7 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -18,3 +18,7 @@ sap_ha_install_anydb_ibmdb2_msazure_tenant_id: "" sap_ha_install_anydb_ibmdb2_msazure_app_client_id: "" sap_ha_install_anydb_ibmdb2_msazure_app_client_secret: "" sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port: 62700 + +sap_ha_install_anydb_ibmdb2_gcp_credentials_json_file: "" +sap_ha_install_anydb_ibmdb2_gcp_project: "" +sap_ha_install_anydb_ibmdb2_gcp_lb_health_check_port: 62700 diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 89b0083bf..35b20eb5e 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -49,6 +49,91 @@ - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_2\t55002/tcp\t# DB2 HA Port 2" # DB2 HADR remote service (env var db2hadrremotesvc / HADR_REMOTE_SVC) when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + +# Use the IBM Db2 Command Line Processor +# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_primary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_1 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_secondary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_2 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid + db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + +# Use the IBM Db2 Command Line Processor +# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_secondary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_2 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_primary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_1 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 rollforward database $ibmdb2_sid to end of logs + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 start hadr on db $ibmdb2_sid as standby + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 start hadr on db $ibmdb2_sid as primary + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + - name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for Passwordless SSH ansible.builtin.import_tasks: passwordless_ssh.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml index c95236bce..6af8b08ca 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -1,11 +1,11 @@ --- -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages - ansible.builtin.package: - name: - - fence-agents-gce - # - resource-agents-gcp - state: present +# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages +# ansible.builtin.package: +# name: +# - fence-agents-gce +# - resource-agents-gcp +# state: present - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Key @@ -47,13 +47,14 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_gcp_1.stdout -# # Setting to be performed on both Primary and Secondary node -# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials -# register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials -# when: -# - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" -# ansible.builtin.shell: | -# gcloud auth activate-service-account --key-file=file.json --project=name +# Setting to be performed on both Primary and Secondary node +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials + register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials + when: + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" + ansible.builtin.shell: | + gcloud auth activate-service-account --key-file="{{ sap_ha_install_anydb_ibmdb2_gcp_credentials_json_file }}" --project="{{ sap_ha_install_anydb_ibmdb2_gcp_project }}" + gcloud debug targets list --quiet # # VERIFY - Missing fence_gce ? # # db2cm script must run as root From 7950cdce21953db6fad4a1d079c526440115de0b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:28:09 +0100 Subject: [PATCH 043/210] sap_ha_install_anydb_ibmdb2: fix readme note --- roles/sap_ha_install_anydb_ibmdb2/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index ef5d34a2a..38b6a60aa 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -27,7 +27,9 @@ These are listed in the default variables file, but commented-out to enforce the ## Requirements and Dependencies -This Ansible Role is applicable to IBM Db2 11.5.8 and later, where the +This Ansible Role is applicable to IBM Db2 11.5 certified for SAP. + +It is applicable to 11.5.9 and later, which provides `db2cm` binary compatibility for AWS, GCP and MS Azure. ### Target host - Infrastructure Platforms From 98472927ba3c5d14934f77226578459bd9bce558 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 1 Jul 2024 15:18:19 +0200 Subject: [PATCH 044/210] Playbooks: Update according to Bernd feedback --- playbooks/README.md | 1 + playbooks/sap_hana_preconfigure.yml | 2 +- playbooks/sap_hana_preconfigure_exec.yml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 234655068..232208478 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -55,3 +55,4 @@ Now you can run the playbook non-interactively with ```[bash] ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml ``` +NOTE: If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. \ No newline at end of file diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index ddc2c8f7a..4e0bba98b 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -30,7 +30,7 @@ - name: "sap_systems" prompt: "Enter comma separated list of systems, you want to prepare for SAP HANA" private: false - default: "localhost" + default: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" - name: "sap_domain" prompt: "Enter DNS Domainname of your SAP systems (leave empty for using system default: " diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 7aba5d088..bb51c506e 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -17,11 +17,12 @@ # sap_hana_preconfigure_reboot_ok: defaults to false - name: Prepare system for SAP HANA Installation - hosts: "{{ sap_hana_group | d('localhost') }}" + hosts: "{{ sap_hana_group | d((groups['all'] == []) | ternary ('localhost', groups['all'] | join(','))) }}" become: true tasks: - name: Ansible Role Configuration ansible.builtin.debug: + # sap_swpm_extract_directory testen !!! msg: |- From a920c9c5ac52220477150a057f31ce456968787b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:31:08 +0100 Subject: [PATCH 045/210] sap_ha_install_anydb_ibmdb2: add spdx license header --- roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml | 1 + roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml | 1 + roles/sap_ha_install_anydb_ibmdb2/meta/main.yml | 1 + roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml | 1 + roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml | 1 + roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml | 1 + .../tasks/platform/ascertain_platform_type.yml | 1 + .../tasks/platform/db2cm_cloud_aws_ec2_vs.yml | 1 + .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 1 + .../tasks/platform/db2cm_cloud_msazure_vm.yml | 1 + 10 files changed, 10 insertions(+) diff --git a/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml index 57ef427c1..ea7a6099f 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml index dfcddcac7..8c7a5dee2 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- sap_ha_install_anydb_ibmdb2_sid: diff --git a/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml b/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml index 4aa584a99..7c4f849fb 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/meta/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- galaxy_info: namespace: community diff --git a/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml b/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml index c2ea65887..acd7ad5ac 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml @@ -1,2 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 --- requires_ansible: '>=2.12.0' diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 35b20eb5e..cb04449fc 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # IBM Db2 with an Integrated Cluster Manager have various options. See IBM Db2 Supported cluster management software - https://www.ibm.com/docs/en/db2/11.5?topic=clustering-supported-cluster-management-software diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 0bfd28487..9b4d00ff3 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for passwordless SSH between AnyDB Primary and Secondary diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index 613c11a8a..07e980744 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Platform detection for cloud and other infrastructure platforms. diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml index 0870e3ebf..eedc3ed91 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Fence Agent Packages diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml index 6af8b08ca..e55875f56 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml index 1e0251e4f..c9c1bfb11 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Fence Agent Packages From 6c70b492d916a03c416245350b34a367e8eb9515 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:32:55 +0100 Subject: [PATCH 046/210] sap_ha_install_anydb_ibmdb2: fix typos with ascii quotes --- roles/sap_ha_install_anydb_ibmdb2/README.md | 4 ++-- roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index 38b6a60aa..c96936ec0 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -2,9 +2,9 @@ # sap_ha_install_anydb_ibmdb2 Ansible Role -Ansible Role for instantiation of IBM Db2 “Integrated Linux Pacemaker” HADR cluster +Ansible Role for instantiation of IBM Db2 'Integrated Linux Pacemaker' HADR cluster -Note: IBM Db2 with “Integrated Linux Pacemaker” can use two deployment models: +Note: IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models: - Mutual Failover option, not covered by this Ansible Role - High Availability and Disaster Recovery (HADR) option for Idle Standby, initialised by this Ansible Role diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index cb04449fc..3983e2616 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -2,9 +2,9 @@ --- # IBM Db2 with an Integrated Cluster Manager have various options. See IBM Db2 Supported cluster management software - https://www.ibm.com/docs/en/db2/11.5?topic=clustering-supported-cluster-management-software -# IBM Db2 with “Integrated Linux Pacemaker” can use two deployment models, either High Availability and Disaster Recovery (HADR) option for Idle Standby or Mutual Failover option +# IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models, either High Availability and Disaster Recovery (HADR) option for Idle Standby or Mutual Failover option -# Execute IBM Db2 with “Integrated Linux Pacemaker” using Resource Agents db2ethmon, db2inst (HADR), db2hadr (HADR), db2partition and db2fs +# Execute IBM Db2 with 'Integrated Linux Pacemaker' using Resource Agents db2ethmon, db2inst (HADR), db2hadr (HADR), db2partition and db2fs # HA Deployment Model: High Availability and Disaster Recovery (HADR) for Idle Standby # Configurations performed for: root OS user, IBM Db2 Database Administrator OS user (e.g. db2) # Configurations executed on: AnyDB Primary Node, AnyDB Secondary Node @@ -139,7 +139,7 @@ ansible.builtin.import_tasks: passwordless_ssh.yml -- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for IBM Db2 “Integrated Linux Pacemaker” configuration +- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for IBM Db2 'Integrated Linux Pacemaker' configuration when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) block: From 822ecdec84174593e6df54b511ad22597554eb0a Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 1 Jul 2024 15:41:36 +0200 Subject: [PATCH 047/210] playbooks: little simplification and README update --- playbooks/README.md | 7 +++++-- playbooks/sap_hana_preconfigure_exec.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 232208478..542ff16fd 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -16,6 +16,9 @@ Run the following command: ansible-playbook community.sap_install.sap_hana_preconfigure.yml ``` +This playbook runs against localhost and/or remote hosts. +Remote hosts can be defined in an inventory in a file, or with -i on the commandline e.g. `-i inventoryfile` or `-i host1,host2,host3,` and execution can be of course limited with -l. +Nonetheless you need to confirm the hosts in the interactive dialog. When you call this playbook against a remote host make sure the user can connect and assume root without a password or pass the following parameters if necessary ```[bash] @@ -24,7 +27,7 @@ When you call this playbook against a remote host make sure the user can connect -K: asks for the privilige escalation password of the connection user to become root on the target host ``` -If you want to embed this playbook or run non-interactive, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). +If you want to embed this playbook or run a non-interactive version, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). Create the file `my_inventory` similar to: @@ -35,7 +38,6 @@ hana2 ``` Prepare a variable config file with the following parameters (adapt to your needs): - Create a parameter file `my_vars` with similar content: ```[yaml] @@ -55,4 +57,5 @@ Now you can run the playbook non-interactively with ```[bash] ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml ``` + NOTE: If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. \ No newline at end of file diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index bb51c506e..fb5996566 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -17,7 +17,7 @@ # sap_hana_preconfigure_reboot_ok: defaults to false - name: Prepare system for SAP HANA Installation - hosts: "{{ sap_hana_group | d((groups['all'] == []) | ternary ('localhost', groups['all'] | join(','))) }}" + hosts: "{{ sap_hana_group | d((groups['all'] == []) | ternary ('localhost', 'all')) }}" become: true tasks: - name: Ansible Role Configuration From 29b959ed04fab9314b08c34bcccbb3b62e7dbb81 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:43:57 +0100 Subject: [PATCH 048/210] sap_ha_install_anydb_ibmdb2: amend file structure --- .../tasks/db2_hadr_enable.yml | 98 ++++++ .../tasks/db2_hadr_pcmk_cluster_create.yml | 208 ++++++++++++ .../tasks/main.yml | 319 +----------------- .../tasks/passwordless_ssh.yml | 2 + 4 files changed, 321 insertions(+), 306 deletions(-) create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml new file mode 100644 index 000000000..faf755b7b --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml @@ -0,0 +1,98 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat +# These are the HADR Ports used for internode communication, and are unrelated to Health Check probe port from a Load Balancer +- name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services + ansible.builtin.lineinfile: + path: /etc/services + line: "{{ item }}" + state: present + loop: + - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_1\t55001/tcp\t# DB2 HA Port 1" # DB2 HADR local service (env var db2hadrlocalsvc / HADR_LOCAL_SVC) + - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_2\t55002/tcp\t# DB2 HA Port 2" # DB2 HADR remote service (env var db2hadrremotesvc / HADR_REMOTE_SVC) + when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + + +# Use the IBM Db2 Command Line Processor +# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_primary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_1 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_secondary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_2 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid + db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + + +# Use the IBM Db2 Command Line Processor +# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_secondary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_2 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_primary + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_1 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC + db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 + db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 rollforward database $ibmdb2_sid to end of logs + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 start hadr on db $ibmdb2_sid as standby + when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + + +# Use the IBM Db2 Command Line Processor +- name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 start hadr on db $ibmdb2_sid as primary + when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml new file mode 100644 index 000000000..d421617df --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml @@ -0,0 +1,208 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for IBM Db2 'Integrated Linux Pacemaker' configuration + when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) + block: + + # IBM Db2 LUW for SAP installation media includes already extracted Db2_*_Pacemaker_*_<><>_<>.tar.gz + # Default install file is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/db2installPCMK + # Default RPM directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux + # Default SRPM (Source) directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux/SRPMS + - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 installation media with 'Integrated Linux Pacemaker' RPMs subdirectory + ansible.builtin.find: + paths: "{{ sap_ha_install_anydb_ibmdb2_software_directory }}" + recurse: true + file_type: file + patterns: db2installPCMK + excludes: bin + register: __sap_ha_install_anydb_ibmdb2_pcmk + + - name: SAP HA AnyDB - IBM Db2 HADR - List all IBM Db2 'Integrated Linux Pacemaker' RPMs in subdirectory + ansible.builtin.find: + paths: "{{ (__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path | dirname) + '/Linux/' + ('rhel' if ansible_os_family == 'RedHat' else 'suse' if ansible_os_family == 'Suse') }}" + recurse: true + file_type: file + patterns: + - "*.rpm" + excludes: + - "*debuginfo*" + - "*debugsource*" + register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files + + - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL + ansible.builtin.dnf: + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" + state: present + disable_gpg_check: true + when: ansible_os_family == 'RedHat' + + - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES + community.general.zypper: + name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" + state: present + disable_gpg_check: true + when: ansible_os_family == 'Suse' + + # SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software + - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed + register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check + ansible.builtin.shell: | + rpm -q corosync | grep -I db2pcmk + rpm -q pacemaker | grep -I db2pcmk + rpm -q crmsh | grep -I db2pcmk + + - name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 'Integrated Linux Pacemaker' installation details + ansible.builtin.debug: + msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_version_check.stdout_lines }}" + + - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 cluster manager (db2cm) utility + ansible.builtin.find: + paths: /db2 + recurse: true + file_type: file + patterns: db2cm + register: __sap_ha_install_anydb_ibmdb2_db2cm + failed_when: (__sap_ha_install_anydb_ibmdb2_db2cm.files | length) > 1 + + - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 cluster manager (db2cm) utility is not available + ansible.builtin.fail: + msg: IBM Db2 cluster manager (db2cm) utility is not available, cannot find file db2cm + when: not (__sap_ha_install_anydb_ibmdb2_db2cm.files | length > 0) + + - name: SAP HA AnyDB - IBM Db2 HADR - Ensure directory for db2cm binary + ansible.builtin.file: + path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin + mode: "0755" + state: directory + + - name: SAP HA AnyDB - IBM Db2 HADR - Copy db2cm binary to binary path + ansible.builtin.copy: + src: "{{ __sap_ha_install_anydb_ibmdb2_db2cm.files[0].path }}" + remote_src: true + dest: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin + mode: '0755' + + # - name: SAP HA AnyDB - IBM Db2 HADR - Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) + + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script + ansible.builtin.shell: | + {{ __sap_ha_install_anydb_ibmdb2_pcmk.files[0].path }} -i + register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run + failed_when: not __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc == 0 and not 'Online Pacemaker service detected' in __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.stdout + + - name: SAP HA AnyDB - IBM Db2 HADR - Identify db2cppcmk shell script + ansible.builtin.find: + paths: "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + recurse: true + file_type: file + patterns: db2cppcmk + register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk + + - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 resource agent scripts (db2cppcmk) utility is not available + ansible.builtin.fail: + msg: IBM Db2 resource agent scripts (db2cppcmk) utility is not available, cannot find file db2cppcmk + when: not (__sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files | length > 0) + + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2cppcmk shell script + ansible.builtin.shell: | + {{ __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files[0].path }} -i + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + + # Assume 1 OS Network Interface until improvements can be made + export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" + export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" + + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + + # db2cm script must run as root + # Setting to be performed on both Primary and Secondary node + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster + register: __sap_ha_install_anydb_ibmdb2_config1 + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf + failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary + failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config2.stdout + + # db2cm script must run as root + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary + failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout + + # Use the IBM Db2 Command Line Processor + # Setting to be performed on both Primary and Secondary node + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm + register: __sap_ha_install_anydb_ibmdb2_config5 + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 + failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + + # Use the IBM Db2 Command Line Processor + # Address SQL1363W - database must be shutdown and reactivated before the configuration parameter changes become effective + - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate + register: __sap_ha_install_anydb_ibmdb2_config5 + # when: + # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 activate db $ibmdb2_sid + failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + + # db2cm script must run as root + # Ensure parameter HADR_PEER_WINDOW is set, otherwise will clustering-supported-cluster-management-software + # "Error: Please configure HADR_PEER_WINDOW for on instance on to a value of at least 60 seconds." + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm + register: __sap_ha_install_anydb_ibmdb2_config4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + ansible.builtin.shell: | + export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" + /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance + failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout + + - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm + ansible.builtin.include_tasks: "platform/db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" + +# end of block diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 3983e2616..91224191f 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -1,13 +1,17 @@ # SPDX-License-Identifier: Apache-2.0 --- -# IBM Db2 with an Integrated Cluster Manager have various options. See IBM Db2 Supported cluster management software - https://www.ibm.com/docs/en/db2/11.5?topic=clustering-supported-cluster-management-software -# IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models, either High Availability and Disaster Recovery (HADR) option for Idle Standby or Mutual Failover option +# IBM Db2 with an Integrated Cluster Manager permits various options, such as the option to use 'Integrated Linux Pacemaker'. +# See IBM Db2 Supported cluster management software - https://www.ibm.com/docs/en/db2/11.5?topic=clustering-supported-cluster-management-software + +# IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models, either: +# - High Availability and Disaster Recovery (HADR) option for Idle Standby. Used by this Ansible Role. +# - Mutual Failover option # Execute IBM Db2 with 'Integrated Linux Pacemaker' using Resource Agents db2ethmon, db2inst (HADR), db2hadr (HADR), db2partition and db2fs # HA Deployment Model: High Availability and Disaster Recovery (HADR) for Idle Standby # Configurations performed for: root OS user, IBM Db2 Database Administrator OS user (e.g. db2) -# Configurations executed on: AnyDB Primary Node, AnyDB Secondary Node +# Configurations executed on: IBM Db2 Primary Node, IBM Db2 Secondary Node # See SAP Note 1555903 - DB6: Supported IBM Db2 Database Features # See SAP Note 3100330 - DB6: Using Db2 HADR with Pacemaker Cluster Software @@ -34,316 +38,19 @@ msg: IBM Db2 installation media is not available, cannot find file db2installPCMK when: not (__sap_ha_install_anydb_ibmdb2_check_install_media.files | length > 0) -# Determine if we are on a cloud platform. + +# Determine infrastructure platform - name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for platform detection ansible.builtin.import_tasks: platform/ascertain_platform_type.yml -# See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat -# These are the HADR Ports used for internode communication, and are unrelated to Health Check probe port from a Load Balancer -- name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services - ansible.builtin.lineinfile: - path: /etc/services - line: "{{ item }}" - state: present - loop: - - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_1\t55001/tcp\t# DB2 HA Port 1" # DB2 HADR local service (env var db2hadrlocalsvc / HADR_LOCAL_SVC) - - "{{ sap_ha_install_anydb_ibmdb2_sid }}_HADR_2\t55002/tcp\t# DB2 HA Port 2" # DB2 HADR remote service (env var db2hadrremotesvc / HADR_REMOTE_SVC) - when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) - - -# Use the IBM Db2 Command Line Processor -# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ -- name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" - set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_primary - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_1 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_secondary - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_2 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid - db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 - when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - -# Use the IBM Db2 Command Line Processor -# See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ -- name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" - set anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_HOST $anydb_secondary - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_LOCAL_SVC "$ibmdb2_sid"_HADR_2 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_HOST $anydb_primary - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_SVC "$ibmdb2_sid"_HADR_1 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_REMOTE_INST db2$ibmdb2_sid - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_TIMEOUT 120 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC - db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 - db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - -# Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 rollforward database $ibmdb2_sid to end of logs - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - -# Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 deactivate db $ibmdb2_sid - db2 start hadr on db $ibmdb2_sid as standby - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - -# Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 deactivate db $ibmdb2_sid - db2 start hadr on db $ibmdb2_sid as primary - when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - +- name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for IBM Db2 HADR functionality + ansible.builtin.import_tasks: db2_hadr_enable.yml - name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for Passwordless SSH ansible.builtin.import_tasks: passwordless_ssh.yml - -- name: SAP HA AnyDB - IBM Db2 HADR - Ansible Task Block for IBM Db2 'Integrated Linux Pacemaker' configuration - when: (sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short) or (sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short) - block: - - # IBM Db2 LUW for SAP installation media includes already extracted Db2_*_Pacemaker_*_<><>_<>.tar.gz - # Default install file is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/db2installPCMK - # Default RPM directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux - # Default SRPM (Source) directory is /install_media/LINUXX86_64/ESE/disk1/db2/linuxamd64/pcmk/Linux/SRPMS - - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 installation media with 'Integrated Linux Pacemaker' RPMs subdirectory - ansible.builtin.find: - paths: "{{ sap_ha_install_anydb_ibmdb2_software_directory }}" - recurse: true - file_type: file - patterns: db2installPCMK - excludes: bin - register: __sap_ha_install_anydb_ibmdb2_pcmk - - - name: SAP HA AnyDB - IBM Db2 HADR - List all IBM Db2 'Integrated Linux Pacemaker' RPMs in subdirectory - ansible.builtin.find: - paths: "{{ (__sap_ha_install_anydb_ibmdb2_pcmk.files[0].path | dirname) + '/Linux/' + ('rhel' if ansible_os_family == 'RedHat' else 'suse' if ansible_os_family == 'Suse') }}" - recurse: true - file_type: file - patterns: - - "*.rpm" - excludes: - - "*debuginfo*" - - "*debugsource*" - register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files - - - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL - ansible.builtin.dnf: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" - state: present - disable_gpg_check: true - when: ansible_os_family == 'RedHat' - - - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES - community.general.zypper: - name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" - state: present - disable_gpg_check: true - when: ansible_os_family == 'Suse' - - # SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software - - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed - register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check - ansible.builtin.shell: | - rpm -q corosync | grep -I db2pcmk - rpm -q pacemaker | grep -I db2pcmk - rpm -q crmsh | grep -I db2pcmk - - - name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 'Integrated Linux Pacemaker' installation details - ansible.builtin.debug: - msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_version_check.stdout_lines }}" - - - name: SAP HA AnyDB - IBM Db2 HADR - Identify IBM Db2 cluster manager (db2cm) utility - ansible.builtin.find: - paths: /db2 - recurse: true - file_type: file - patterns: db2cm - register: __sap_ha_install_anydb_ibmdb2_db2cm - failed_when: (__sap_ha_install_anydb_ibmdb2_db2cm.files | length) > 1 - - - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 cluster manager (db2cm) utility is not available - ansible.builtin.fail: - msg: IBM Db2 cluster manager (db2cm) utility is not available, cannot find file db2cm - when: not (__sap_ha_install_anydb_ibmdb2_db2cm.files | length > 0) - - - name: SAP HA AnyDB - IBM Db2 HADR - Ensure directory for db2cm binary - ansible.builtin.file: - path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin - mode: "0755" - state: directory - - - name: SAP HA AnyDB - IBM Db2 HADR - Copy db2cm binary to binary path - ansible.builtin.copy: - src: "{{ __sap_ha_install_anydb_ibmdb2_db2cm.files[0].path }}" - remote_src: true - dest: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/sqllib/bin - mode: '0755' - - # - name: SAP HA AnyDB - IBM Db2 HADR - Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) - - - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script - ansible.builtin.shell: | - {{ __sap_ha_install_anydb_ibmdb2_pcmk.files[0].path }} -i - register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run - failed_when: not __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc == 0 and not 'Online Pacemaker service detected' in __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.stdout - - - name: SAP HA AnyDB - IBM Db2 HADR - Identify db2cppcmk shell script - ansible.builtin.find: - paths: "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - recurse: true - file_type: file - patterns: db2cppcmk - register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk - - - name: SAP HA AnyDB - IBM Db2 HADR - Fail if IBM Db2 resource agent scripts (db2cppcmk) utility is not available - ansible.builtin.fail: - msg: IBM Db2 resource agent scripts (db2cppcmk) utility is not available, cannot find file db2cppcmk - when: not (__sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files | length > 0) - - - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2cppcmk shell script - ansible.builtin.shell: | - {{ __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files[0].path }} -i - - # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config1 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" - export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" - - # Assume 1 OS Network Interface until improvements can be made - export anydb_primary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.interface }}" - export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" - - /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout - - # db2cm script must run as root - # Setting to be performed on both Primary and Secondary node - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster - register: __sap_ha_install_anydb_ibmdb2_config1 - # when: - # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf - failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout - - # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config2 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" - /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary - failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config2.stdout - - # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config3 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" - /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary - failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout - - # Use the IBM Db2 Command Line Processor - # Setting to be performed on both Primary and Secondary node - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm - register: __sap_ha_install_anydb_ibmdb2_config5 - # when: - # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 - failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout - - # Use the IBM Db2 Command Line Processor - # Address SQL1363W - database must be shutdown and reactivated before the configuration parameter changes become effective - - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate - register: __sap_ha_install_anydb_ibmdb2_config5 - # when: - # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 deactivate db $ibmdb2_sid - db2 activate db $ibmdb2_sid - failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout - - # db2cm script must run as root - # Ensure parameter HADR_PEER_WINDOW is set, otherwise will clustering-supported-cluster-management-software - # "Error: Please configure HADR_PEER_WINDOW for on instance on to a value of at least 60 seconds." - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" - /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance - failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout - - - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm - ansible.builtin.include_tasks: "platform/db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" - -# end of block +- name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for IBM Db2 HADR with 'Integrated Linux Pacemaker' cluster + ansible.builtin.import_tasks: db2_hadr_pcmk_cluster_create.yml - name: SAP HA AnyDB - IBM Db2 HADR - Verify crm for IBM Db2 HA Linux Pacemaker initialisation diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 9b4d00ff3..024a67cc7 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -209,3 +209,5 @@ owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +# end of block From 2f668b0c4fb9c9a532f7f2d4021a2849d9cae105 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 1 Jul 2024 15:45:16 +0200 Subject: [PATCH 049/210] playbook sap_hana_preconfigure.yml usage update --- playbooks/sap_hana_preconfigure.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 4e0bba98b..9f28d7599 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -21,6 +21,10 @@ * The minimum viable parameters to succussfully prepare your system for an * * SAP HANA installation will be asked. * * Useful defaults will be set, so that it is save to just press enter * + * * + * If you want to run these steps unattended, please use the playbook * + * sap_hana_preconfigure_exec.yml instead with a properly prepared variable * + * file. (See README for more details) * ***************************************************************************** - name: Collecting Variables From 1a343dd5c7fe0d780f8bdb0dca461f87a006afb2 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 2 Jul 2024 16:59:09 +0200 Subject: [PATCH 050/210] Enhance corosync totem handling --- .../tasks/construct_vars_common.yml | 34 +++++++++++++++---- .../vars/platform_cloud_aws_ec2_vs.yml | 6 ++-- .../vars/platform_cloud_gcp_ce_vm.yml | 4 +-- .../vars/platform_cloud_msazure_vm.yml | 5 +++ .../sap_ha_pacemaker_cluster/vars/redhat.yml | 4 +++ roles/sap_ha_pacemaker_cluster/vars/suse.yml | 9 +++++ 6 files changed, 51 insertions(+), 11 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index 3c5455e1c..8a5bd6dc3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -48,18 +48,38 @@ + __sap_ha_pacemaker_cluster_fence_agent_packages) | unique }}" -- name: "SAP HA Prepare Pacemaker - Add default corosync totem settings" - when: - - sap_ha_pacemaker_cluster_corosync_totem is defined - - sap_ha_pacemaker_cluster_corosync_totem.options is defined - - sap_ha_pacemaker_cluster_corosync_totem.options | length > 0 +# Prepare corosync totem variable with either: +# - User provided sap_ha_pacemaker_cluster_corosync_totem if present +# - Combine corosync totem from OS variables and Platform variables if present +# - Use default corosync totem from OS variables if Platform variable is not present +- name: "SAP HA Prepare Pacemaker - Prepare corosync totem settings" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_corosync_totem: options: "{{ __sap_ha_pacemaker_cluster_corosync_totem.options | default([]) + __totem_settings }}" vars: + # Identify if provided sap_ha_pacemaker_cluster_corosync_totem is defined + __user_totem_is_present: + "{{ true if (sap_ha_pacemaker_cluster_corosync_totem is defined + and sap_ha_pacemaker_cluster_corosync_totem.options is defined + and sap_ha_pacemaker_cluster_corosync_totem | length > 0) else false }}" + + # Identify if __sap_ha_pacemaker_cluster_corosync_totem_platform is defined + __platform_totem_is_present: + "{{ true if (__sap_ha_pacemaker_cluster_corosync_totem_platform is defined + and __sap_ha_pacemaker_cluster_corosync_totem_platform.options is defined + and __sap_ha_pacemaker_cluster_corosync_totem_platform | length > 0) else false }}" + __totem_settings: |- + {% if __user_totem_is_present %} + {% set corosync_totem = sap_ha_pacemaker_cluster_corosync_totem %} + {% elif __platform_totem_is_present %} + {% set corosync_totem = __sap_ha_pacemaker_cluster_corosync_totem_default + | combine(__sap_ha_pacemaker_cluster_corosync_totem_platform, recursive=True) %} + {% else %} + {% set corosync_totem = __sap_ha_pacemaker_cluster_corosync_totem_default %} + {% endif %} {% set new_opts = [] %} - {% for option in sap_ha_pacemaker_cluster_corosync_totem.options | dict2items -%} + {% for option in corosync_totem.options | dict2items -%} {%- set add_opts = new_opts.extend([ { 'name': option.key, @@ -67,3 +87,5 @@ }]) -%} {%- endfor %} {{ new_opts }} + +# TODO: Add support for ha_cluster_quorum diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index 91022e8f0..6a11f22e2 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -31,10 +31,10 @@ sap_ha_pacemaker_cluster_stonith_default: # secret_key: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" # region: "{{ sap_ha_pacemaker_cluster_aws_region }}" -# Platform corosync totem configuration -sap_ha_pacemaker_cluster_corosync_totem: +# Default corosync options - Platform specific +__sap_ha_pacemaker_cluster_corosync_totem_platform: options: - token: 29000 + token: 30000 # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: aws_vpc_move_ip diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 0dda1bcd3..24f7e4f79 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -42,8 +42,8 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: "620{{ sap_ha_pacemaker sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" -# Platform corosync totem configuration -sap_ha_pacemaker_cluster_corosync_totem: +# Default corosync options - Platform specific +__sap_ha_pacemaker_cluster_corosync_totem_platform: options: token: 20000 token_retransmits_before_loss_const: 10 diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index 1c13cae73..a94c1bfcb 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -31,6 +31,11 @@ sap_ha_pacemaker_cluster_stonith_default: subscriptionId: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" resourceGroup: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" +# Default corosync options - Platform specific +__sap_ha_pacemaker_cluster_corosync_totem_platform: + options: + token: 30000 + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: azure_lb diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 9d4fcac49..82fafecf3 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -22,6 +22,10 @@ __sap_ha_pacemaker_cluster_command: resource_defaults_update: "pcs resource defaults update" resource_restart: "pcs resource restart" +# Default corosync options - OS specific +__sap_ha_pacemaker_cluster_corosync_totem_default: + options: [] + # Make sure that there is always the minimal default fed into the included role. # This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'. sap_ha_pacemaker_cluster_fence_agent_minimal_packages: diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index f2aa1b8cc..e62d9389b 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -16,6 +16,15 @@ __sap_ha_pacemaker_cluster_command: resource_defaults_update: "crm configure rsc_defaults" resource_restart: "crm resource restart" +# Default corosync options - OS specific +__sap_ha_pacemaker_cluster_corosync_totem_default: + options: + token: 5000 + token_retransmits_before_loss_const: 10 + join: 60 + consensus: 6000 + max_messages: 20 + # Make sure that there is always the minimal default fed into the included role. # This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'. sap_ha_pacemaker_cluster_fence_agent_minimal_packages: From 4449730b38248fa0341e34d389e69f5ea4f8641d Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 3 Jul 2024 10:22:50 +0200 Subject: [PATCH 051/210] sap_playbooks: feedback incorporated --- playbooks/sap_hana_preconfigure_exec.yml | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index fb5996566..68cf4500f 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -1,6 +1,7 @@ --- ## # Call this playbook only with all variables defined. +# # The minimum viable set of variables which need to be defined are: # # sap_hana_group: name of group in inventory - defaults to localhost if not set @@ -15,6 +16,10 @@ # sap_hana_preconfigure_update: defaults to false # sap_hana_preconfigure_fail_if_reboot_required: defaults to true # sap_hana_preconfigure_reboot_ok: defaults to false +# +# Please note: if the variable sap_playbook_parameter_confirm is set to true, the playbook +# stops execution and waits for an input. If you want to run the playbook in +# non-interactive mode, leave the variable unset or set to false. - name: Prepare system for SAP HANA Installation hosts: "{{ sap_hana_group | d((groups['all'] == []) | ternary ('localhost', 'all')) }}" @@ -22,29 +27,25 @@ tasks: - name: Ansible Role Configuration ansible.builtin.debug: - - # sap_swpm_extract_directory testen !!! - msg: |- The Hana setup runs with the following configuration - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' - - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' - - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' - - 'Update OS : {{ sap_hana_preconfigure_update }}' - - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' - - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' - - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' + - 'Domain : {{ (sap_domain | d('') | length > 0) | ternary(sap_domain, ansible_domain) }}' + - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts | d('false') }}' + - 'Update OS : {{ sap_hana_preconfigure_update | d('false') }}' + - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok | d('false') }}' + - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required | d('true') }}' - - name: Pause playbook execution to verify parameters + - name: Pause Playbook to verify parameters when: sap_playbook_parameter_confirm | d('false') ansible.builtin.pause: prompt: Press enter to continue - - name: Prepare general preconfiguration + - name: Perform the general SAP configuration ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure - - name: Prepare system for HANA installation + - name: Perform the SAP HANA specific configuration ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure From 495f6192e86c63d2fd25cc1a312e6ae6baba96e7 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:29:38 +0100 Subject: [PATCH 052/210] sap_swpm: add error notes to dev doc --- docs/developer_notes/sap_swmp_dev.md | 235 ++++++++++++++++++++++++++- 1 file changed, 232 insertions(+), 3 deletions(-) diff --git a/docs/developer_notes/sap_swmp_dev.md b/docs/developer_notes/sap_swmp_dev.md index 8e562eb29..b85c4d5ae 100644 --- a/docs/developer_notes/sap_swmp_dev.md +++ b/docs/developer_notes/sap_swmp_dev.md @@ -1,10 +1,9 @@ # sap_swpm Ansible Role DEVELOPER NOTES -## Errors with missing signature files for installation media +## Common Errors -After SWPM 1.0 SP22 and SAP SWPM 2.0 SP00, all SAP Software installation media requires a separate signature file (SIGNATURE.SMF). The signature file is missing in older installation media. +### Error - Missing signature files for installation media -For example, IDES for SAP ECC 6.0 EhP8. See the following error message and SAP Note 2622019 - "EXPORT_1 is not signed" error during IDES installation. ```shell INFO DU at '/software_path/51052029_1/EXP1' is not signed. @@ -16,6 +15,236 @@ SOLUTION: Ensure that you use the latest available version of Installation Expor Not accepted ``` +After SWPM 1.0 SP22 and SAP SWPM 2.0 SP00, all SAP Software installation media requires a separate signature file (SIGNATURE.SMF). The signature file is missing in older installation media. + +For example, IDES for SAP ECC 6.0 EhP8. See the following error message and SAP Note 2622019 - "EXPORT_1 is not signed" error during IDES installation. + + +### Error - NIECONN_REFUSED + +```shell +FAIL: NIECONN_REFUSED +``` + +During SAP SWPM execution, it is common to see this **FALSE positive** error message. This is often due to restart of SAP NetWeaver AS in the installation procedures. + +If this error occurs and SAP SWPM does not succeed, execute `sapcontrol -nr -function StartService ` to ensure that sapstartsrv is running and debug the underlying cause of the error; such as Network Port blocked, incorrect /etc/hosts file etc that is causing issues starting SAP NetWeaver AS. + + +### Error - Unprivileged users have permissions + +```shell +Group of installation directory '/xxxxx/' is root, not sapinst. + +Unprivileged users have permissions 'rx' instead of no permissions at all on directory 'xxxxx/' +``` + +During SAP SWPM execution, user group permissions on directories are verified. + +If this error occurs, verify with `getent group` to ensure sapinst has more users than root; such as: `sapinst:x:<>:root,<>adm` + +To resolve, ensure the SWPM Unattended Parameter `nwUsers.sapsysGID` is set but remove any value from it. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_sapadm_uid: "" +sap_swpm_sapsys_gid: "" +sap_swpm_sidadm_uid: "" +``` + + +### Error - No Profile used + +```shell +sapparam(1c): No Profile used +``` + +During SAP SWPM execution, a target profile directory is created (auto-populated by the `sap_swpm` Ansible Role). + +If this error occurs, it may cause additional errors such as `getProfileDir reported an error: Empty directory name is not allowed`. + +To resolve, ensure the SWPM Unattended Parameter `NW_readProfileDir.profileDir` is set and has been provided a string path with the SAP System ID (e.g. `/sapmnt//profile`). For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_sid: "S01" +sap_swpm_inifile_list: + - nw_config_other + ... + +``` + +Alternatively, use Shell environment variable named `SAPSYSTEMNAME=` when executing `./sapinst`. + + +### Error - Wrong password for SYSTEM user of the SYSTEMDB Tenant for SAP HANA MDC + +```shell +NW_GetSidNoProfiles | NW_getDBInfo | NW_HDB_getDBInfo + +Error code FCO-00011 and MUT-03025 + +The step getDBInfoMultiDbSystemDB reported an error: +The database connection with database user SYSTEM cannot be set up. +Check that the database is online and the password of user SYSTEM is correct. +``` + +During SAP SWPM execution, a connection to the SAP HANA MDC SystemDB Tenant is required. + +To resolve, ensure the SWPM Unattended Parameter `NW_HDB_getDBInfo.systemDbPassword` is set and correct. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_db_systemdb_password: "Password" +``` + + +### Error - Wrong password for SYSTEM user of the target SAP HANA MDC Tenant + +```shell +NW_GetSidNoProfiles | NW_getDBInfo | NW_HDB_getDBInfo + +Error code FCO-00011 and MUT-03025 + +The step getDBInfo reported an error: +The database connection with database user SYSTEM cannot be set up. +Check that the database is online and the password of user SYSTEM is correct. +``` + +During SAP SWPM execution, a connection to the SAP HANA MDC Tenant target and database schema (e.g. `SAPHANADB` or `SAPABAP1`) is required. + +To resolve, ensure the SWPM Unattended Parameter `storageBasedCopy.hdb.systemPassword` and `NW_HDB_getDBInfo.systemPassword` is set and correct. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_db_system_password: "Password" +``` + +This may also occur after System Copy Database Backup Restore when the wrong password is given for SYSTEM user of the Database Schema (e.g. `SAPHANADB` or `SAPABAP1`). Such as the error below: + +```Shell +NW_CreateDBandLoad | NW_CreateDB | NW_HDB_DB + +The step RevalidateSystemuserPassword reported an error: +Start SAPinst in interactive mode to solve this problem. +``` + +To resolve, ensure the SWPM Unattended Parameter `HDB_Schema_Check_Dialogs.schemaPassword` is correctly set. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_db_system_password: "Password" +sap_swpm_db_schema_password: "Password" +``` + + +### Error - Wrong password for SYSTEM user of Database Schema for the SAP HANA Backup file + +```shell +NW_CreateDBandLoad | NW_CreateDB | NW_HDB_DB + +The step RevalidateSchemauserPassword reported an error: +The database connection with database user SYSTEM cannot be set up. +Check that the database is online and the password of user SYSTEM is correct. +``` + +During SAP SWPM execution, when using a Database Backup File the SYSTEM user of the Database Schema within the backup (e.g. `SAPHANADB`, or `SAPABAP1`) is required. + +To resolve, ensure the SWPM Unattended Parameter `NW_HDB_getDBInfo.systemPasswordBackup` value is the correct password. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_backup_system_password: "Password" +``` + + +### Error - Wrong password for DDIC user of Database Schema for the SAP HANA Backup file + +```shell +NW_CI_Instance | abapReports | NW_DDIC_Password + +ERROR (root/sapinst) id=rfcmod.jsco.wrongPassword +The step checkDDIC000Password was executed with status ERROR +The password you specified for user DDIC is wrong. +

SOLUTION: Enter the correct password.

+``` + +During SAP SWPM execution, when using a Database Backup File the DDIC user of the Database Schema within the backup (e.g. `SAPHANADB`, or `SAPABAP1`) is required after the data load occurs. + +To resolve, ensure the SWPM Unattended Parameter `NW_DDIC_Password.ddic000Password` value is the correct password. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_ddic_000_password: "Password" +``` + + +### Error - Wrong schema name for database connection set up + +```shell +The database connection with database user SYSTEM cannot be set up. +Check that the database is online and the password of the user SYSTEM is correct +``` + +During SAP SWPM execution, when using a Database Backup File Database Schema name is required after the data load occurs. + +To resolve, ensure the SWPM Unattended Parameter for the Database Schema (e.g. `HDB_Schema_Check_Dialogs.schemaName` for SAP HANA) is set and provided with the correct schema name (e.g. `SAPHANADB` , `SAPABAP1` based upon different SAP Software and versions). For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_db_schema: "SAPABAP1" +``` + + +### Error - Wrong domain name + +```shell +NW_GetSidNoProfiles | NW_getFQDN + +The step askFQDN reported an error: +Cannot resolve host 'xxxxxx' by name +``` + +During SAP SWPM execution, the FQDN is used for connections. + +To resolve, ensure the SWPM Unattended Parameter `NW_getFQDN.FQDN` for the FQDN is correct. For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_set_fqdn: true +sap_swpm_fqdn: "name.internal.corp" +``` + + +### Error - Restricted file permissions for current working directory + +```shell +NW_First_Steps | Preinstall + +The step checkInstDirPermissions was executed with status ERROR +The installation directory /xxxxx is not owned by group sapinst. +

SOLUTION: SAPinst will set the appropriate permission on the directory if you choose Ok.

+``` + +During SAP SWPM execution, the current working directory should be `0755` permission. + +This should be achieved automatically by the `sap_swpm` Ansible Role, whereby the variable `sap_swpm_sapinst_path: /path_here` is set to `0755` prior to execution of `sapinst`. + + +### Error - Incomplete parameters for Database Backup Restore and connection set up + +```shell +NWCreateDBandLoad | hdb_recovery_dialogs + +The step ask_recovery_connect_data_existing_database reported an error +``` + +During SAP SWPM execution, when using a Database Backup File additional variables are required for the data load. + +To resolve, ensure the SWPM Unattended PArameters below are set: +```shell +HDB_Recovery_Dialogs.backupLocation = "" +HDB_Recovery_Dialogs.backupName = "" +HDB_Recovery_Dialogs.sapControlWsdlUrl = "http://HOST:PORT/SAPControl?wsdl" +HDB_Recovery_Dialogs.sidAdmName = "" +HDB_Recovery_Dialogs.sidAdmPassword = "" +``` + +For example, in `sap_swpm` Ansible Role with default mode execution: +```yaml +sap_swpm_backup_location: "" +sap_swpm_backup_prefix: "" +sap_swpm_db_host: "" +sap_swpm_db_instance_nr: "" +sap_swpm_db_sid: "" +sap_swpm_db_sidadm_password: "" +``` + + +--- + ## SAP SWPM for SAP NWAS JAVA installations From 693224a578ed297aecc9524c10a1b36cf3149fe2 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 8 Jul 2024 12:21:43 +0200 Subject: [PATCH 053/210] sap_hana_preconfigure: Enable TSX also for RHEL 9 Solves issue #793. Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/assert-tsx.yml | 10 ++++++---- .../tasks/RedHat/generic/enable-tsx.yml | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml index f7ec8413b..5cc4ab2f7 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml @@ -5,7 +5,9 @@ when: - ansible_architecture == 'x86_64' - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '8' + - (ansible_distribution_major_version >= '9') or + (ansible_distribution_major_version == '8' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3) - __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3 block: @@ -13,7 +15,7 @@ - name: Get all CPU flags ansible.builtin.shell: set -o pipefail && lscpu | grep "^Flags:" register: __sap_hana_preconfigure_register_lscpu_flags - changed_when: no + changed_when: false - name: Report that the rtm CPU flag exists ansible.builtin.debug: @@ -30,7 +32,7 @@ - name: TSX - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub ansible.builtin.command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert - changed_when: no + changed_when: false - name: Assert that tsx=on is in GRUB_CMDLINE_LINUX in /etc/default/grub ansible.builtin.assert: @@ -57,7 +59,7 @@ - name: TSX - Get contents of /proc/cmdline ansible.builtin.command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_tsx_assert - changed_when: no + changed_when: false - name: Assert that tsx=on is in /proc/cmdline ansible.builtin.assert: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml index c0418df43..84c15b629 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml @@ -13,7 +13,8 @@ when: - ansible_architecture == 'x86_64' - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '8' - - __sap_hana_preconfigure_fact_ansible_distribution_minor_version|int >= 3 + - (ansible_distribution_major_version >= '9') or + (ansible_distribution_major_version == '8' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3) - not ( __sap_hana_preconfigure_register_proc_cmdline['content'] | b64decode | regex_findall('tsx=on') ) tags: grubconfig From abf3de337376994146c8d5b0f6d54261c14c0ff8 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 8 Jul 2024 12:24:46 +0200 Subject: [PATCH 054/210] zypper lock handler --- roles/sap_general_preconfigure/handlers/main.yml | 12 ++++++++++++ roles/sap_hana_preconfigure/handlers/main.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml index ae9345bf0..cdbd8a607 100644 --- a/roles/sap_general_preconfigure/handlers/main.yml +++ b/roles/sap_general_preconfigure/handlers/main.yml @@ -9,6 +9,18 @@ when: - sap_general_preconfigure_reboot_ok|d(false) +# Kernel update triggers zypper purge-kernels and lock after reboot. +- name: Wait for Zypper lock to be released + ansible.builtin.command: + cmd: zypper info zypper + retries: 60 + timeout: 5 + listen: __sap_general_preconfigure_reboot_handler + when: + - ansible_os_family == 'Suse' + - sap_general_preconfigure_reboot_ok | d(false) + changed_when: false + - name: Let the role fail if a reboot is required ansible.builtin.fail: msg: Reboot is required! diff --git a/roles/sap_hana_preconfigure/handlers/main.yml b/roles/sap_hana_preconfigure/handlers/main.yml index 92c36eb21..afebc5699 100644 --- a/roles/sap_hana_preconfigure/handlers/main.yml +++ b/roles/sap_hana_preconfigure/handlers/main.yml @@ -83,6 +83,18 @@ when: - sap_hana_preconfigure_reboot_ok | d(false) +# Kernel update triggers zypper purge-kernels and lock after reboot. +- name: Wait for Zypper lock to be released + ansible.builtin.command: + cmd: zypper info zypper + retries: 60 + timeout: 5 + listen: __sap_hana_preconfigure_reboot_handler + when: + - ansible_os_family == 'Suse' + - sap_hana_preconfigure_reboot_ok | d(false) + changed_when: false + - name: Let the role fail if a reboot is required ansible.builtin.fail: msg: Reboot is required! From 7f46b7bbb5cec80ba1c145760af5921ac9ff47b4 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 8 Jul 2024 12:51:00 +0200 Subject: [PATCH 055/210] corrected when statement --- playbooks/sap_hana_preconfigure_exec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 68cf4500f..9842e12c4 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -38,7 +38,7 @@ - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required | d('true') }}' - name: Pause Playbook to verify parameters - when: sap_playbook_parameter_confirm | d('false') + when: sap_playbook_parameter_confirm | d('false') | bool ansible.builtin.pause: prompt: Press enter to continue From d02230af8176c3ff6ffc18f2770f150f4fb28f8d Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 8 Jul 2024 13:27:56 +0200 Subject: [PATCH 056/210] update --- playbooks/sap_hana_preconfigure_exec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 9842e12c4..aa0621154 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -38,7 +38,7 @@ - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required | d('true') }}' - name: Pause Playbook to verify parameters - when: sap_playbook_parameter_confirm | d('false') | bool + when: sap_playbook_parameter_confirm | d(false) ansible.builtin.pause: prompt: Press enter to continue From 598efb330142d75feb44d0257cec0050e046620d Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 8 Jul 2024 14:38:45 +0200 Subject: [PATCH 057/210] Playbook Beautification --- playbooks/sap_hana_preconfigure_exec.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index aa0621154..f4e6eb7e8 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -29,12 +29,12 @@ ansible.builtin.debug: msg: |- The Hana setup runs with the following configuration - - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' - - 'Domain : {{ (sap_domain | d('') | length > 0) | ternary(sap_domain, ansible_domain) }}' - - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts | d('false') }}' - - 'Update OS : {{ sap_hana_preconfigure_update | d('false') }}' - - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok | d('false') }}' + - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' + - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' + - 'Domain : {{ (sap_domain | d('') | length > 0) | ternary(sap_domain, ansible_domain) }}' + - 'Modify hosts : {{ sap_general_preconfigure_modify_etc_hosts | d('false') }}' + - 'Update OS : {{ sap_hana_preconfigure_update | d('false') }}' + - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok | d('false') }}' - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required | d('true') }}' - name: Pause Playbook to verify parameters From b91e53f5f5c957f4b201684bdc0f8532e526a184 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 9 Jul 2024 14:59:33 +0200 Subject: [PATCH 058/210] sap_hana_preconfigure: Remove duplicate code from assert-tsx.yml Relates to #793. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml index 5cc4ab2f7..951fdcd05 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml @@ -8,7 +8,6 @@ - (ansible_distribution_major_version >= '9') or (ansible_distribution_major_version == '8' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3) - - __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3 block: # There are CPUs which are not capable of enabling the rtm flag, so we just report the status: From 43d3110e50e17c3dcc93dd5afb2f1553af6f13a3 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Tue, 9 Jul 2024 16:39:14 +0200 Subject: [PATCH 059/210] fixed typo --- playbooks/README.md | 2 +- playbooks/sap_hana_preconfigure.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 542ff16fd..41425ae0f 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -58,4 +58,4 @@ Now you can run the playbook non-interactively with ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml ``` -NOTE: If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. \ No newline at end of file +NOTE: If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 9f28d7599..36c135810 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -6,7 +6,9 @@ # or alternatively unattended with # ansible-playbook community.sap_install.sap_hana_preconfigure -e @myvars.yml # -# The file myvars. yaml needs to contain the following variables +# The file myvars.yaml needs to contain the following variables +# +# please read README.md in playbooks folder for details # - name: Playbook Usage hosts: localhost From f2df9d3be1534a994c6361a996974f4d6f3e1dd1 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Wed, 10 Jul 2024 14:00:33 +0200 Subject: [PATCH 060/210] add hana support for nfs --- .../generic_tasks/configure_nfs_filesystems.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml index 309bcde46..2d52a656d 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_nfs_filesystems.yml @@ -45,18 +45,16 @@ 'dir_only': '/' + sap_storage_setup_sid, } ]) %} - {%- endif %} - {%- if nfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap/trans' %} + {%- elif nfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap/trans' %} {%- set add_trans = mount_list.extend([ { 'mount_src': nfs_item.nfs_path | regex_replace('/$', ''), 'mountpoint': nfs_item.mountpoint | regex_replace('/$', ''), } ]) %} - {%- endif %} - {%- if nfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} + {%- elif nfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} {%- for common in sap_storage_setup_nfs_dirs_usr_sap.all %} {%- set add_all_usrsap = mount_list.extend([ { @@ -77,6 +75,14 @@ {%- endfor %} {%- endfor %} + {%- elif nfs_item.mountpoint.startswith('/hana/') %} + {%- set add_hana = mount_list.extend([ + { + 'mount_src': nfs_item.nfs_path | regex_replace('/$', ''), + 'mountpoint': nfs_item.mountpoint | regex_replace('/$', ''), + } + ]) %} + {%- endif %} {{ mount_list }} From fae01409a732317f5e4a1e5396116c6322806319 Mon Sep 17 00:00:00 2001 From: "remi.mrozek" Date: Thu, 11 Jul 2024 13:36:10 +0000 Subject: [PATCH 061/210] sap_swpm: Add default value for sap_swpm_java_scs_instance_hostname --- roles/sap_swpm/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index c3956bf99..86d71e20d 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -214,6 +214,7 @@ sap_swpm_aas_instance_nr: "" sap_swpm_aas_instance_hostname: "" sap_swpm_java_scs_instance_nr: "" +sap_swpm_java_scs_instance_hostname: "" # Password used for all users created during SWPM installation sap_swpm_master_password: From a2a8545df165c7826bd7661340d08f37d6c74d03 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:56:16 +0100 Subject: [PATCH 062/210] sap_ha_install_anydb_ibmdb2: linting and sles bug fixes --- .../tasks/db2_hadr_enable.yml | 44 +++++-- .../tasks/db2_hadr_pcmk_cluster_create.yml | 115 +++++++++++++----- .../tasks/main.yml | 36 +++++- .../tasks/passwordless_ssh.yml | 25 ++-- .../platform/ascertain_platform_type.yml | 3 +- .../tasks/platform/db2cm_cloud_aws_ec2_vs.yml | 30 ++++- .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 53 ++++++-- .../tasks/platform/db2cm_cloud_msazure_vm.yml | 38 +++++- 8 files changed, 270 insertions(+), 74 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml index faf755b7b..9cba338df 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml @@ -16,7 +16,10 @@ # Use the IBM Db2 Command Line Processor # See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ -- name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication +# Reasons for noqa: +# - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_enable_primary become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: @@ -35,12 +38,18 @@ db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 - when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" + failed_when: not __sap_ha_install_anydb_ibmdb2_enable_primary.rc == 0 and (not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_enable_primary.stdout and not __sap_ha_install_anydb_ibmdb2_enable_primary.stderr == "") # Use the IBM Db2 Command Line Processor # See IBM Db2 for SAP HADR reference document referred from sap.com - https://ibm.github.io/db2-hadr-wiki/ -- name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node +# Reasons for noqa: +# - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway +- name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_enable_secondary become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: @@ -59,10 +68,15 @@ db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + when: + - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" + failed_when: not __sap_ha_install_anydb_ibmdb2_enable_secondary.rc == 0 and (not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_enable_secondary.stdout and not __sap_ha_install_anydb_ibmdb2_enable_secondary.stderr == "") # Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node +# Reasons for noqa: +# - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip +- name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node # noqa no-changed-when become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: @@ -70,10 +84,14 @@ ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 rollforward database $ibmdb2_sid to end of logs - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + when: + - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" # Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node +# Reasons for noqa: +# - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip +- name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node # noqa no-changed-when become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: @@ -82,11 +100,15 @@ set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 start hadr on db $ibmdb2_sid as standby - when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + when: + - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" # Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node +# Reasons for noqa: +# - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip +- name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node # noqa no-changed-when become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: @@ -95,4 +117,6 @@ set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 start hadr on db $ibmdb2_sid as primary - when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml index d421617df..e9af718e0 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml @@ -25,9 +25,10 @@ file_type: file patterns: - "*.rpm" - excludes: - - "*debuginfo*" - - "*debugsource*" + # Should not be required, but db2installPCMK script will attempt to install all RPMs and fail on GPG Check + # excludes: + # - "*debuginfo*" + # - "*debugsource*" register: __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for RHEL @@ -37,6 +38,29 @@ disable_gpg_check: true when: ansible_os_family == 'RedHat' + # For SLES 15, various Zypper errors will occur when 'Integrated Linux Pacemaker' RPMs attempt installation, such as: + ### the installed cluster-glue-libs** obsoletes 'libglue2 < **' provided by the to be installed libglue2**.db2pcmk.** + ### the installed pacemaker-libs** obsoletes 'libpacemaker3 < **' provided by the to be installed libpacemaker3**db2pcmk** + ### the to be installed libqb-devel**db2pcmk** requires 'libqb100 = **db2pcmk', but this requirement cannot be provided not installable providers: libqb100**db2pcmk** + ### nothing provides 'cluster-glue = **db2pcmk' needed by the to be installed libglue-devel**db2pcmk** + ### nothing provides 'libqb100 = **db2pcmk' needed by the to be installed libqb-devel**db2pcmk** + # Removing these packages will remove SLES Hawk2 and SLES Package Pattern for HA (patterns-ha-ha_sles) including pacemaker-libs etc + ### cluster-glue (replaced by cluster-glue*.rpm from db2pcmk) + ### crmsh (replaced by crmsh*.rpm from db2pcmk) + # Removing these packages will remove LVM Locking Daemon (lvm2-lockd), Corosync, SLES Hawk2 and SLES Package Pattern for HA (patterns-ha-ha_sles) including pacemaker-libs etc + ### ibcmap4 libcorosync_common4 libcpg4 libsam4 libvotequorum8 (replaced by corosynclib*.rpm from db2pcmk) + ### libqb100 (replaced by libqb100*.rpm from db2pcmk) + - name: SAP HA AnyDB - IBM Db2 HADR - Remove conflict default RPMs with db2pcmk RPMs for SLES + community.general.zypper: + name: + - cluster-glue + - crmsh + - ibcmap4 + - libqb100 + state: absent + disable_gpg_check: true + when: ansible_os_family == 'Suse' + - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES community.general.zypper: name: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_rpm_files.files | map(attribute='path') | list | sort }}" @@ -45,12 +69,15 @@ when: ansible_os_family == 'Suse' # SAP Note 3100287 - DB6: Db2 Support for Pacemaker Cluster Software - - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed + # Reasons for noqa: + # - command-instead-of-module: Shell commands to match IBM Db2 documentation + # - no-changed-when: Command is check only and performs no action + - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed # noqa command-instead-of-module no-changed-when register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check ansible.builtin.shell: | - rpm -q corosync | grep -I db2pcmk - rpm -q pacemaker | grep -I db2pcmk - rpm -q crmsh | grep -I db2pcmk + set -o pipefail && rpm -q corosync | grep -I db2pcmk + set -o pipefail && rpm -q pacemaker | grep -I db2pcmk + set -o pipefail && rpm -q crmsh | grep -I db2pcmk - name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 'Integrated Linux Pacemaker' installation details ansible.builtin.debug: @@ -85,11 +112,16 @@ # - name: SAP HA AnyDB - IBM Db2 HADR - Verify /usr/lib/ocf/resource.d/heartbeat contains Db2agents (db2hadr, db2inst, db2ethmon) - - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script + # Expect return code 0 if success, or return code 99 if no actions taken (i.e. all RPMs installed already) + # Reasons for noqa: + # - no-changed-when: Db2 command will perform no changes unless required but uses not standard rc code so attempt to skip + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2installPCMK shell script # noqa no-changed-when ansible.builtin.shell: | {{ __sap_ha_install_anydb_ibmdb2_pcmk.files[0].path }} -i register: __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run - failed_when: not __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc == 0 and not 'Online Pacemaker service detected' in __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.stdout + failed_when: + - (__sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc != 99 and __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.rc != 0) + - not 'Online Pacemaker service detected' in __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk_run.stdout - name: SAP HA AnyDB - IBM Db2 HADR - Identify db2cppcmk shell script ansible.builtin.find: @@ -104,12 +136,17 @@ msg: IBM Db2 resource agent scripts (db2cppcmk) utility is not available, cannot find file db2cppcmk when: not (__sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files | length > 0) - - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2cppcmk shell script + # db2cppcmk script must run as root + # Reasons for noqa: + # - no-changed-when: Db2 command will perform no changes unless required + - name: SAP HA AnyDB - IBM Db2 HADR - Execute db2cppcmk shell script # noqa no-changed-when ansible.builtin.shell: | {{ __sap_ha_install_anydb_ibmdb2_pcmk_binary_db2cppcmk.files[0].path }} -i # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm + # Reasons for noqa: + # - no-changed-when: Db2 command will error if already exists and not perform changes + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config1 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -126,41 +163,47 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout - # db2cm script must run as root - # Setting to be performed on both Primary and Secondary node - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster - register: __sap_ha_install_anydb_ibmdb2_config1 - # when: - # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + # Corosync setting to be performed on both Primary and Secondary node + # Reasons for noqa: + # - command-instead-of-module: Shell commands to match IBM Db2 documentation + # - no-changed-when: sed will not change anything if already changed + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster # noqa command-instead-of-module no-changed-when + register: __sap_ha_install_anydb_ibmdb2_config2 ansible.builtin.shell: | sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf - failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config2.stdout # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config2 + # Reasons for noqa: + # - no-changed-when: Db2 command will error if already exists and not perform changes + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_config3 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary - failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config2.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout # db2cm script must run as root - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config3 + # Reasons for noqa: + # - no-changed-when: Db2 command will error if already exists and not perform changes + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_config4 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary - failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout # Use the IBM Db2 Command Line Processor # Setting to be performed on both Primary and Secondary node - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm + # Reasons for noqa: + # - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config5 # when: # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -175,8 +218,10 @@ # Use the IBM Db2 Command Line Processor # Address SQL1363W - database must be shutdown and reactivated before the configuration parameter changes become effective - - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate - register: __sap_ha_install_anydb_ibmdb2_config5 + # Reasons for noqa: + # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip + - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_config6 # when: # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short become: true @@ -187,22 +232,30 @@ set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 activate db $ibmdb2_sid - failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config6.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config6.stdout # db2cm script must run as root # Ensure parameter HADR_PEER_WINDOW is set, otherwise will clustering-supported-cluster-management-software # "Error: Please configure HADR_PEER_WINDOW for on instance on to a value of at least 60 seconds." - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm - register: __sap_ha_install_anydb_ibmdb2_config4 + # Reasons for noqa: + # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_config7 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance - failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout + failed_when: not __sap_ha_install_anydb_ibmdb2_config7.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config7.stdout - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm ansible.builtin.include_tasks: "platform/db2cm_{{ __sap_ha_install_anydb_ibmdb2_platform }}.yml" + when: __sap_ha_install_anydb_ibmdb2_platform is defined + + - name: SAP HA AnyDB - IBM Db2 HADR - Warning if target infrastructure platform not detected + ansible.builtin.debug: + msg: WARNING - IBM Db2 HADR is only partially activated, the Infrastructure Platform could not be detected and additional steps are likely required. + when: __sap_ha_install_anydb_ibmdb2_platform is undefined # end of block diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 91224191f..2012b84d0 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -38,6 +38,23 @@ msg: IBM Db2 installation media is not available, cannot find file db2installPCMK when: not (__sap_ha_install_anydb_ibmdb2_check_install_media.files | length > 0) +# Use the IBM Db2 Performance Diagnostics tool +# Reasons for noqa: +# - no-changed-when: Db2 PD tool is to retrieve information and perform no change +- name: SAP HA AnyDB - IBM Db2 HADR - Confirm if IBM HADR is already activated (i.e. re-run) # noqa no-changed-when + register: __sap_ha_install_anydb_ibmdb2_hadr_initial_status + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + set -o pipefail && db2pd -hadr -db $ibmdb2_sid | grep 'HADR_CONNECT_STATUS =' | tr -d ' ' || echo '' + +- name: SAP HA AnyDB - IBM Db2 HADR - Warning if IBM Db2 HADR is already activated + ansible.builtin.debug: + msg: WARNING - IBM Db2 HADR is already activated, some steps will be skipped and some may fail + when: __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout == "HADR_CONNECT_STATUS=CONNECTED" # Determine infrastructure platform - name: SAP HA AnyDB - IBM Db2 HADR - Include tasks for platform detection @@ -53,7 +70,10 @@ ansible.builtin.import_tasks: db2_hadr_pcmk_cluster_create.yml -- name: SAP HA AnyDB - IBM Db2 HADR - Verify crm for IBM Db2 HA Linux Pacemaker initialisation +# Use the Pacemaker Shell 'crmsh' +# Reasons for noqa: +# - no-changed-when: Use crmsh to retrieve information and perform no change +- name: SAP HA AnyDB - IBM Db2 HADR - Verify crm for IBM Db2 HA Linux Pacemaker initialisation # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_pcmk_check when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -63,7 +83,9 @@ crm --display=plain status full # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisation +# Reasons for noqa: +# - no-changed-when: Use db2cm script to retrieve information and perform no change +- name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisationn # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_init_check when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -72,7 +94,9 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -list # Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration +# Reasons for noqa: +# - no-changed-when: Use Db2 CLP to retrieve information and perform no change +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configurationn # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_hadr_config become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} @@ -82,10 +106,12 @@ - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' + set -o pipefail && db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' # Use the IBM Db2 Command Line Processor -- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR status +# Reasons for noqa: +# - no-changed-when: Use Db2 CLP to retrieve information and perform no change +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR status # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_hadr_status become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 024a67cc7..7cba895a3 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -19,7 +19,9 @@ owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - - name: SAP HA AnyDB - IBM Db2 HADR - Perform ssh-keygen if required + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Perform ssh-keygen if required # noqa no-changed-when ansible.builtin.shell: | [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] && \ [[ ! -f /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ @@ -28,7 +30,9 @@ creates: /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub failed_when: false - - name: SAP HA AnyDB - IBM Db2 HADR - Copy key files from root user if does not exist + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Copy key files from root user if does not exist # noqa no-changed-when ansible.builtin.shell: | [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }} ]] || \ [[ ! -f /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub ]] && \ @@ -55,26 +59,33 @@ - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}" - "/db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" - - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint of SAP AnyDB Primary node + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint of SAP AnyDB Primary node # noqa no-changed-when ansible.builtin.shell: | ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} register: __sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint pf SAP AnyDB Secondary node + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint pf SAP AnyDB Secondary node # noqa no-changed-when ansible.builtin.shell: | ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary node + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary node # noqa no-changed-when ansible.builtin.shell: | cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub register: __sap_ha_install_anydb_ibmdb2_primary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node + # Reasons for noqa: + # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node # noqa no-changed-when ansible.builtin.shell: | cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub register: __sap_ha_install_anydb_ibmdb2_secondary_pubkey diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index 07e980744..a66fdcc37 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -42,7 +42,8 @@ # TODO: detection based on multiple facts and providing one standard # name for use as platform type in related include files -# cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, cloud_msazure_vm, hyp_ibmpower_vm, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm +# cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, +# cloud_msazure_vm, hyp_ibmpower_vm, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Amazon Web Services EC2 Virtual Server diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml index eedc3ed91..03e5d3952 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml @@ -1,13 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Fence Agent Packages +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Fence Agent Packages for RHEL ansible.builtin.package: name: - fence-agents-aws - awscli state: present + when: ansible_os_family == 'RedHat' +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Fence Agent Packages for SLES + ansible.builtin.package: + name: + - fence-agents + - awscli + state: present + when: ansible_os_family == 'Suse' # IBM Db2 HADR on AWS EC2 VS # www.ibm.com/support/pages/node/6829815 @@ -20,7 +28,9 @@ # When Virtual IP is already attached to OS Network Interface as Secondary IP # (in advance by sap_vm_temp_vip or previous db2cm run), will cause # "Error: ip address is pingable, use another ip address in the subnet that is not pingable." -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Virtual IP address for Primary Node using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_aws_1 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -32,7 +42,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_aws_1.stdout # Setting to be performed on both Primary and Secondary node -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary and Secondary Node - Provide AWS CLI credentials +# Reasons for noqa: +# - no-changed-when: Db2 mandates use of AWS CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary and Secondary Node - Provide AWS CLI credentials # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_aws_credentials when: - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" @@ -41,7 +53,9 @@ aws configure set aws_secret_access_key "{{ sap_ha_install_anydb_ibmdb2_aws_secret_access_key }}" # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_aws_2 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -53,7 +67,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_aws_2.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for aws-vpc-move-ip using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for aws-vpc-move-ip using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_aws_3 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -65,7 +81,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_aws_3.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_aws_4 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml index e55875f56..09a39ae38 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -1,20 +1,28 @@ # SPDX-License-Identifier: Apache-2.0 --- -# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages +# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages for RHEL # ansible.builtin.package: # name: # - fence-agents-gce # - resource-agents-gcp # state: present +# when: ansible_os_family == 'RedHat' +# - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Fence Agent Packages for SLES +# ansible.builtin.package: +# name: +# - fence-agents +# - resource-agents-gcp +# state: present +# when: ansible_os_family == 'Suse' - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Key ansible.builtin.rpm_key: state: present key: https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Add +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Add for RHEL ansible.builtin.yum_repository: name: Google Cloud CLI baseurl: https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64 @@ -23,11 +31,30 @@ repo_gpgcheck: false gpgkey: - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg + when: + - ansible_os_family == "RedHat" -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud CLI Package +# Reasons for noqa: +# - no-changed-when: SUSEConnect command will not perform changes if already exists +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud Repo Add for SLES # noqa no-changed-when + ansible.builtin.shell: | + SUSEConnect --product sle-module-public-cloud/{{ ansible_distribution_version }}/x86_64 + when: ansible_os_family == 'Suse' + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud CLI Package for RHEL ansible.builtin.package: name: google-cloud-cli state: present + when: ansible_os_family == 'RedHat' + +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - GCloud CLI Package for SLES + ansible.builtin.package: + name: + - google-guest-agent + - google-guest-configs + - google-guest-oslogin + state: present + when: ansible_os_family == 'Suse' # IBM Db2 HADR on GCP CE VMs @@ -37,7 +64,9 @@ # When Virtual IP is already attached to OS Network Interface as Secondary IP # (in advance by sap_vm_temp_vip or previous db2cm run), will cause # "Error: ip address is pingable, use another ip address in the subnet that is not pingable." -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Virtual IP address for Primary Node using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_gcp_1 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -49,7 +78,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_gcp_1.stdout # Setting to be performed on both Primary and Secondary node -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials +# Reasons for noqa: +# - no-changed-when: Db2 mandates use of Google Cloud CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials when: - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" @@ -71,7 +102,9 @@ # failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_gcp_2.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for gcp-ilb using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for gcp-ilb using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_gcp_3 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -83,7 +116,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_3.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for Virtual IP via IPAddr2 using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for Virtual IP via IPAddr2 using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_gcp_4 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -95,7 +130,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_4.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_4.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_gcp_5 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml index c9c1bfb11..5feabaafb 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml @@ -1,13 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Fence Agent Packages +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Fence Agent Packages for RHEL ansible.builtin.package: name: - fence-agents-azure-arm - socat state: present + when: ansible_os_family == 'RedHat' +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Fence Agent Packages for SLES + ansible.builtin.package: + name: + - fence-agents + - socat + state: present + when: ansible_os_family == 'Suse' - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Repo Key ansible.builtin.rpm_key: @@ -30,6 +38,14 @@ - ansible_os_family == "RedHat" - ansible_distribution_major_version == "8" +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Repo for SLES + community.general.zypper_repository: + name: Azure CLI + repo: https://packages.microsoft.com/yumrepos/azure-cli + state: present + auto_import_keys: true + when: ansible_os_family == 'Suse' + - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Azure CLI Package ansible.builtin.package: name: azure-cli @@ -46,7 +62,9 @@ # When Virtual IP is already attached to OS Network Interface as Secondary IP # (in advance by sap_vm_temp_vip or previous db2cm run), will cause # "Error: ip address is pingable, use another ip address in the subnet that is not pingable." -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Virtual IP address for Primary Node using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_msazure_1 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -58,7 +76,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_msazure_1.stdout # Setting to be performed on both Primary and Secondary node -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary and Secondary Node - Provide MS Azure CLI credentials +# Reasons for noqa: +# - no-changed-when: Db2 mandates use of AWS CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary and Secondary Node - Provide MS Azure CLI credentials # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_msazure_credentials when: - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" @@ -66,7 +86,9 @@ az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant "{{ sap_ha_install_anydb_ibmdb2_msazure_tenant_id }}" # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_msazure_2 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -80,7 +102,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_msazure_2.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for azure-lb using db2cm +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for azure-lb using db2cm # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_msazure_3 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -94,7 +118,9 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_msazure_3.stdout # db2cm script must run as root -- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality +# Reasons for noqa: +# - no-changed-when: Db2 command will error if already exists and not perform changes +- name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_config_msazure_4 when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short From 4f46c1a557b32b23a1d3ef7bfa0baa789448a0ef Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:31:32 +0100 Subject: [PATCH 063/210] sap_ha_install_anydb_ibmdb2: codespell fix --- roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index 2012b84d0..c04690c19 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -85,7 +85,7 @@ # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Use db2cm script to retrieve information and perform no change -- name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisationn # noqa no-changed-when +- name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisation # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_init_check when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -96,7 +96,7 @@ # Use the IBM Db2 Command Line Processor # Reasons for noqa: # - no-changed-when: Use Db2 CLP to retrieve information and perform no change -- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configurationn # noqa no-changed-when +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration # noqa no-changed-when register: __sap_ha_install_anydb_ibmdb2_hadr_config become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} From 291fce4f4c3f5630070bb563bc6c2a30950cfb2e Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 15 Jul 2024 22:02:51 +0200 Subject: [PATCH 064/210] sap_hana_install: Use polling for hdblcm Solves issue #804. Signed-off-by: Bernd Finger --- roles/sap_hana_install/defaults/main.yml | 3 ++ roles/sap_hana_install/tasks/hana_install.yml | 42 +++++++++++++++---- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/roles/sap_hana_install/defaults/main.yml b/roles/sap_hana_install/defaults/main.yml index 51f47e023..9ad0d5ecf 100644 --- a/roles/sap_hana_install/defaults/main.yml +++ b/roles/sap_hana_install/defaults/main.yml @@ -225,3 +225,6 @@ sap_hana_install_create_initial_tenant: 'y' # The hostname is set by 'hdblcm --dump_configfile_template' during the preinstall phase but can also # be set to a different value in your playbook or hostvars: # sap_hana_install_hostname: + +# Display SAP HANA hdblcm unattended mode output (hdblcm stdout) +sap_hana_install_display_unattended_output: false diff --git a/roles/sap_hana_install/tasks/hana_install.yml b/roles/sap_hana_install/tasks/hana_install.yml index 967addebf..66c480f0b 100644 --- a/roles/sap_hana_install/tasks/hana_install.yml +++ b/roles/sap_hana_install/tasks/hana_install.yml @@ -3,7 +3,7 @@ # Ansible does not support streaming of stdout, so we offer a workaround. # For more information, see https://github.com/ansible/proposals/issues/92 -- name: Copy file tail-f-hdblcm-install-trc.sh to '{{ __sap_hana_install_register_tmpdir.path }}' +- name: Install SAP HANA - Copy file tail-f-hdblcm-install-trc.sh to '{{ __sap_hana_install_register_tmpdir.path }}' ansible.builtin.copy: src: tmp/tail-f-hdblcm-install-trc.sh dest: "{{ __sap_hana_install_register_tmpdir.path }}/tail-f-hdblcm-install-trc.sh" @@ -12,7 +12,7 @@ mode: '0755' # Show how to use the workaround: -- name: Show how to watch the install process in real time +- name: Install SAP HANA - Show how to watch the install process in real time ansible.builtin.debug: msg: - 'Once the task "Install SAP HANA" has started, you can use the following command' @@ -21,12 +21,12 @@ - 'Alternatively, you can run the following command on the control node:' - "ssh {{ inventory_hostname }} {{ __sap_hana_install_register_tmpdir.path }}/tail-f-hdblcm-install-trc.sh" -- name: Set fact for the hdblcm verify_signature argument +- name: Install SAP HANA - Set fact for the hdblcm verify_signature argument ansible.builtin.set_fact: __sap_hana_install_fact_verify_signature: '--verify_signature' when: sap_hana_install_verify_signature -- name: Set fact for the hdblcm command line +- name: Install SAP HANA - Set fact for the hdblcm command line ansible.builtin.set_fact: __sap_hana_install_hdblcm_command: "./hdblcm {{ sap_hana_install_hdblcm_extraargs | d('') }} {{ __sap_hana_install_fact_verify_signature | d('') }} @@ -34,15 +34,43 @@ -b" tags: sap_hana_install_hdblcm_commandline -- name: Display the hdblcm command line +- name: Install SAP HANA - Display the hdblcm command line ansible.builtin.debug: msg: "SAP HANA install command: '{{ __sap_hana_install_hdblcm_command }}'" tags: sap_hana_install_hdblcm_commandline - name: Install SAP HANA - {{ sap_hana_install_sid }} {{ sap_hana_install_number }} ansible.builtin.command: "{{ __sap_hana_install_hdblcm_command }}" - register: __sap_hana_install_register_hdblcm_install + register: __sap_hana_install_register_hdblcm_install_async_job args: chdir: "{{ __sap_hana_install_fact_hdblcm_path }}" - changed_when: "'SAP HANA Lifecycle Management' in __sap_hana_install_register_hdblcm_install.stdout" + async: 86400 # Seconds for maximum runtime, set to 24 hours + poll: 0 # Seconds between polls, use 0 to run Ansible Tasks concurrently + changed_when: true when: not ansible_check_mode + +- name: Install SAP HANA - Wait for hdblcm process to exit, poll every 60 seconds + ansible.builtin.shell: + cmd: set -o pipefail && ps -ef | awk '/ hdblcm /&&/ {{ __sap_hana_install_configfile_arg }} /&&!/ awk /{print}' + register: __sap_hana_install_register_pids_sapinst + until: "__sap_hana_install_register_pids_sapinst.stdout | length == 0" + retries: 1440 + delay: 60 + vars: + __sap_hana_install_configfile_arg: "{{ '--configfile=' + (__sap_hana_install_register_tmpdir.path + '/configfile.cfg') | regex_replace('/', '\\/') }}" + changed_when: false + +- name: Install SAP HANA - Verify if hdblcm process finished successfully + ansible.builtin.async_status: + jid: "{{ __sap_hana_install_register_hdblcm_install_async_job.ansible_job_id }}" + register: __sap_hana_install_register_sapinst + failed_when: __sap_hana_install_register_sapinst.finished != 1 or __sap_hana_install_register_sapinst.rc != 0 + +- name: Install SAP HANA - Display the hdblcm return code + ansible.builtin.debug: + msg: "{{ __sap_hana_install_register_sapinst.rc }}" + +- name: Install SAP HANA - Display the hdblcm output + ansible.builtin.debug: + msg: "{{ __sap_hana_install_register_sapinst.stdout_lines }}" + when: sap_hana_install_display_unattended_output From c1ae435b5309990bc3380e706ceb55c301d4e28c Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:22:28 +0100 Subject: [PATCH 065/210] sap_ha_install_anydb_ibmdb2: add lint fixes to passwordless ssh --- .../tasks/passwordless_ssh.yml | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 7cba895a3..9220a3fe9 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -96,40 +96,44 @@ ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" mode: "0600" path: /root/.ssh/known_hosts + owner: root + group: root + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" mode: "0600" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/known_hosts owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - root user ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" mode: "0600" path: /root/.ssh/authorized_keys + owner: root + group: root + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" mode: "0600" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) @@ -137,7 +141,10 @@ ansible.builtin.blockinfile: backup: true create: true + mode: "0644" path: /root/.ssh/config + owner: root + group: root block: | Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} IdentityFile /root/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_primary }} @@ -148,12 +155,13 @@ ansible.builtin.blockinfile: backup: true create: true + mode: "0644" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/config + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm block: | Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} IdentityFile /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_primary }} - owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -161,40 +169,44 @@ ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" mode: "0600" path: /root/.ssh/known_hosts + owner: root + group: root + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Primary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" mode: "0600" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/known_hosts owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_ssh_fingerprint.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - root user ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" mode: "0600" path: /root/.ssh/authorized_keys + owner: root + group: root + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator ansible.builtin.lineinfile: backup: true create: true - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" mode: "0600" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) @@ -202,7 +214,10 @@ ansible.builtin.blockinfile: backup: true create: true + mode: "0644" path: /root/.ssh/config + owner: root + group: root block: | Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} IdentityFile /root/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} @@ -213,12 +228,13 @@ ansible.builtin.blockinfile: backup: true create: true + mode: "0644" path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/config + owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm block: | Host {{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].ansible_default_ipv4.address }} {{ sap_ha_install_anydb_ibmdb2_hostname_primary }} IdentityFile /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/anydb_ibmdb2_hadr_{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} - owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # end of block From 83754b24d81184cae2728e7fa8d4a5474a594410 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:22:59 +0100 Subject: [PATCH 066/210] sap_ha_install_anydb_ibmdb2: add lint fixes to db2 commands --- roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index c04690c19..e49666821 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -41,7 +41,8 @@ # Use the IBM Db2 Performance Diagnostics tool # Reasons for noqa: # - no-changed-when: Db2 PD tool is to retrieve information and perform no change -- name: SAP HA AnyDB - IBM Db2 HADR - Confirm if IBM HADR is already activated (i.e. re-run) # noqa no-changed-when +# - risky-shell-pipe: csh cannot use 'set -o pipefail &&' and will error with 'set: Variable name must begin with a letter' +- name: SAP HA AnyDB - IBM Db2 HADR - Confirm if IBM HADR is already activated (i.e. re-run) # noqa no-changed-when risky-shell-pipe register: __sap_ha_install_anydb_ibmdb2_hadr_initial_status become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} @@ -49,7 +50,7 @@ executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - set -o pipefail && db2pd -hadr -db $ibmdb2_sid | grep 'HADR_CONNECT_STATUS =' | tr -d ' ' || echo '' + db2pd -hadr -db $ibmdb2_sid | grep 'HADR_CONNECT_STATUS =' | tr -d ' ' || echo '' - name: SAP HA AnyDB - IBM Db2 HADR - Warning if IBM Db2 HADR is already activated ansible.builtin.debug: @@ -96,7 +97,8 @@ # Use the IBM Db2 Command Line Processor # Reasons for noqa: # - no-changed-when: Use Db2 CLP to retrieve information and perform no change -- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration # noqa no-changed-when +# - risky-shell-pipe: csh cannot use 'set -o pipefail &&' and will error with 'set: Variable name must begin with a letter' +- name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration # noqa no-changed-when risky-shell-pipe register: __sap_ha_install_anydb_ibmdb2_hadr_config become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} @@ -106,7 +108,7 @@ - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - set -o pipefail && db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' + db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' # Use the IBM Db2 Command Line Processor # Reasons for noqa: From 06ba4e33f31b11b7cdd9687800399f49da02acc2 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:23:45 +0100 Subject: [PATCH 067/210] sap_ha_install_anydb_ibmdb2: fix sles pkg list --- .../tasks/db2_hadr_pcmk_cluster_create.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml index e9af718e0..4cba6a1e6 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml @@ -56,10 +56,16 @@ - cluster-glue - crmsh - ibcmap4 + - libcorosync_common4 + - libcpg4 + - libsam4 + - libvotequorum8 - libqb100 state: absent disable_gpg_check: true - when: ansible_os_family == 'Suse' + when: + - ansible_os_family == 'Suse' + - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" # Use to avoid removal of OS Package on re-run - name: SAP HA AnyDB - IBM Db2 HADR - Install all IBM Db2 'Integrated Linux Pacemaker' RPMs for SLES community.general.zypper: From 4be33ae5fe4ea6f1f176bfafcb2146acad730ed2 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:36:33 +0100 Subject: [PATCH 068/210] sap_ha_install_anydb_ibmdb2: declare module before task args --- .../tasks/db2_hadr_enable.yml | 42 ++++++++--------- .../tasks/db2_hadr_pcmk_cluster_create.yml | 42 ++++++++--------- .../tasks/main.yml | 46 +++++++++--------- .../platform/ascertain_platform_type.yml | 28 +++++------ .../tasks/platform/db2cm_cloud_aws_ec2_vs.yml | 39 ++++++++------- .../tasks/platform/db2cm_cloud_gcp_ce_vm.yml | 47 +++++++++---------- .../tasks/platform/db2cm_cloud_msazure_vm.yml | 37 +++++++-------- 7 files changed, 139 insertions(+), 142 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml index 9cba338df..de8e8b852 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml @@ -19,11 +19,6 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway - name: SAP HA AnyDB - IBM Db2 HADR - Configure Primary Node Replication # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_enable_primary - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" @@ -38,6 +33,11 @@ db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SYNCMODE NEARSYNC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 + register: __sap_ha_install_anydb_ibmdb2_enable_primary + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" @@ -49,11 +49,6 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway - name: SAP HA AnyDB - IBM Db2 HADR - Configure Secondary Node # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_enable_secondary - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" set anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" @@ -68,6 +63,11 @@ db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_SPOOL_LIMIT AUTOMATIC db2 UPDATE DB CFG FOR $ibmdb2_sid USING HADR_PEER_WINDOW 240 db2 UPDATE DB CFG FOR $ibmdb2_sid USING INDEXREC RESTART LOGINDEXBUILD ON + register: __sap_ha_install_anydb_ibmdb2_enable_secondary + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" @@ -77,13 +77,13 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip - name: SAP HA AnyDB - IBM Db2 HADR - Rollforward Secondary Node # noqa no-changed-when + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 rollforward database $ibmdb2_sid to end of logs become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 rollforward database $ibmdb2_sid to end of logs when: - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" @@ -92,14 +92,14 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip - name: SAP HA AnyDB - IBM Db2 HADR - Start Secondary Standby Node # noqa no-changed-when - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 start hadr on db $ibmdb2_sid as standby + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" @@ -109,14 +109,14 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip - name: SAP HA AnyDB - IBM Db2 HADR - Start Primary Node # noqa no-changed-when - become: true - become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} - args: - executable: /bin/csh ansible.builtin.shell: | set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" db2 deactivate db $ibmdb2_sid db2 start hadr on db $ibmdb2_sid as primary + become: true + become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} + args: + executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - __sap_ha_install_anydb_ibmdb2_hadr_initial_status.stdout != "HADR_CONNECT_STATUS=CONNECTED" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml index 4cba6a1e6..536bace8d 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml @@ -79,11 +79,11 @@ # - command-instead-of-module: Shell commands to match IBM Db2 documentation # - no-changed-when: Command is check only and performs no action - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 'Integrated Linux Pacemaker' is installed # noqa command-instead-of-module no-changed-when - register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check ansible.builtin.shell: | set -o pipefail && rpm -q corosync | grep -I db2pcmk set -o pipefail && rpm -q pacemaker | grep -I db2pcmk set -o pipefail && rpm -q crmsh | grep -I db2pcmk + register: __sap_ha_install_anydb_ibmdb2_pcmk_version_check - name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 'Integrated Linux Pacemaker' installation details ansible.builtin.debug: @@ -153,9 +153,6 @@ # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Linux Pacemaker cluster using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config1 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" @@ -167,6 +164,9 @@ export anydb_secondary_nic="{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].ansible_default_ipv4.interface }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -cluster -domain db2pcmkcluster -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + register: __sap_ha_install_anydb_ibmdb2_config1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout # Corosync setting to be performed on both Primary and Secondary node @@ -174,35 +174,35 @@ # - command-instead-of-module: Shell commands to match IBM Db2 documentation # - no-changed-when: sed will not change anything if already changed - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster # noqa command-instead-of-module no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config2 ansible.builtin.shell: | sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf + register: __sap_ha_install_anydb_ibmdb2_config2 failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config2.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Primary Node instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config3 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export anydb_primary="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_primary + register: __sap_ha_install_anydb_ibmdb2_config3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short failed_when: not __sap_ha_install_anydb_ibmdb2_config3.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config3.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create Secondary Node instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export anydb_secondary="{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -instance $ibmdb2_instance -host $anydb_secondary + register: __sap_ha_install_anydb_ibmdb2_config4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short failed_when: not __sap_ha_install_anydb_ibmdb2_config4.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config4.stdout # Use the IBM Db2 Command Line Processor @@ -210,6 +210,9 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP will not error if config exists but when will attempt to skip anyway - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update IBM Db2 HADR config with greater timeout allowance using db2cm # noqa no-changed-when + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 register: __sap_ha_install_anydb_ibmdb2_config5 # when: # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -217,9 +220,6 @@ become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 UPDATE DB CFG FOR $ibmdb2_sid using HADR_PEER_WINDOW 300 failed_when: not __sap_ha_install_anydb_ibmdb2_config5.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config5.stdout # Use the IBM Db2 Command Line Processor @@ -227,6 +227,10 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip - name: SAP HA AnyDB - IBM Db2 HADR - Primary and Secondary Node - Shutdown and Reactivate # noqa no-changed-when + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 deactivate db $ibmdb2_sid + db2 activate db $ibmdb2_sid register: __sap_ha_install_anydb_ibmdb2_config6 # when: # - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short @@ -234,10 +238,6 @@ become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 deactivate db $ibmdb2_sid - db2 activate db $ibmdb2_sid failed_when: not __sap_ha_install_anydb_ibmdb2_config6.rc == 0 and not 'command completed successfully' in __sap_ha_install_anydb_ibmdb2_config6.stdout # db2cm script must run as root @@ -246,13 +246,13 @@ # Reasons for noqa: # - no-changed-when: Db2 CLP error if config exists so prevent with attempt to skip - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Create IBM Db2 RDBMS instance config in Linux Pacemaker cluster using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config7 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config7 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short failed_when: not __sap_ha_install_anydb_ibmdb2_config7.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config7.stdout - name: SAP HA AnyDB - IBM Db2 HADR - Configure Linux Pacemaker on target infrastructure platform using db2cm diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml index e49666821..9a6795405 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/main.yml @@ -43,14 +43,14 @@ # - no-changed-when: Db2 PD tool is to retrieve information and perform no change # - risky-shell-pipe: csh cannot use 'set -o pipefail &&' and will error with 'set: Variable name must begin with a letter' - name: SAP HA AnyDB - IBM Db2 HADR - Confirm if IBM HADR is already activated (i.e. re-run) # noqa no-changed-when risky-shell-pipe + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2pd -hadr -db $ibmdb2_sid | grep 'HADR_CONNECT_STATUS =' | tr -d ' ' || echo '' register: __sap_ha_install_anydb_ibmdb2_hadr_initial_status become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} args: executable: /bin/csh - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2pd -hadr -db $ibmdb2_sid | grep 'HADR_CONNECT_STATUS =' | tr -d ' ' || echo '' - name: SAP HA AnyDB - IBM Db2 HADR - Warning if IBM Db2 HADR is already activated ansible.builtin.debug: @@ -75,30 +75,33 @@ # Reasons for noqa: # - no-changed-when: Use crmsh to retrieve information and perform no change - name: SAP HA AnyDB - IBM Db2 HADR - Verify crm for IBM Db2 HA Linux Pacemaker initialisation # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_pcmk_check - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | crm --display=plain configure show echo -e "\n\n" crm --display=plain status full + register: __sap_ha_install_anydb_ibmdb2_pcmk_check + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Use db2cm script to retrieve information and perform no change - name: SAP HA AnyDB - IBM Db2 HADR - Verify db2cm for IBM Db2 HA Linux Pacemaker initialisation # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_init_check - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.shell: | export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -list + register: __sap_ha_install_anydb_ibmdb2_init_check + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Use the IBM Db2 Command Line Processor # Reasons for noqa: # - no-changed-when: Use Db2 CLP to retrieve information and perform no change # - risky-shell-pipe: csh cannot use 'set -o pipefail &&' and will error with 'set: Variable name must begin with a letter' - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR configuration # noqa no-changed-when risky-shell-pipe + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' register: __sap_ha_install_anydb_ibmdb2_hadr_config become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} @@ -106,14 +109,14 @@ executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2 get db cfg for $ibmdb2_sid | grep 'Rollforward\|HADR' # Use the IBM Db2 Command Line Processor # Reasons for noqa: # - no-changed-when: Use Db2 CLP to retrieve information and perform no change - name: SAP HA AnyDB - IBM Db2 HADR - Verify IBM Db2 HADR status # noqa no-changed-when + ansible.builtin.shell: | + set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" + db2pd -hadr -db $ibmdb2_sid register: __sap_ha_install_anydb_ibmdb2_hadr_status become: true become_user: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} @@ -121,30 +124,27 @@ executable: /bin/csh when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - ansible.builtin.shell: | - set ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" - db2pd -hadr -db $ibmdb2_sid - name: SAP HA AnyDB - IBM Db2 HADR - Display crm for IBM Db2 HA Linux Pacemaker initialisation - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_pcmk_check.stdout_lines }}" - -- name: SAP HA AnyDB - IBM Db2 HADR - Display db2cm for IBM Db2 HA Linux Pacemaker initialisation when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + +- name: SAP HA AnyDB - IBM Db2 HADR - Display db2cm for IBM Db2 HA Linux Pacemaker initialisation ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_init_check.stdout_lines }}" - -- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR configuration when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + +- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR configuration ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_hadr_config.stdout_lines }}" - -- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR status when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + +- name: SAP HA AnyDB - IBM Db2 HADR - Display IBM Db2 HADR status ansible.builtin.debug: msg: "{{ __sap_ha_install_anydb_ibmdb2_hadr_status.stdout_lines }}" + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index a66fdcc37..d3061dd4d 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -47,30 +47,30 @@ - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Amazon Web Services EC2 Virtual Server + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_aws_ec2_vs when: - '"amazon" in ansible_system_vendor | lower or "amazon" in ansible_product_name | lower' - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_platform: cloud_aws_ec2_vs - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Google Cloud Compute Engine Virtual Machine - when: - - ansible_product_name == 'Google Compute Engine' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_gcp_ce_vm + when: + - ansible_product_name == 'Google Compute Engine' # - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server -# when: -# - ansible_chassis_asset_tag == 'ibmcloud' # ansible.builtin.set_fact: # __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs +# when: +# - ansible_chassis_asset_tag == 'ibmcloud' - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Microsoft Azure Virtual Machine + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_msazure_vm when: - ansible_product_name == 'Virtual Machine' - ansible_chassis_vendor == 'Microsoft Corporation' - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_platform: cloud_msazure_vm # - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power - RSCT binary check # ansible.builtin.shell: | @@ -96,21 +96,21 @@ # - __sap_ha_install_anydb_ibmdb2_power_rsct_check.stdout != "" # - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Power Virtual Server from IBM Cloud +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs # when: # - ansible_architecture == "ppc64le" # - '"ibmcloud" in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' -# ansible.builtin.set_fact: -# __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_powervs # - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM PowerVM +# ansible.builtin.set_fact: +# __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm # when: # - ansible_architecture == "ppc64le" # - '"ibmcloud" not in __sap_ha_install_anydb_ibmdb2_power_rsct_hscid.stdout' -# ansible.builtin.set_fact: -# __sap_ha_install_anydb_ibmdb2_platform: hyp_ibmpower_vm # - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is VMware vSphere" -# when: -# - ansible_virtualization_type == 'VMware' # ansible.builtin.set_fact: # __sap_ha_install_anydb_ibmdb2_platform: hyp_vmware_vsphere_vm +# when: +# - ansible_virtualization_type == 'VMware' diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml index 03e5d3952..619f2553c 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_aws_ec2_vs.yml @@ -31,63 +31,59 @@ # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_aws_1 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_aws_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_1.rc == 0 and not 'already exists in the resource model' in __sap_ha_install_anydb_ibmdb2_config_aws_1.stdout # Setting to be performed on both Primary and Secondary node # Reasons for noqa: # - no-changed-when: Db2 mandates use of AWS CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary and Secondary Node - Provide AWS CLI credentials # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_aws_credentials - when: - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | aws configure set aws_access_key_id "{{ sap_ha_install_anydb_ibmdb2_aws_access_key_id }}" aws configure set aws_secret_access_key "{{ sap_ha_install_anydb_ibmdb2_aws_secret_access_key }}" + register: __sap_ha_install_anydb_ibmdb2_config_aws_credentials + when: + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_aws_2 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -fence + register: __sap_ha_install_anydb_ibmdb2_config_aws_2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_aws_2.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for aws-vpc-move-ip using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_aws_3 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -aws -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -rtb "{{ sap_ha_install_anydb_ibmdb2_aws_vip_update_rt }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_aws_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" failed_when: not __sap_ha_install_anydb_ibmdb2_config_aws_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_aws_3.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (AWS) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_aws_4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" @@ -100,7 +96,10 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - + register: __sap_ha_install_anydb_ibmdb2_config_aws_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_aws_ec2_vs" # Deletion commands: # export ibmdb2_sid="" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml index 09a39ae38..ef50fcfb5 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_gcp_ce_vm.yml @@ -67,76 +67,72 @@ # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_gcp_1 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_gcp_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_gcp_1.stdout # Setting to be performed on both Primary and Secondary node # Reasons for noqa: # - no-changed-when: Db2 mandates use of Google Cloud CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary and Secondary Node - Provide GCloud CLI credentials # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials - when: - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" ansible.builtin.shell: | gcloud auth activate-service-account --key-file="{{ sap_ha_install_anydb_ibmdb2_gcp_credentials_json_file }}" --project="{{ sap_ha_install_anydb_ibmdb2_gcp_project }}" gcloud debug targets list --quiet + register: __sap_ha_install_anydb_ibmdb2_config_gcp_credentials + when: + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" # # VERIFY - Missing fence_gce ? # # db2cm script must run as root # - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm -# register: __sap_ha_install_anydb_ibmdb2_config_gcp_2 -# when: -# - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short -# - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" # ansible.builtin.shell: | # export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" # export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" # /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -fence +# register: __sap_ha_install_anydb_ibmdb2_config_gcp_2 +# when: +# - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short +# - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" # failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_gcp_2.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for gcp-ilb using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_gcp_3 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -primarylbl "{{ sap_ha_install_anydb_ibmdb2_gcp_lb_health_check_port }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_gcp_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_3.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for Virtual IP via IPAddr2 using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_gcp_4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -gcp -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_gcp_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_gcp_4.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_gcp_4.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (Google Cloud) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_gcp_5 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" @@ -149,7 +145,10 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - + register: __sap_ha_install_anydb_ibmdb2_config_gcp_5 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_gcp_ce_vm" # Deletion commands: # export ibmdb2_sid="" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml index 5feabaafb..454ef6c03 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_msazure_vm.yml @@ -65,66 +65,62 @@ # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Virtual IP address for Primary Node using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_msazure_1 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -primaryVIP "{{ sap_ha_install_anydb_ibmdb2_vip_primary_ip_address }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_msazure_1 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_1.rc == 0 and not 'ip address is pingable' in __sap_ha_install_anydb_ibmdb2_config_msazure_1.stdout # Setting to be performed on both Primary and Secondary node # Reasons for noqa: # - no-changed-when: Db2 mandates use of AWS CLI for credentials instead of credential configuration directly via IBM Db2 selected Pacemaker Shell (crmsh) - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary and Secondary Node - Provide MS Azure CLI credentials # noqa no-changed-when + ansible.builtin.shell: | + az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant "{{ sap_ha_install_anydb_ibmdb2_msazure_tenant_id }}" register: __sap_ha_install_anydb_ibmdb2_config_msazure_credentials when: - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" - ansible.builtin.shell: | - az login --service-principal -u "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" -p "{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" --tenant "{{ sap_ha_install_anydb_ibmdb2_msazure_tenant_id }}" # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Fence Agent instantiation using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_msazure_2 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -fence + register: __sap_ha_install_anydb_ibmdb2_config_msazure_2 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_2.rc == 0 and not 'already configured' in __sap_ha_install_anydb_ibmdb2_config_msazure_2.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Create Linux Pacemaker Resource Agent instantiation for azure-lb using db2cm # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_msazure_3 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" export DB2_AZURE_SP_LOGIN="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_id }}" export DB2_AZURE_SP_PASSWD="{{ sap_ha_install_anydb_ibmdb2_msazure_app_client_secret }}" /db2/$ibmdb2_instance/sqllib/bin/db2cm -create -azure -primarylbl "{{ sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port }}" -db $ibmdb2_sid -instance $ibmdb2_instance + register: __sap_ha_install_anydb_ibmdb2_config_msazure_3 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" failed_when: not __sap_ha_install_anydb_ibmdb2_config_msazure_3.rc == 0 and not 'already exists' in __sap_ha_install_anydb_ibmdb2_config_msazure_3.stdout # db2cm script must run as root # Reasons for noqa: # - no-changed-when: Db2 command will error if already exists and not perform changes - name: SAP HA AnyDB - IBM Db2 HADR (MS Azure) - Primary Node - Start Linux Pacemaker cluster and IBM Db2 HADR functionality # noqa no-changed-when - register: __sap_ha_install_anydb_ibmdb2_config_msazure_4 - when: - - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" ansible.builtin.shell: | export ibmdb2_sid="{{ sap_ha_install_anydb_ibmdb2_sid }}" export ibmdb2_instance="db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}" @@ -137,7 +133,10 @@ /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -all /db2/$ibmdb2_instance/sqllib/bin/db2cm -enable -instance $ibmdb2_instance -host $anydb_primary -publicEthernet $anydb_primary_nic -host $anydb_secondary -publicEthernet $anydb_secondary_nic -remote_cmd "ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - + register: __sap_ha_install_anydb_ibmdb2_config_msazure_4 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_msazure_vm" # Deletion commands: # export ibmdb2_sid="" From 37007f44d61150736d59e8143416699234371b80 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 16 Jul 2024 15:56:11 +0200 Subject: [PATCH 069/210] enable classic HANA agent --- roles/sap_ha_pacemaker_cluster/README.md | 7 ++ .../defaults/main.yml | 3 + .../meta/argument_specs.yml | 6 ++ .../tasks/Suse/pre_steps_hana.yml | 70 ++++++++++--------- 4 files changed, 53 insertions(+), 33 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 3ddbb5f72..206377818 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -842,6 +842,13 @@ sap_ha_pacemaker_cluster_resource_defaults: resource-stickiness: 1000 ``` +### sap_ha_pacemaker_cluster_saphanasr_angi_detection + +- _Type:_ `string` +- _Default:_ `True` + +Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
+ ### sap_ha_pacemaker_cluster_stonith_custom - _Type:_ `list` diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 471f89155..94efa79d8 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -179,6 +179,9 @@ sap_ha_pacemaker_cluster_hana_hook_chksrv: false sap_ha_pacemaker_cluster_hana_global_ini_path: "/usr/sap/{{ sap_ha_pacemaker_cluster_hana_sid | upper }}/SYS/global/hdb/custom/config/global.ini" +# Disable auto-detection of SAPHanaSR-angi package and use Classic +sap_ha_pacemaker_cluster_saphanasr_angi_detection: true + ################################################################################ # NetWeaver generic definitions ################################################################################ diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index db39493f8..4ea9ecc51 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -447,6 +447,12 @@ argument_specs: description: - Path with location of global.ini for srHook update + sap_ha_pacemaker_cluster_saphanasr_angi_detection: + default: true + description: + - Disabling this variable enables to use Classic SAPHanaSR agents even on server, + with SAPHanaSR-angi is available. + ########################################################################## # NetWeaver specific parameters ########################################################################## diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml index a55ca1afa..080839e8c 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml @@ -6,40 +6,44 @@ # This is destructive step if executed on running cluster # without proper migration from SAPHanaSR to SAPHanaSR-angi! -# Requirement for package_facts Ansible Module -- name: For SLES ensure OS Package for Python Lib of rpm bindings is enabled for System Python - ansible.builtin.package: - name: python3-rpm - state: present - when: ansible_os_family == "Suse" +- name: "SAP HA Prepare Pacemaker - Block for detection of SAPHanaSR-angi" + when: sap_ha_pacemaker_cluster_saphanasr_angi_detection + block: + # Requirement for package_facts Ansible Module + # SLES: Ensure OS Package for Python Lib of rpm bindings is enabled for System Python + - name: "SAP HA Prepare Pacemaker - Ensure python3-rpm package is present" + ansible.builtin.package: + name: python3-rpm + state: present + when: ansible_os_family == "Suse" -- name: "SAP HA Prepare Pacemaker - Gather installed packages facts" - ansible.builtin.package_facts: - manager: auto + - name: "SAP HA Prepare Pacemaker - Gather installed packages facts" + ansible.builtin.package_facts: + manager: auto -- name: "SAP HA Prepare Pacemaker - Search for SAPHanaSR-angi" - ansible.builtin.command: - cmd: zypper se SAPHanaSR-angi - changed_when: false - register: __sap_ha_pacemaker_cluster_zypper_angi_check - failed_when: false + - name: "SAP HA Prepare Pacemaker - Search for SAPHanaSR-angi" + ansible.builtin.command: + cmd: zypper se SAPHanaSR-angi + changed_when: false + register: __sap_ha_pacemaker_cluster_zypper_angi_check + failed_when: false -# package can be replaced with "rpm -e --nodeps {{ item }}" -- name: "SAP HA Prepare Pacemaker - Remove SAPHanaSR and SAPHanaSR-doc" - ansible.builtin.package: - name: "{{ item }}" - state: absent - loop: - - SAPHanaSR - - SAPHanaSR-doc - when: - - __sap_ha_pacemaker_cluster_zypper_angi_check is defined - - __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0 - - "'SAPHanaSR' in ansible_facts.packages" + # package can be replaced with "rpm -e --nodeps {{ item }}" + - name: "SAP HA Prepare Pacemaker - Remove SAPHanaSR and SAPHanaSR-doc" + ansible.builtin.package: + name: "{{ item }}" + state: absent + loop: + - SAPHanaSR + - SAPHanaSR-doc + when: + - __sap_ha_pacemaker_cluster_zypper_angi_check is defined + - __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0 + - "'SAPHanaSR' in ansible_facts.packages" -- name: "SAP HA Prepare Pacemaker - Set fact angi_available" - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_saphanasr_angi_available: true - when: - - __sap_ha_pacemaker_cluster_zypper_angi_check is defined - - __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0 + - name: "SAP HA Prepare Pacemaker - Set fact angi_available" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_saphanasr_angi_available: true + when: + - __sap_ha_pacemaker_cluster_zypper_angi_check is defined + - __sap_ha_pacemaker_cluster_zypper_angi_check.rc == 0 From 296a498b474d0eaf984f3ff6551eeefa8e3ab240 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:06:22 +0100 Subject: [PATCH 070/210] sap_ha_install_anydb_ibmdb2: change cat in shell to set fact lookup --- .../tasks/passwordless_ssh.yml | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 9220a3fe9..5d4de2f8e 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -75,23 +75,16 @@ register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - # Reasons for noqa: - # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation - - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary node # noqa no-changed-when - ansible.builtin.shell: | - cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub - register: __sap_ha_install_anydb_ibmdb2_primary_pubkey + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_primary_pubkey: "{{ lookup('ansible.builtin.file', '/root/.ssh/anydb_ibmdb2_hadr_' + inventory_hostname_short + '.pub') }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - # Reasons for noqa: - # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation - - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node # noqa no-changed-when - ansible.builtin.shell: | - cat /root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub - register: __sap_ha_install_anydb_ibmdb2_secondary_pubkey + - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_secondary_pubkey: "{{ lookup('ansible.builtin.file', '/root/.ssh/anydb_ibmdb2_hadr_' + inventory_hostname_short + '.pub') }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user ansible.builtin.lineinfile: backup: true @@ -122,7 +115,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator @@ -133,7 +126,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.stdout }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) @@ -195,7 +188,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator @@ -206,7 +199,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.stdout }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) From 76df0a81fa73791305325d95789486f1fd3072c9 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:10:17 +0100 Subject: [PATCH 071/210] sap_ha_install_anydb_ibmdb2: replace lookup with slurp --- .../tasks/passwordless_ssh.yml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 5d4de2f8e..61e539688 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -69,20 +69,24 @@ # Reasons for noqa: # - no-changed-when: Shell if logic to handle SSH Keys between hosts to align with IBM Db2 documentation - - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint pf SAP AnyDB Secondary node # noqa no-changed-when + - name: SAP HA AnyDB - IBM Db2 HADR - Get SSH fingerprint of SAP AnyDB Secondary node # noqa no-changed-when ansible.builtin.shell: | ssh-keyscan -t rsa {{ sap_ha_install_anydb_ibmdb2_hostname_secondary }} register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + # Use slurp Ansible Module instead of lookup('ansible.builtin.file','') which will error "The 'file' lookup had an issue accessing the file" - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_primary_pubkey: "{{ lookup('ansible.builtin.file', '/root/.ssh/anydb_ibmdb2_hadr_' + inventory_hostname_short + '.pub') }}" + ansible.builtin.slurp: + src: "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" + register: __sap_ha_install_anydb_ibmdb2_primary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + # Use slurp Ansible Module instead of lookup('ansible.builtin.file','') which will error "The 'file' lookup had an issue accessing the file" - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node - ansible.builtin.set_fact: - __sap_ha_install_anydb_ibmdb2_secondary_pubkey: "{{ lookup('ansible.builtin.file', '/root/.ssh/anydb_ibmdb2_hadr_' + inventory_hostname_short + '.pub') }}" + ansible.builtin.slurp: + src: "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" + register: __sap_ha_install_anydb_ibmdb2_secondary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SAP AnyDB Secondary node SSH Fingerprint to SSH known_hosts file on SAP AnyDB Primary node - root user @@ -115,7 +119,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator @@ -126,7 +130,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) @@ -188,7 +192,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator @@ -199,7 +203,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) From 016050f0b090e2c71a028bf285f3ef2cecbe5661 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:14:11 +0100 Subject: [PATCH 072/210] sap_ha_install_anydb_ibmdb2: replace sed with lineinfile --- .../tasks/db2_hadr_pcmk_cluster_create.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml index 536bace8d..85ae81491 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_pcmk_cluster_create.yml @@ -170,14 +170,13 @@ failed_when: not __sap_ha_install_anydb_ibmdb2_config1.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config1.stdout # Corosync setting to be performed on both Primary and Secondary node - # Reasons for noqa: - # - command-instead-of-module: Shell commands to match IBM Db2 documentation - # - no-changed-when: sed will not change anything if already changed - - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster # noqa command-instead-of-module no-changed-when - ansible.builtin.shell: | - sed -i 's/token: 10000/token: 30000/g' /etc/corosync/corosync.conf + - name: SAP HA AnyDB - IBM Db2 HADR - Primary Node - Update corosync totem token timeout after creating cluster + ansible.builtin.lineinfile: + path: /etc/corosync/corosync.conf + regexp: '^.*token: 10000' + line: ' token: 30000' + backup: false register: __sap_ha_install_anydb_ibmdb2_config2 - failed_when: not __sap_ha_install_anydb_ibmdb2_config2.rc == 0 and not 'make sure there is no cluster on any of the hosts' in __sap_ha_install_anydb_ibmdb2_config2.stdout # db2cm script must run as root # Reasons for noqa: From 937574ec67c2adff1ba86dab80e0a6985a95cb65 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 10:01:13 +0200 Subject: [PATCH 073/210] sap_hana_preconfigure: add task change validation, task #1 The task "Reload kernel parameters from file /etc/sysctl.d/sap_hana.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2382421.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index b9f0985d6..7272c5e0a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -11,7 +11,7 @@ when: sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_2382421 | d(false) block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + - name: Ensure correct entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes @@ -67,11 +67,21 @@ line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" state: present -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" - register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new.stdout - name: Display kernel parameters for network tuning ansible.builtin.debug: - var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_new.stdout_lines From 6b08367d7c48251f41e0e7b2879ba00cd8e83f00 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 10:11:30 +0200 Subject: [PATCH 074/210] sap_hana_preconfigure: add task change validation, task #2 The task "Reload kernel parameters from file /etc/sysctl.d/91-NetApp-HANA.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/3024346.yml | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 9055a84f4..f399634c8 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -13,7 +13,7 @@ - sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3024346|d(false) block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + - name: Ensure correct entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" create: yes @@ -25,14 +25,24 @@ loop_control: loop_var: line_item -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" + register: __sap_hana_preconfigure_register_netapp_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" + register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" - register: __sap_hana_preconfigure_register_netapp_sysctl_p_output + register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout - name: Display kernel parameters for NetApp NFS ansible.builtin.debug: - var: __sap_hana_preconfigure_register_netapp_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout_lines - name: Set kernel tunable for NFSv3 as per SAP note 3024346 ansible.builtin.lineinfile: From 63962d085947f3b0d1ec9918647ab5195822f89f Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 11:41:45 +0200 Subject: [PATCH 075/210] sap_general_preconfigure: add task change validation, task #1 The task "Reload kernel parameters from file /etc/sysctl.d/sap.conf" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../generic/configure-kernel-parameters.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index a1d75dfd0..32cabbfb3 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -13,11 +13,21 @@ loop_control: loop_var: line_item +- name: Construct the command for getting all current parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" + register: __sap_general_preconfigure_register_sap_conf_sysctl_command + changed_when: false + +- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' + ansible.builtin.shell: "{{ __sap_general_preconfigure_register_sap_conf_sysctl_command.stdout }}" + register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old + changed_when: false + - name: Reload kernel parameters from file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' ansible.builtin.command: sysctl -p "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" - register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output - changed_when: true + register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new + changed_when: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old.stdout != __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new.stdout - name: Display kernel parameters after setting kernel.pid_max ansible.builtin.debug: - var: __sap_general_preconfigure_register_sap_conf_sysctl_p_output.stdout_lines + var: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_new.stdout_lines From 7ac6ced3b65a143db7f385ede3a042525c3c8375 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 12:00:04 +0200 Subject: [PATCH 076/210] sap_general_preconfigure: add tag for skipping molecule test, task #2 The task "Ensure that the required package groups are installed, RHEL 8.1" now has a tag for skipping the molecule idempotency test Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 1fa7b2afb..4de0d93dc 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -120,6 +120,7 @@ ansible.builtin.command: "yum install {{ sap_general_preconfigure_packagegroups | join(' ') }} --nobest --exclude=kernel* -y" register: __sap_general_preconfigure_register_yum_group_install when: ansible_distribution_version == '8.1' + tags: molecule-idempotence-notest # possible replacement once we no longer need Ansible 2.9 compatibility: #- name: Ensure that the required package groups are installed, RHEL 8 and 9 From 734ee52bad9273fe507b0da212bded1687492e5e Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:36:28 +0100 Subject: [PATCH 077/210] sap_ha_install_anydb_ibmdb2: fix for slurp output --- .../tasks/passwordless_ssh.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index 61e539688..b06d8cd86 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -119,7 +119,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content | b64decode }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Primary node - IBM Db2 Database Administrator @@ -130,7 +130,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_secondary_pubkey.content | b64decode }}" when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) @@ -192,7 +192,7 @@ path: /root/.ssh/authorized_keys owner: root group: root - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content | b64decode }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - name: SAP HA AnyDB - IBM Db2 HADR - Inject SSH Public Key to SSH authorized_keys file on SAP AnyDB Secondary node (authentication method publickey) - IBM Db2 Database Administrator @@ -203,7 +203,7 @@ path: /db2/db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }}/.ssh/authorized_keys owner: db2{{ sap_ha_install_anydb_ibmdb2_sid | lower }} group: db{{ sap_ha_install_anydb_ibmdb2_sid | lower }}adm - line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content }}" + line: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_primary_pubkey.content | b64decode }}" when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short # Avoid use of default id_rsa file or SSH Agent (ssh-add) From ec479ac6b0c0bc431e87083e2556c26f1a8f9cf1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 13:03:48 +0200 Subject: [PATCH 078/210] sap_general_preconfigure: add more tags for skipping molecule tests Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_general_preconfigure/handlers/main.yml | 1 + roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml index cdbd8a607..e54f6dd56 100644 --- a/roles/sap_general_preconfigure/handlers/main.yml +++ b/roles/sap_general_preconfigure/handlers/main.yml @@ -43,6 +43,7 @@ - name: Remount /dev/shm # noqa command-instead-of-module no-changed-when ansible.builtin.command: mount -o remount /dev/shm listen: __sap_general_preconfigure_mount_tmpfs_handler + tags: molecule-idempotence-notest - name: Check if /dev/shm is available ansible.builtin.command: df -h /dev/shm diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 4de0d93dc..55ff79239 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -74,6 +74,7 @@ # and then having to compare the output against the list of desired repos - name: Run the subscription-manager command # noqa no-changed-when ansible.builtin.command: "{{ __sap_general_preconfigure_fact_subscription_manager_command }}" + tags: molecule-idempotence-notest # Reason for noqa: We need the output of the yum command - name: Get list of enabled repositories @@ -104,6 +105,7 @@ when: - sap_general_preconfigure_set_minor_release - __sap_general_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version + tags: molecule-idempotence-notest - name: Ensure that the required package groups are installed, RHEL except 8.1 ansible.builtin.package: From b2856a94b9a0be3822b056405cc6d8c403202c28 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 13:06:14 +0200 Subject: [PATCH 079/210] sap_hana_preconfigure: add tag for skipping molecule test Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/RedHat/installation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml index a7a51f79f..1ffcd4be5 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml @@ -42,6 +42,7 @@ - name: Enable required repositories # noqa no-changed-when ansible.builtin.command: "subscription-manager repos {{ __sap_hana_preconfigure_fact_required_repos_args | map('quote') | join(' ') }}" register: __sap_hana_preconfigure_register_subscription_enable_repos + tags: molecule-idempotence-notest - name: Display the output of the subscription-manager repos --enable command ansible.builtin.debug: From 19b372c9fe77215313807dd2067041548cf3b787 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 14:33:07 +0200 Subject: [PATCH 080/210] sap_hana_preconfigure: add task change validation, task #3 The task "Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf'" now recognizes a parameter change. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2055470.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 286c35ee5..258a6c0d0 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -66,11 +66,21 @@ loop_control: loop_var: line_item -# Reason for noqa: We unconditionally reload the kernel parameters without first checking the current values - - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' # noqa no-changed-when + - name: Construct the command for getting all current parameters of file '/etc/sysctl.d/ibm_largesend.conf' + ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' /etc/sysctl.d/ibm_largesend.conf + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command + changed_when: false + + - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' + ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_ibm_largesend_sysctl_command.stdout }}" + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old + changed_when: false + + - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' ansible.builtin.command: sysctl -p /etc/sysctl.d/ibm_largesend.conf - register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new + changed_when: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old.stdout != __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new.stdout - name: Display largesend kernel parameters ansible.builtin.debug: - var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output.stdout_lines + var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_new.stdout_lines From d338b541cecde09482aa283f418f0b9bc8946b8b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:16:15 +0100 Subject: [PATCH 081/210] sap_ha_install_anydb_ibmdb2: remove slurp comments --- roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml index b06d8cd86..97692b2b2 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/passwordless_ssh.yml @@ -75,14 +75,12 @@ register: __sap_ha_install_anydb_ibmdb2_secondary_ssh_fingerprint when: sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short - # Use slurp Ansible Module instead of lookup('ansible.builtin.file','') which will error "The 'file' lookup had an issue accessing the file" - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Primary ansible.builtin.slurp: src: "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" register: __sap_ha_install_anydb_ibmdb2_primary_pubkey when: sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short - # Use slurp Ansible Module instead of lookup('ansible.builtin.file','') which will error "The 'file' lookup had an issue accessing the file" - name: SAP HA AnyDB - IBM Db2 HADR - Get contents of SSH Public Key for SAP AnyDB Secondary node ansible.builtin.slurp: src: "/root/.ssh/anydb_ibmdb2_hadr_{{ inventory_hostname_short }}.pub" From 7d5daaff98e19b60b67c2be84f35d2f098dac29f Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 15:53:17 +0200 Subject: [PATCH 082/210] sap*preconfigure: Ansible-lint cleanup for the modifications for #752 Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/configure-kernel-parameters.yml | 3 ++- roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 3 ++- roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 2 +- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index 32cabbfb3..6c681f68e 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -18,7 +18,8 @@ register: __sap_general_preconfigure_register_sap_conf_sysctl_command changed_when: false -- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' +# Reason for noqa: The command module tries to run the complete string as a single command +- name: Get all currently active values of the parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_general_preconfigure_register_sap_conf_sysctl_command.stdout }}" register: __sap_general_preconfigure_register_sap_conf_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 258a6c0d0..0a33286cc 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -71,7 +71,8 @@ register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command changed_when: false - - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' +# Reason for noqa: The command module tries to run the complete string as a single command + - name: Get all currently active values of the parameters of file '/etc/sysctl.d/ibm_largesend.conf' # noqa command-instead-of-shell ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_ibm_largesend_sysctl_command.stdout }}" register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index 7272c5e0a..07e84488a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -73,7 +73,7 @@ changed_when: false - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' - ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" + ansible.builtin.command: "{{ __sap_hana_preconfigure_register_saphana_conf_sysctl_command.stdout }}" register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output_old changed_when: false diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index f399634c8..9000acf28 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -30,7 +30,9 @@ register: __sap_hana_preconfigure_register_netapp_sysctl_command changed_when: false - - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' +# Reason for noqa: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. Also +# the command after the pipe is not expected to fail. + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old changed_when: false From ed6fdd7e2f82051b3f98b48aa9b31d1ac9682a54 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 16:00:46 +0200 Subject: [PATCH 083/210] collection: Add collection dependency for community.general for fixing the galaxy-importer error "syntax-check[unknown-module]: couldn'\''t resolve module/action '\''community.general.zypper'\''" Signed-off-by: Bernd Finger --- requirements.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.yml b/requirements.yml index 837504c71..16eeebcac 100644 --- a/requirements.yml +++ b/requirements.yml @@ -4,3 +4,6 @@ collections: - name: fedora.linux_system_roles version: '>=1.13.0' type: galaxy + - name: community.general + version: latest + type: galaxy From ca7d234cece022667f8d6aa5fa20cbd314685e72 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 16:20:53 +0200 Subject: [PATCH 084/210] sap_hana_preconfigure: Add ansible-lint 6.22.2 compliance Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 9000acf28..b2428b3ea 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -30,9 +30,10 @@ register: __sap_hana_preconfigure_register_netapp_sysctl_command changed_when: false -# Reason for noqa: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. Also -# the command after the pipe is not expected to fail. - - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe +# Reason for noqa - risky-shell-pipe: when adding 'set -o pipefail', the complete string is attempted to be executed as a single command. +# Also the command after the pipe is not expected to fail. +# Reason for noqa - no-tabs: This is a false positive in ansible-lint 6.22.2, removed in 24.5.0. See https://github.com/ansible/ansible-lint/issues/4020 + - name: Get all currently active values of the parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' # noqa risky-shell-pipe no-tabs ansible.builtin.shell: "{{ __sap_hana_preconfigure_register_netapp_sysctl_command.stdout }} | sed 's,\t, ,g'" register: __sap_hana_preconfigure_register_netapp_sysctl_p_output_old changed_when: false From de5520bec646a43bdb821e6b4213e9aab77d5ecd Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:10:21 +0100 Subject: [PATCH 085/210] sap_*preconfigure: edge case handling for sles pkgs --- roles/sap_hana_preconfigure/tasks/SLES/configuration.yml | 1 + roles/sap_hana_preconfigure/tasks/SLES/installation.yml | 6 ++++++ .../sap_netweaver_preconfigure/tasks/SLES/configuration.yml | 1 + 3 files changed, 8 insertions(+) diff --git a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml index 30da5463d..1cc024a22 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml @@ -8,6 +8,7 @@ name: sapconf state: stopped enabled: false + when: "'sapconf' in ansible_facts.packages" - name: Make sure that sapconf and tuned are stopped and disabled ansible.builtin.command: "saptune service takeover" diff --git a/roles/sap_hana_preconfigure/tasks/SLES/installation.yml b/roles/sap_hana_preconfigure/tasks/SLES/installation.yml index e5810687a..270fe3eec 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/installation.yml @@ -7,6 +7,12 @@ name: "*" when: sap_hana_preconfigure_update | bool +# SAP Note 2892338 +- name: Ensure package insserv-compat exists + ansible.builtin.package: + state: present + name: insserv-compat + # ----------- - name: Get contents of /etc/products.d/baseproduct ansible.builtin.stat: diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml index 2dcedf5f4..5463a1100 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml @@ -8,6 +8,7 @@ name: sapconf state: stopped enabled: false + when: "'sapconf' in ansible_facts.packages" - name: Make sure that sapconf and tuned are stopped and disabled ansible.builtin.command: "saptune service takeover" From 20dccf144f9d137a5e42503a3a5771c05dfc558e Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 17:28:47 +0200 Subject: [PATCH 086/210] collection: Fix 'yaml[octal-values]' Solves issue #810. Signed-off-by: Bernd Finger --- .yamllint.yml | 3 +++ .../tasks/RedHat/generic/increase-nofile-limits.yml | 4 ++-- .../tasks/RedHat/generic/increase-nproc-limits.yml | 4 ++-- .../sap_hana_install/tasks/pre_install/extract_sarfile.yml | 2 +- .../sap_hana_install/tasks/pre_install/prepare_sarfiles.yml | 2 +- .../generic/configure-cpu-governor-for-performance.yml | 2 +- .../tasks/RedHat/generic/configure-epb.yml | 2 +- .../tasks/RedHat/generic/disable-coredumps.yml | 2 +- .../tasks/RedHat/generic/disable-ksm.yml | 2 +- roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 2 +- roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 6 +++--- .../tasks/sapnote/2684254/configuration.yml | 4 ++-- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 4 ++-- .../tasks/generic_tasks/configure_swap.yml | 2 +- 14 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.yamllint.yml b/.yamllint.yml index 57ef427c1..4c75ea75d 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -19,3 +19,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml index cdf2926f2..350d64056 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nofile-limits.yml @@ -9,7 +9,7 @@ ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes - mode: 0644 + mode: "0644" regexp: '^@sapsys\s+{{ line_item }}\s+nofile\s.*' line: "@sapsys\t{{ line_item }}\tnofile\t1048576" with_items: @@ -26,7 +26,7 @@ ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes - mode: 0644 + mode: "0644" regexp: '^@{{ sap_general_preconfigure_db_group_name }}\s+{{ line_item }}\s+nofile\s.*' line: "@{{ sap_general_preconfigure_db_group_name }}\t{{ line_item }}\tnofile\t1048576" with_items: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml index f34a85627..fa62cd8c7 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/increase-nproc-limits.yml @@ -9,7 +9,7 @@ ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes - mode: 0644 + mode: "0644" regexp: '^@sapsys\s+{{ line_item }}\s+nproc\s.*' line: "@sapsys\t{{ line_item }}\tnproc\tunlimited" with_items: @@ -26,7 +26,7 @@ ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes - mode: 0644 + mode: "0644" regexp: '^@{{ sap_general_preconfigure_db_group_name }}\s+{{ line_item }}\s+nproc\s.*' line: "@{{ sap_general_preconfigure_db_group_name }}\t{{ line_item }}\tnproc\tunlimited" with_items: diff --git a/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml b/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml index 2a43ff6f8..041fc08dd 100644 --- a/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml +++ b/roles/sap_hana_install/tasks/pre_install/extract_sarfile.yml @@ -15,7 +15,7 @@ ansible.builtin.file: path: "{{ __sap_hana_install_tmp_software_extract_directory }}" state: directory - mode: 0755 + mode: "0755" owner: root group: root diff --git a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml index 17868b21e..299e8dbbe 100644 --- a/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml +++ b/roles/sap_hana_install/tasks/pre_install/prepare_sarfiles.yml @@ -52,7 +52,7 @@ src: "{{ __sap_hana_install_fact_software_directory }}/{{ item }}" dest: "{{ sap_hana_install_software_extract_directory }}/sarfiles/{{ item }}" remote_src: true - mode: 0755 + mode: "0755" owner: root group: root with_items: "{{ __sap_hana_install_fact_sarfiles }}" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml index ba9efc261..edc54174e 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml @@ -29,7 +29,7 @@ ansible.builtin.file: path: /etc/rc.d/rc.local state: touch - mode: 0644 + mode: "0644" - name: Configure CPU Governor for performance at boot time (x86_64 platform only) ansible.builtin.lineinfile: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml index 635a0b00e..c14e08c33 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml @@ -30,7 +30,7 @@ ansible.builtin.file: path: /etc/init.d/boot.local state: touch - mode: 0755 + mode: "0755" - name: Configure EPB at boot time ansible.builtin.lineinfile: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml index c52a036ce..758cfc231 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-coredumps.yml @@ -8,7 +8,7 @@ ansible.builtin.lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes - mode: 0644 + mode: "0644" regexp: '^\*\s+{{ line_item }}\s+core\s.*' line: "*\t{{ line_item }}\tcore\t0" with_items: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml index 399aa7b27..556d3b217 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/disable-ksm.yml @@ -10,7 +10,7 @@ ansible.builtin.file: path: /etc/init.d/boot.local state: touch - mode: 0755 + mode: "0755" when: not __sap_hana_preconfigure_register_stat_boot_local_ksm.stat.exists - name: Disable KSM at boot time diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 286c35ee5..bbeba79f2 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -58,7 +58,7 @@ ansible.builtin.lineinfile: path: /etc/sysctl.d/ibm_largesend.conf create: yes - mode: 0644 + mode: "0644" regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index b9f0985d6..561a6cb50 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -15,7 +15,7 @@ ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes - mode: 0644 + mode: "0644" regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present @@ -53,7 +53,7 @@ ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes - mode: 0644 + mode: "0644" regexp: ^net.core.wmem_max.* line: "net.core.wmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem.stdout.split()[-1] }}" state: present @@ -62,7 +62,7 @@ ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes - mode: 0644 + mode: "0644" regexp: ^net.core.rmem_max.* line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" state: present diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml index 2f1bb679d..ce8da0002 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2684254/configuration.yml @@ -66,7 +66,7 @@ - name: "Energy Performance Bias (EPB, applies to Intel-based systems only)" ansible.builtin.lineinfile: path: /etc/init.d/boot.local - mode: 0744 + mode: "0744" line: 'cpupower set -b 0' state: present create: yes @@ -74,7 +74,7 @@ - name: Kernel samepage merging (KSM) ansible.builtin.lineinfile: dest: /etc/init.d/boot.local - mode: 0744 + mode: "0744" line: echo 0 > /sys/kernel/mm/ksm/run state: present create: yes diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 9055a84f4..544e40afc 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -17,7 +17,7 @@ ansible.builtin.lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" create: yes - mode: 0644 + mode: "0644" regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present @@ -38,7 +38,7 @@ ansible.builtin.lineinfile: path: /etc/modprobe.d/sunrpc.conf create: yes - mode: 0644 + mode: "0644" regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128 when: sap_hana_preconfigure_use_netapp_settings_nfsv3 diff --git a/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml b/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml index 4a4db5ea4..af604c94f 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/configure_swap.yml @@ -37,7 +37,7 @@ - name: SAP Storage Setup - (swap file) Adjust file permissions ansible.builtin.file: path: "{{ swap_file.swap_path }}" - mode: 0600 + mode: "0600" - name: SAP Storage Setup - (swap file) Create and activate swap ansible.builtin.shell: | From 3cbff04045c16010c38c9358366b76e329e38309 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 17 Jul 2024 17:41:01 +0200 Subject: [PATCH 087/210] collection: define comments.min-spaces-from-content in .yamllint.yml Also add "require-starting-space: false" because the former triggers 117 violations of "Missing starting space in comment". Signed-off-by: Bernd Finger --- .yamllint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.yamllint.yml b/.yamllint.yml index 4c75ea75d..6d1476a8b 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -7,7 +7,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} From 401d314cf524cb272dddc631b13499c3c15d7a38 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 10:32:32 +0200 Subject: [PATCH 088/210] sap*preconfigure: Add explanations for the additional tasks These additional tasks are necessary to correctly report the 'changed' state of 'sysctl -p'. Relates to #752. Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/configure-kernel-parameters.yml | 3 +++ roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml | 3 +++ roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml index 6c681f68e..f498cdce8 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-kernel-parameters.yml @@ -13,6 +13,9 @@ loop_control: loop_var: line_item +# Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters +# in sap_general_preconfigure_etc_sysctl_sap_conf so that the "Reload kernel parameters from file ..." task +# can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . - name: Construct the command for getting all current parameters of file '{{ sap_general_preconfigure_etc_sysctl_sap_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ sap_general_preconfigure_etc_sysctl_sap_conf }}" register: __sap_general_preconfigure_register_sap_conf_sysctl_command diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 0a33286cc..8bd97e5ec 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -66,6 +66,9 @@ loop_control: loop_var: line_item +# Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters +# in '/etc/sysctl.d/ibm_largesend.conf' so that the "Reload kernel parameters from file ..." task +# can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . - name: Construct the command for getting all current parameters of file '/etc/sysctl.d/ibm_largesend.conf' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' /etc/sysctl.d/ibm_largesend.conf register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_command diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index b2428b3ea..765b93169 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -25,6 +25,9 @@ loop_control: loop_var: line_item +# Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters +# in __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf so that the "Reload kernel parameters from file ..." task +# can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" register: __sap_hana_preconfigure_register_netapp_sysctl_command From f3abff5a288e3f83b0c9ee845e6473d8a3b9c856 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 10:51:50 +0200 Subject: [PATCH 089/210] sap_hana_preconfigure: Add explanation for one more task This additional task is necessary to correctly report the 'changed' state of 'sysctl -p'. Relates to #752. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index 07e84488a..823a604f9 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -67,6 +67,9 @@ line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" state: present +# Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters +# in __sap_hana_preconfigure_etc_sysctl_saphana_conf so that the "Reload kernel parameters from file ..." task +# can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . - name: Construct the command for getting all current parameters of file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' ansible.builtin.command: awk 'BEGIN{FS="="; printf ("sysctl ")}{printf ("%s ", $1)}' "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" register: __sap_hana_preconfigure_register_saphana_conf_sysctl_command From 6b962bf779d5c7b46393a4f511167ce06ccc5007 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 11:36:23 +0200 Subject: [PATCH 090/210] sap_hana_preconfigure: Ensure the absence of two NetApp NFS parameters ... in file __sap_hana_preconfigure_etc_sysctl_saphana_conf. Solves issue #814. Signed-off-by: Bernd Finger --- .../tasks/sapnote/3024346.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 765b93169..a63bcb257 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -25,6 +25,22 @@ loop_control: loop_var: line_item +# Due to sysctl config file precedence rules, it can happen that previous entries in +# __sap_hana_preconfigure_etc_sysctl_saphana_conf remain in effect even after setting +# different parameter values in __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf. +# So we have to ensure that those duplicate entries are not present. +# See also https://github.com/sap-linuxlab/community.sap_install/issues/196. + - name: Ensure kernel tunables for NetApp NFS are not in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + ansible.builtin.lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + regexp: ^{{ line_item }} + state: absent + with_items: + - 'net.core.wmem_max' + - 'net.core.rmem_max' + loop_control: + loop_var: line_item + # Note: The sole purpose of the following two tasks is to collect the current value(s) of the kernel parameters # in __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf so that the "Reload kernel parameters from file ..." task # can correctly report its 'changed' state. See also https://github.com/sap-linuxlab/community.sap_install/issues/752 . From 64ff78179290a50012331c4a27e87624cc99ede2 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 12:10:15 +0200 Subject: [PATCH 091/210] sap_hana_preconfigure: modify version string for SAP note 3024346 Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/README.md | 7 ------- roles/sap_hana_preconfigure/defaults/main.yml | 4 ---- roles/sap_hana_preconfigure/meta/argument_specs.yml | 8 -------- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 5 ++--- roles/sap_hana_preconfigure/vars/RedHat_7.yml | 4 ++-- roles/sap_hana_preconfigure/vars/RedHat_8.yml | 4 ++-- roles/sap_hana_preconfigure/vars/RedHat_9.yml | 4 ++-- 7 files changed, 8 insertions(+), 28 deletions(-) diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index 6ee18a682..4459ca657 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -326,13 +326,6 @@ Network related linux kernel parameter settings for platform ppc64le.
Set to `true` to also set NetApp NFS required kernel parameters.
-### sap_hana_preconfigure_use_netapp_settings_nfsv3 -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used,
-this parameter must be set to `true` as well.
- ### sap_hana_preconfigure_install_ibm_power_tools - _Type:_ `bool` - _Default:_ `true` diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index de9bb3efd..741fed623 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -130,10 +130,6 @@ sap_hana_preconfigure_kernel_parameters_ppc64le: "{{ __sap_hana_preconfigure_ker sap_hana_preconfigure_use_netapp_settings_nfs: false # Set to `true` to also set NetApp NFS required kernel parameters. -sap_hana_preconfigure_use_netapp_settings_nfsv3: false -# If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used, -# this parameter must be set to `true` as well. - sap_hana_preconfigure_install_ibm_power_tools: true # Set this parameter to `false` to not install the IBM Power Systems service and productivity tools. diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index 1d3427b70..159ed5df1 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -273,14 +273,6 @@ argument_specs: required: false type: bool - sap_hana_preconfigure_use_netapp_settings_nfsv3: - default: false - description: - - If `sap_hana_preconfigure_use_netapp_settings_nfs` is set to `true` and NFS Version 3 is to be used, - - this parameter must be set to `true` as well. - required: false - type: bool - sap_hana_preconfigure_install_ibm_power_tools: default: true description: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index a63bcb257..966eb1ffb 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -66,11 +66,10 @@ ansible.builtin.debug: var: __sap_hana_preconfigure_register_netapp_sysctl_p_output_new.stdout_lines - - name: Set kernel tunable for NFSv3 as per SAP note 3024346 + - name: Set kernel tunable 'tcp_max_slot_table_entries' to '128' in file '/etc/modprobe.d/sunrpc.conf' ansible.builtin.lineinfile: path: /etc/modprobe.d/sunrpc.conf - create: yes + create: true mode: 0644 regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128 - when: sap_hana_preconfigure_use_netapp_settings_nfsv3 diff --git a/roles/sap_hana_preconfigure/vars/RedHat_7.yml b/roles/sap_hana_preconfigure/vars/RedHat_7.yml index ba44937f8..e1c09763a 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_7.yml @@ -45,14 +45,14 @@ __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2009879', version: '28' } - { number: '2292690', version: '38' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2009879', version: '28' } - { number: '2055470', version: '85' } - { number: '2292690', version: '38' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" diff --git a/roles/sap_hana_preconfigure/vars/RedHat_8.yml b/roles/sap_hana_preconfigure/vars/RedHat_8.yml index d040ea03e..432848f1a 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_8.yml @@ -125,13 +125,13 @@ __sap_hana_preconfigure_req_repos_redhat_8_10_ppc64le: __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2777782', version: '40' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '87' } - { number: '2777782', version: '40' } - { number: '2382421', version: '40' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 8c3b476b6..ebc31864c 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -122,13 +122,13 @@ __sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '90' } - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '3' } + - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" From 5f8f7f0a2c44ee854a02c2cc14e53efb2723ef39 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:57:33 +0100 Subject: [PATCH 092/210] sap_ha_install_anydb_ibmdb2: append ibmcloud_vs --- roles/sap_ha_install_anydb_ibmdb2/README.md | 18 +- .../defaults/main.yml | 22 +- .../handlers/main.yml | 6 + .../platform/ascertain_platform_type.yml | 10 +- .../platform/db2cm_cloud_ibmcloud_vs.yml | 248 ++++++++++++++++++ 5 files changed, 281 insertions(+), 23 deletions(-) create mode 100644 roles/sap_ha_install_anydb_ibmdb2/handlers/main.yml create mode 100644 roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index c96936ec0..808f032ed 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -5,7 +5,7 @@ Ansible Role for instantiation of IBM Db2 'Integrated Linux Pacemaker' HADR cluster Note: IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models: -- Mutual Failover option, not covered by this Ansible Role +- Mutual Failover option, **not** covered by this Ansible Role - High Availability and Disaster Recovery (HADR) option for Idle Standby, initialised by this Ansible Role @@ -33,11 +33,11 @@ It is applicable to 11.5.9 and later, which provides `db2cm` binary compatibilit ### Target host - Infrastructure Platforms -Applicable for: - -- Amazon Web Services -- Google Cloud -- Microsoft Azure +This Ansible Role contains Infrastructure Platform specific alterations for: +- AWS EC2 Virtual Servers +- Microsoft Azure Virtual Machines +- Google Cloud Compute Engine Virtual Machine +- IBM Cloud Virtual Server ### Target host - Operating System requirements @@ -63,9 +63,9 @@ Sample Ansible Playbook Execution: - community.sap_install vars: - sap_ha_install_anydb_ibmdb2_hostname_primary: anydb-primary - sap_ha_install_anydb_ibmdb2_hostname_secondary: anydb-second - sap_ha_install_anydb_ibmdb2_sid: DB2 + sap_ha_install_anydb_ibmdb2_sid: SD1 # Sandbox Database for D01 SAP System + sap_ha_install_anydb_ibmdb2_hostname_primary: db2-p + sap_ha_install_anydb_ibmdb2_hostname_secondary: db2-s sap_ha_install_anydb_ibmdb2_software_directory: /software/ibmdb2_extracted - name: Execute Ansible Role sap_ha_install_anydb_ibmdb2 diff --git a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml index 8c7a5dee2..6ab2da107 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/defaults/main.yml @@ -9,17 +9,21 @@ sap_ha_install_anydb_ibmdb2_hostname_secondary: sap_ha_install_anydb_ibmdb2_software_directory: -sap_ha_install_anydb_ibmdb2_vip_primary_ip_address: "" +sap_ha_install_anydb_ibmdb2_vip_primary_ip_address: -sap_ha_install_anydb_ibmdb2_aws_access_key_id: "" -sap_ha_install_anydb_ibmdb2_aws_secret_access_key: "" -sap_ha_install_anydb_ibmdb2_aws_vip_update_rt: "" +sap_ha_install_anydb_ibmdb2_aws_access_key_id: +sap_ha_install_anydb_ibmdb2_aws_secret_access_key: +sap_ha_install_anydb_ibmdb2_aws_vip_update_rt: -sap_ha_install_anydb_ibmdb2_msazure_tenant_id: "" -sap_ha_install_anydb_ibmdb2_msazure_app_client_id: "" -sap_ha_install_anydb_ibmdb2_msazure_app_client_secret: "" +sap_ha_install_anydb_ibmdb2_msazure_tenant_id: +sap_ha_install_anydb_ibmdb2_msazure_app_client_id: +sap_ha_install_anydb_ibmdb2_msazure_app_client_secret: sap_ha_install_anydb_ibmdb2_msazure_lb_health_check_port: 62700 -sap_ha_install_anydb_ibmdb2_gcp_credentials_json_file: "" -sap_ha_install_anydb_ibmdb2_gcp_project: "" +sap_ha_install_anydb_ibmdb2_gcp_credentials_json_file: +sap_ha_install_anydb_ibmdb2_gcp_project: sap_ha_install_anydb_ibmdb2_gcp_lb_health_check_port: 62700 + +sap_ha_install_anydb_ibmdb2_ibmcloud_api_key: +sap_ha_install_anydb_ibmdb2_ibmcloud_region: +sap_ha_install_anydb_ibmdb2_ibmcloud_health_check_port: 62700 diff --git a/roles/sap_ha_install_anydb_ibmdb2/handlers/main.yml b/roles/sap_ha_install_anydb_ibmdb2/handlers/main.yml new file mode 100644 index 000000000..22db7dda0 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/handlers/main.yml @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +- name: "Reload systemd daemon" + ansible.builtin.systemd_service: + daemon_reload: true + listen: "systemd daemon-reload" diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index d3061dd4d..e51d7f721 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -59,11 +59,11 @@ when: - ansible_product_name == 'Google Compute Engine' -# - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server -# ansible.builtin.set_fact: -# __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs -# when: -# - ansible_chassis_asset_tag == 'ibmcloud' +- name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server + when: + - ansible_chassis_asset_tag == 'ibmcloud' + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Microsoft Azure Virtual Machine ansible.builtin.set_fact: diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml new file mode 100644 index 000000000..19f9ed9c1 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml @@ -0,0 +1,248 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Set Facts + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_ibmcloud_resource_name: res_fence_ibm_vpc + __sap_ha_install_anydb_ibmdb2_ibmcloud_agent_name: stonith:fence_ibm_vpc + __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb: service:haproxy + __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name: "{{ sap_ha_install_anydb_ibmdb2_sid }}prim" + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Fence Agent Packages for RHEL + ansible.builtin.package: + name: + - fence-agents-ibm-vpc + - haproxy + state: present + when: ansible_os_family == 'RedHat' + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Fence Agent Packages for SLES + ansible.builtin.package: + name: + - fence-agents + - haproxy + state: present + when: ansible_os_family == 'Suse' + + +# Reasons for noqa: +# - no-changed-when: There is no ansible fact with the fully qualified VM Instance ID. We get this information from the SMBIOS/DMI +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Register Instance ID # noqa no-changed-when + ansible.builtin.shell: | + dmidecode -s system-family + register: __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_primary_instance_id_shell + changed_when: false + check_mode: false + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + +# Reasons for noqa: +# - no-changed-when: There is no ansible fact with the fully qualified VM Instance ID. We get this information from the SMBIOS/DMI +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Secondary Node - Register Instance ID # noqa no-changed-when + ansible.builtin.shell: | + dmidecode -s system-family + register: __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_secondary_instance_id_shell + changed_when: false + check_mode: false + when: + - sap_ha_install_anydb_ibmdb2_hostname_secondary == inventory_hostname_short + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Set Facts + ansible.builtin.set_fact: + __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_primary_instance_id: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_primary].__sap_ha_install_anydb_ibmdb2_ibmcloud_fence_primary_instance_id_shell.stdout }}" + __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_secondary_instance_id: "{{ hostvars[sap_ha_install_anydb_ibmdb2_hostname_secondary].__sap_ha_install_anydb_ibmdb2_ibmcloud_fence_secondary_instance_id_shell.stdout }}" + + +# - name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Create haproxy log directory for rsyslog +# ansible.builtin.file: +# path: /var/log/haproxy +# state: directory +# mode: '0755' +# +# - name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Create haproxy config for rsyslog +# ansible.builtin.copy: +# dest: /etc/rsyslog.d/haproxy.conf +# mode: '0644' +# content: | +# # Additional socket in haproxy's chroot +# # to allow logging via /dev/log to chroot'ed HAProxy processes +# $AddUnixListenSocket /var/lib/haproxy/dev/log +# +# # Send HAProxy messages to a dedicated logfile +# :programname,startswith,"haproxy" /var/log/haproxy/haproxy.log +# +# - name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - rsyslog service restart +# ansible.builtin.service: +# name: rsyslog +# state: restarted +# enabled: true + + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Check if haproxy service template exists + ansible.builtin.stat: + path: /etc/systemd/system/haproxy@.service + register: __sap_ha_install_anydb_ibmdb2_register_haproxy_template + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Create haproxy service template + ansible.builtin.copy: + dest: /etc/systemd/system/haproxy@.service + remote_src: true + src: /usr/lib/systemd/system/haproxy.service + mode: '0644' + when: + - not __sap_ha_install_anydb_ibmdb2_register_haproxy_template.stat.exists + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Update haproxy service template description + ansible.builtin.lineinfile: + backup: true + path: /etc/systemd/system/haproxy@.service + regexp: '^Description=' + line: 'Description=HAProxy Load Balancer %i' + state: present + insertafter: '^[Unit]$' + notify: "systemd daemon-reload" + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Update haproxy service template environment + ansible.builtin.lineinfile: + backup: true + path: /etc/systemd/system/haproxy@.service + regexp: '^Environment=' + line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' + state: present + insertafter: '^[Service]$' + notify: "systemd daemon-reload" + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Create haproxy config + ansible.builtin.blockinfile: + backup: false + create: true + path: "/etc/haproxy/haproxy-{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}.cfg" + mode: "0644" + owner: root + group: root + marker: "# {mark} Created by Ansible role sap_ha_pacemaker_cluster" + block: | + global + chroot /var/lib/haproxy + pidfile /var/run/haproxy-%i.pid + user haproxy + group haproxy + daemon + + defaults + mode tcp + log global + option dontlognull + option redispatch + retries 3 + timeout queue 1m + timeout connect 10s + timeout client 1m + timeout server 1m + timeout check 10s + maxconn 3000 + + # Listener for SAP healthcheck + listen healthcheck + bind *:{{ sap_ha_install_anydb_ibmdb2_ibmcloud_health_check_port }} + +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - haproxy service start (without enable on boot) + ansible.builtin.service: + name: haproxy + state: started + enabled: false # Do not start on boot + + +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Create Resource (STONITH) with Fence Agent # noqa no-changed-when + ansible.builtin.shell: | + crm configure primitive \ + "{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_resource_name }}" \ + "{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_agent_name }}" \ + params \ + region="{{ sap_ha_install_anydb_ibmdb2_ibmcloud_region }}" \ + apikey="{{ sap_ha_install_anydb_ibmdb2_ibmcloud_api_key }}" \ + pcmk_monitor_timeout="600" \ + pcmk_host_map="{{ sap_ha_install_anydb_ibmdb2_hostname_primary }}:{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_primary_instance_id }};{{ sap_ha_install_anydb_ibmdb2_hostname_secondary }}:{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_fence_secondary_instance_id }}" \ + op monitor interval=60s \ + op start interval=0s timeout=20s \ + op stop interval=0s timeout=20s \ + meta \ + is-managed=true \ + migration-threshold=5000 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" + + +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Enable STONITH using CIB Bootstrap Options # noqa no-changed-when + ansible.builtin.shell: | + crm configure property cib-bootstrap-options: stonith-enabled=true + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" + + +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Create Resource HAProxy Listener for Load Balancer Health Check Probe # noqa no-changed-when + ansible.builtin.shell: | + crm configure primitive \ + "hc_rsc_vip_{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}" \ + {{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb }}@{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }} \ + op monitor interval=10s timeout=20s \ + op start interval=0s timeout=100s \ + op stop interval=0s timeout=100s \ + meta \ + is-managed=true \ + migration-threshold=5000 + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" + + +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Identify target IBM Db2 resource clone name # noqa no-changed-when + ansible.builtin.shell: | + crm config show type:primitive | tr '\n' ' ' | sed 's| primitive |\n|g' | grep dbname | sed 's| db2hadr.*||' + register: __sap_ha_install_anydb_ibmdb2_discover_pcmk_resource_name + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" + + +# Constraint - Colocation +# Ensure HAProxy Listener is started only on the PCMK Primary node +# Change score 'INFINITY:' or 'inf:' used by Health Check Listeners for Azure and GCP, instead use score '2000:' +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Create Constraint Colocation of HAProxy Listener for Load Balancer Health Check Probe # noqa no-changed-when + ansible.builtin.shell: | + crm configure colocation \ + "colocation-hc_rsc_vip_{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}" \ + 2000: \ + "hc_rsc_vip_{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}:Started" \ + {{ __sap_ha_install_anydb_ibmdb2_discover_pcmk_resource_name.stdout }}-clone:Master + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" + + +# Constraint - Order +# On failover, when Db2 is promoted to PCMK Secondary node then ensure HAProxy Listener is moved at same time +# Reasons for noqa: +# - no-changed-when: crmsh command equivalent to db2cm +- name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Create Constraint Order of HAProxy Listener for Load Balancer Health Check Probe # noqa no-changed-when + ansible.builtin.shell: | + crm configure order \ + "order-{{ __sap_ha_install_anydb_ibmdb2_discover_pcmk_resource_name.stdout }}-then-hc_rsc_vip_{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}" \ + Mandatory: \ + "{{ __sap_ha_install_anydb_ibmdb2_discover_pcmk_resource_name.stdout }}-clone:promote" \ + "hc_rsc_vip_{{ __sap_ha_install_anydb_ibmdb2_ibmcloud_vip_method_alb_primary_resource_name }}:start" + when: + - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short + - __sap_ha_install_anydb_ibmdb2_platform == "cloud_ibmcloud_vs" From f7b02e5f769e4c0c53475c1d1d9439b6d301d193 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 14:05:35 +0200 Subject: [PATCH 093/210] sap_hana_preconfigure: perform necessary assert changes Relates to issue #813. Signed-off-by: Bernd Finger --- .../tasks/sapnote/assert-3024346.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml index 62ea19343..7dcbd7b6b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-3024346.yml @@ -43,25 +43,25 @@ - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) -- name: Check NetApp modprobe conf file for SAP HANA with NFSv3 +- name: Check NetApp modprobe conf file for SAP HANA when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) block: - - name: Get info about file /etc/modprobe.d/sunrpc.conf + - name: Get info about file '/etc/modprobe.d/sunrpc.conf' ansible.builtin.stat: path: /etc/modprobe.d/sunrpc.conf register: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert - - name: Assert that file /etc/modprobe.d/sunrpc.conf exists + - name: Assert that file '/etc/modprobe.d/sunrpc.conf' exists ansible.builtin.assert: that: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists fail_msg: "FAIL: File /etc/modprobe.d/sunrpc.conf does not exist!" success_msg: "PASS: File /etc/modprobe.d/sunrpc.conf exists." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - - name: Assert that file /etc/modprobe.d/sunrpc.conf is a regular file + - name: Assert that file '/etc/modprobe.d/sunrpc.conf' is a regular file ansible.builtin.assert: that: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.isreg fail_msg: "FAIL: File /etc/modprobe.d/sunrpc.conf is not a regular file!" @@ -69,17 +69,17 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" when: __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists -- name: Get value of 'options sunrpc tcp_max_slot_table_entries' from /etc/modprobe.d/sunrpc.conf +- name: Get value of 'options sunrpc tcp_max_slot_table_entries' from '/etc/modprobe.d/sunrpc.conf' ansible.builtin.command: awk 'BEGIN{FS="="}/options sunrpc tcp_max_slot_table_entries/{print $NF}' /etc/modprobe.d/sunrpc.conf register: __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert changed_when: no ignore_errors: yes when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) -- name: Assert that 'options sunrpc tcp_max_slot_table_entries' is set correctly in /etc/modprobe.d/sunrpc.conf +- name: Assert that 'options sunrpc tcp_max_slot_table_entries' is set correctly in '/etc/modprobe.d/sunrpc.conf' ansible.builtin.assert: that: __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert.stdout == '128' fail_msg: "FAIL: The value of 'options sunrpc tcp_max_slot_table_entries' in '/etc/modprobe.d/sunrpc.conf' is @@ -88,6 +88,6 @@ '{{ __sap_hana_preconfigure_register_tcp_max_slot_table_entries_assert.stdout }}'." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" when: - - sap_hana_preconfigure_use_netapp_settings_nfsv3 | d(false) + - sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - __sap_hana_preconfigure_register_etc_modprobe_sunrpc_conf_assert.stat.exists - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_3024346 | d(false) From 55a097aab302991bbe2a7d73612559e7b6eae3f2 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:55:44 +0100 Subject: [PATCH 094/210] sap_ha_install_anydb_ibmdb2: fix missing lint risky pipe --- .../tasks/platform/db2cm_cloud_ibmcloud_vs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml index 19f9ed9c1..d22047a10 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/db2cm_cloud_ibmcloud_vs.yml @@ -208,7 +208,7 @@ # - no-changed-when: crmsh command equivalent to db2cm - name: SAP HA AnyDB - IBM Db2 HADR (IBM Cloud) - Primary Node - Identify target IBM Db2 resource clone name # noqa no-changed-when ansible.builtin.shell: | - crm config show type:primitive | tr '\n' ' ' | sed 's| primitive |\n|g' | grep dbname | sed 's| db2hadr.*||' + set -o pipefail && crm config show type:primitive | tr '\n' ' ' | sed 's| primitive |\n|g' | grep dbname | sed 's| db2hadr.*||' register: __sap_ha_install_anydb_ibmdb2_discover_pcmk_resource_name when: - sap_ha_install_anydb_ibmdb2_hostname_primary == inventory_hostname_short From 82cb8cf0b49fe45a215a06c796cbfa329c460cd4 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 19 Jul 2024 16:54:33 +0200 Subject: [PATCH 095/210] sap_hana_preconfigure: Resolve merge conflict after PR #811 Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml index 966eb1ffb..44b7daef0 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3024346.yml @@ -70,6 +70,6 @@ ansible.builtin.lineinfile: path: /etc/modprobe.d/sunrpc.conf create: true - mode: 0644 + mode: "0644" regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128 From 70ac41aff31ef2f3eabefcf4528ce9ac2253d67c Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:58:55 +0100 Subject: [PATCH 096/210] sap_ha_install_anydb_ibmdb2: remove meta file --- roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml | 3 --- .../tasks/platform/ascertain_platform_type.yml | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml diff --git a/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml b/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml deleted file mode 100644 index acd7ad5ac..000000000 --- a/roles/sap_ha_install_anydb_ibmdb2/meta/runtime.yml +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- -requires_ansible: '>=2.12.0' diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml index e51d7f721..0caee9450 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/platform/ascertain_platform_type.yml @@ -60,10 +60,10 @@ - ansible_product_name == 'Google Compute Engine' - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is IBM Cloud Virtual Server - when: - - ansible_chassis_asset_tag == 'ibmcloud' ansible.builtin.set_fact: __sap_ha_install_anydb_ibmdb2_platform: cloud_ibmcloud_vs + when: + - ansible_chassis_asset_tag == 'ibmcloud' - name: SAP HA AnyDB - IBM Db2 HADR - Check if platform is Microsoft Azure Virtual Machine ansible.builtin.set_fact: From c0164791294db42f3a31b88380dae36623747cd9 Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:31:57 +0200 Subject: [PATCH 097/210] refactor(sap_hana_preconfigure): remove default saptune version Closes #817 --- roles/sap_hana_preconfigure/README.md | 2 +- roles/sap_hana_preconfigure/meta/argument_specs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index 4459ca657..ff7122b15 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -399,7 +399,7 @@ sap_hana_preconfigure_db_group_name: dba ### sap_hana_preconfigure_saptune_version - _Type:_ `str` -- _Default:_ `'3.0.2'` +- _Default:_ `''` Version of saptune to install (SLES for SAP Applications).
This will replace the current installed version if present, even downgrade if necessary.
diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index 159ed5df1..53df54c5e 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -351,7 +351,7 @@ argument_specs: type: str sap_hana_preconfigure_saptune_version: - default: '3.0.2' + default: '' description: - Version of saptune to install (SLES for SAP Applications). - This will replace the current installed version if present, even downgrade if necessary. From 33bad004d6a37d229ac8473392bd2df94cfc3bba Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:24:37 +0200 Subject: [PATCH 098/210] fix(sap_hana_preconfigure): Update azure override readme Closes #819 --- roles/sap_hana_preconfigure/README.md | 1 + .../tasks/SLES/assert-configuration.yml | 21 ------------------- .../tasks/SLES/configuration.yml | 2 +- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index 4459ca657..f65e91566 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -420,6 +420,7 @@ The saptune solution to apply (SLES for SAP Applications).
- _Default:_ `false` On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications).
+If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
Set this parameter to `true` on Azure.
diff --git a/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml index b2d29f5fa..b2e96401f 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/assert-configuration.yml @@ -39,24 +39,3 @@ fail_msg: "FAIL: the configured saptune solution is '{{ __sap_hana_preconfigure_saptune_configured_solution }}'' and does not match the expected solution '{{ sap_hana_preconfigure_saptune_solution }}'" success_msg: "PASS: the configured saptune solution matches the expected solution '{{ sap_hana_preconfigure_saptune_solution }}'" - -# If this is a cluster node on Azure, we need to override to disable tcp timestamps, reuse and recycle. -# This can be done by copying the sapnote file 2382421 from /usr/share/saptune/notes to /etc/saptune/override -# The value can then override in the in the new file - -# - name: Disable TCP timestamps, recycle & reuse -# ansible.builtin.blockinfile: -# path: /etc/saptune/override/2382421 -# create: yes -# backup: yes -# owner: root -# group: root -# mode: '0640' -# marker: "" -# block: | -# [sysctl] -# net.ipv4.tcp_timestamps = 0 -# net.ipv4.tcp_tw_reuse = 0 -# net.ipv4.tcp_tw_recycle = 0 -# when: -# - sap_hana_preconfigure_saptune_azure diff --git a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml index 1cc024a22..14d8ead5e 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml @@ -106,7 +106,7 @@ [sysctl] net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_tw_reuse = 0 - net.ipv4.tcp_tw_recycle = 0 + # net.ipv4.tcp_tw_recycle = 0 when: - sap_hana_preconfigure_saptune_azure From c19c840306f09cbd26a048c65f06484af6dcbcfd Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:45:44 +0200 Subject: [PATCH 099/210] fix(sap_hana_preconfigure): move comment on top of the task --- roles/sap_hana_preconfigure/tasks/SLES/configuration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml index 14d8ead5e..61b9b0818 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/configuration.yml @@ -92,6 +92,7 @@ # If this is a cluster node on Azure, we need to override to disable tcp timestamps, reuse and recycle. # This can be done by copying the sapnote file 2382421 from /usr/share/saptune/notes to /etc/saptune/override # The value can then override in the in the new file +# net.ipv4.tcp_tw_recycle = 0 was removed as it is not relevant for SLES 15+ - name: Disable TCP timestamps, recycle & reuse ansible.builtin.blockinfile: @@ -106,7 +107,6 @@ [sysctl] net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_tw_reuse = 0 - # net.ipv4.tcp_tw_recycle = 0 when: - sap_hana_preconfigure_saptune_azure From 17f0bbed979fd9e6a747958d014084f6f4105c89 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 23 Jul 2024 12:10:22 +0200 Subject: [PATCH 100/210] sap_swpm: Reduce the amount of empty lines in inifile.params Solves issue #821. Signed-off-by: Bernd Finger --- roles/sap_swpm/templates/configfile.j2 | 130 ++++++++++++------------- 1 file changed, 62 insertions(+), 68 deletions(-) diff --git a/roles/sap_swpm/templates/configfile.j2 b/roles/sap_swpm/templates/configfile.j2 index 48765b1b5..e71291e11 100644 --- a/roles/sap_swpm/templates/configfile.j2 +++ b/roles/sap_swpm/templates/configfile.j2 @@ -11,15 +11,15 @@ archives.downloadBasket = {{ sap_swpm_software_path }} # NOTE: Specific media requirements will use format # SAPINST.CD.PACKAGE. = {% endif %} - {% if 'swpm_installation_media_swpm2_hana' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm2_hana ###### HDB_Software_Dialogs.useMediaCD = {{ sap_swpm_software_use_media }} {% endif %} - {% if 'swpm_installation_media_swpm1' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1 ###### @@ -35,10 +35,9 @@ SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdbms_path }} # SAPINST.CD.PACKAGE.J2EE = /path/JAVA_J2EE_OSINDEP # SAPINST.CD.PACKAGE.J2EE-INST = /path/JAVA_J2EE_OSINDEP_J2EE_INST # SAPINST.CD.PACKAGE.SCA = /path/JAVA_J2EE_OSINDEP_UT - {% endif %} - {% if 'swpm_installation_media_swpm1_exportfiles' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_exportfiles ###### @@ -48,8 +47,8 @@ SAPINST.CD.PACKAGE.LOAD1 = {{ sap_swpm_cd_export_pt1_path }} SAPINST.CD.PACKAGE.LOAD2 = {{ sap_swpm_cd_export_pt2_path }} # SAPINST.CD.PACKAGE.JMIG = {% endif %} - {% if 'swpm_installation_media_swpm1_ibmdb2' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_ibmdb2 ###### @@ -62,8 +61,8 @@ SAPINST.CD.PACKAGE.DB2CLIENT = {{ sap_swpm_cd_ibmdb2_client_path }} # IBM DB2 software unpack path e.g. /db2/db2x01/db2_software db6.DB2SoftwarePath = {{ sap_swpm_ibmdb2_unpack_path }} {% endif %} - {% if 'swpm_installation_media_swpm1_oracledb_121' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_oracledb_121 ###### @@ -73,8 +72,8 @@ SAPINST.CD.PACKAGE.RDBMS-ORA121 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI121 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} - {% if 'swpm_installation_media_swpm1_oracledb_122' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_oracledb_122 ###### @@ -84,8 +83,8 @@ SAPINST.CD.PACKAGE.RDBMS-ORA122 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI122 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} - {% if 'swpm_installation_media_swpm1_oracledb_19' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_oracledb_19 ###### @@ -95,8 +94,8 @@ SAPINST.CD.PACKAGE.RDBMS-ORA19 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI19 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} - {% if 'swpm_installation_media_swpm1_sapase' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_sapase ###### @@ -105,32 +104,32 @@ SAPINST.CD.PACKAGE.RDBMS-SYB = {{ sap_swpm_cd_sapase_path }} SAPINST.CD.PACKAGE.RDBMS-SYB-CLIENT = {{ sap_swpm_cd_sapase_client_path }} {% endif %} - {% if 'swpm_installation_media_swpm1_sapmaxdb' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_swpm1_sapmaxdb ###### # Requested package : RDBMS-ADA SAPINST.CD.PACKAGE.RDBMS-ADA = {{ sap_swpm_cd_sapmaxdb_path }} {% endif %} - {% if 'maintenance_plan_stack_tms_config' in sap_swpm_inifile_list %} + ###### # maintenance_plan_stack_tms_config ###### NW_ABAP_TMSConfig.configureTMS = {{ sap_swpm_configure_tms | lower }} NW_ABAP_TMSConfig.transportPassword = {{ sap_swpm_tmsadm_password }} {% endif %} - {% if 'maintenance_plan_stack_tms_transports' in sap_swpm_inifile_list %} + ###### # maintenance_plan_stack_tms_transports ###### NW_ABAP_Include_Corrections.includeTransports = true NW_ABAP_Include_Corrections.transportFilesLocations = {{ sap_swpm_tms_tr_files_path }} {% endif %} - {% if 'maintenance_plan_stack_spam_config' in sap_swpm_inifile_list %} + ###### # maintenance_plan_stack_spam_config ###### @@ -141,8 +140,8 @@ NW_ABAP_SPAM_Update.SPAMUpdateArchive = {{ sap_swpm_spam_update_sar }} #NW_ABAP_SPAM_Update.SPAMUpdateArchive = {% endif %} {% endif %} - {% if 'maintenance_plan_stack_sum_config' in sap_swpm_inifile_list %} + ###### # maintenance_plan_stack_sum_config ###### @@ -152,16 +151,16 @@ NW_ABAP_Prepare_SUM.startSUM = {{ sap_swpm_sum_start | lower }} # Password for SUM must be for 'adm' user NW_ABAP_Prepare_SUM.Password = {{ sap_swpm_sap_sidadm_password }} {% endif %} - {% if 'maintenance_plan_stack_sum_10_batch_mode' in sap_swpm_inifile_list %} + ###### # maintenance_plan_stack_sum_10_batch_mode ###### # Re-run of existing BatchModeInputFile.xml for NWAS JAVA (generated by SUM 1.0 on previous host into the /sdt/param/ subdirectory) NW_ABAP_Prepare_SUM.SUMBatchFile = {{ sap_swpm_sum_batch_file }} {% endif %} - {% if 'credentials' in sap_swpm_inifile_list %} + ###### # credentials ###### @@ -176,24 +175,24 @@ DiagnosticsAgent.dasidAdmPassword = {{ sap_swpm_diagnostics_agent_password }} # 'sapadm' user of the SAP Host Agent hostAgent.sapAdmPassword = {{ sap_swpm_sapadm_password }} {% endif %} - {% if 'credentials_hana' in sap_swpm_inifile_list %} + ###### # credentials_hana ###### HDB_Schema_Check_Dialogs.schemaPassword = {{ sap_swpm_db_schema_password }} storageBasedCopy.hdb.systemPassword = {{ sap_swpm_db_system_password }} {% endif %} - {% if 'credentials_anydb_ibmdb2' in sap_swpm_inifile_list %} + ###### # credentials_anydb_ibmdb2 ###### nwUsers.db6.db2sidPassword = {{ sap_swpm_sap_sidadm_password }} # nwUsers.db6.db2sidUid = {% endif %} - {% if 'credentials_anydb_oracledb' in sap_swpm_inifile_list %} + ###### # credentials_anydb_oracledb ###### @@ -209,8 +208,8 @@ ora.SysPassword = {{ sap_swpm_db_system_password }} # Oracle 'SYSTEM' password ora.SystemPassword = {{ sap_swpm_db_system_password }} {% endif %} - {% if 'credentials_anydb_sapase' in sap_swpm_inifile_list %} + ###### # credentials_anydb_sapase ###### @@ -223,8 +222,8 @@ SYB.NW_DB.sapsr3db_pass = {{ sap_swpm_db_system_password }} # SYB.NW_DB.sapsso_pass = # SYB.NW_DB.sslPassword = {% endif %} - {% if 'credentials_anydb_sapmaxdb' in sap_swpm_inifile_list %} + ###### # credentials_anydb_sapmaxdb # @@ -235,16 +234,16 @@ Sdb_DBUser.dbaPassword = {{ sap_swpm_db_system_password }} Sdb_DBUser.dbmPassword = {{ sap_swpm_db_system_password }} Sdb_Schema_Dialogs.dbSchemaPassword = {{ sap_swpm_db_schema_password }} {% endif %} - {% if 'credentials_nwas_ssfs' in sap_swpm_inifile_list %} + ###### # credentials_nwas_ssfs ###### HDB_Userstore.useABAPSSFS = true # NW_ABAP_SSFS_CustomKey.ssfsKeyInputFile = {% endif %} - {% if 'credentials_hdbuserstore' in sap_swpm_inifile_list %} + ###### # credentials_hdbuserstore ###### @@ -255,8 +254,8 @@ HDB_Userstore.useABAPSSFS = false # NW_HDB_DBClient.checkCreateUserstore = true # NW_HDB_DBClient.clientPathStrategy = LOCAL {% endif %} - {% if 'credentials_syscopy' in sap_swpm_inifile_list %} + ###### # credentials_syscopy ###### @@ -265,15 +264,15 @@ NW_DDIC_Password.needDDICPasswords = true NW_DDIC_Password.ddic000Password = {{ sap_swpm_ddic_000_password }} #NW_DDIC_Password.ddic001Password = {% endif %} - {% if 'db_config_hana' in sap_swpm_inifile_list %} + ###### # db_config_hana ###### storageBasedCopy.hdb.instanceNumber = {{ sap_swpm_db_instance_nr }} HDB_Schema_Check_Dialogs.schemaName = {{ sap_swpm_db_schema }} - {% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_list %} + HDB_Schema_Check_Dialogs.validateSchemaName = true {% else %} HDB_Schema_Check_Dialogs.validateSchemaName = false @@ -282,15 +281,15 @@ HDB_Schema_Check_Dialogs.validateSchemaName = false # HDB_Schema_Check_Dialogs.dropSchema = false # hdb.create.dbacockpit.user = false {% endif %} - {% if 'db_config_anydb_all' in sap_swpm_inifile_list %} + ###### # db_config_anydb_all ###### NW_ABAP_Import_Dialog.dbCodepage = 4103 {% endif %} - {% if 'db_config_anydb_ibmdb2' in sap_swpm_inifile_list %} + ###### # db_config_anydb_ibmdb2 ###### @@ -318,8 +317,8 @@ storageBasedCopy.db6.CommunicationPortNumber = 5912 storageBasedCopy.db6.PortRangeEnd = 5917 storageBasedCopy.db6.PortRangeStart = 5914 {% endif %} - {% if 'db_config_anydb_oracledb' in sap_swpm_inifile_list %} + ###### # db_config_anydb_oracledb ###### @@ -346,8 +345,8 @@ ora.whatInstallation = isSingle ## CDB_ONLY: install CDB only. ora.multitenant.installMT = FALSE {% endif %} - {% if 'db_config_anydb_oracledb_121' in sap_swpm_inifile_list %} + ###### # db_config_anydb_oracledb_121 # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) @@ -356,8 +355,8 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/121 storageBasedCopy.ora.clientVersion = 121 storageBasedCopy.ora.serverVersion = 121 {% endif %} - {% if 'db_config_anydb_oracledb_122' in sap_swpm_inifile_list %} + ###### # db_config_anydb_oracledb_122 # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) @@ -366,8 +365,8 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/122 storageBasedCopy.ora.clientVersion = 122 storageBasedCopy.ora.serverVersion = 122 {% endif %} - {% if 'db_config_anydb_oracledb_19' in sap_swpm_inifile_list %} + ###### # db_config_anydb_oracledb_19 # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) @@ -376,8 +375,8 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/19 storageBasedCopy.ora.clientVersion = 19 storageBasedCopy.ora.serverVersion = 19 {% endif %} - {% if 'db_config_anydb_sapase' in sap_swpm_inifile_list %} + ###### # db_config_anydb_sapase ###### @@ -413,8 +412,8 @@ SYB.NW_DB.portBackupServer = SYB.NW_DB.portJobScheduler = SYB.NW_DB.portXPServer = {% endif %} - {% if 'db_config_anydb_sapmaxdb' in sap_swpm_inifile_list %} + ###### # db_config_anydb_sapmaxdb ###### @@ -426,8 +425,8 @@ SdbInstanceDialogs.minlogsize = 4000 SdbInstanceDialogs.sapdataFolder = sapdata SdbInstanceDialogs.saplogFolder = saplog {% endif %} - {% if 'db_connection_nw_hana' in sap_swpm_inifile_list %} + ###### # db_connection_nw_hana ###### @@ -451,8 +450,8 @@ NW_Recovery_Install_HDB.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # NW_HDB_getDBInfo.tenantOsUser = {{ sap_swpm_db_sid | lower }}usr # NW_HDB_getDBInfo.tenantPort = {% endif %} - {% if 'db_connection_nw_anydb_ibmdb2' in sap_swpm_inifile_list %} + ###### # db_connection_nw_anydb_ibmdb2 ###### @@ -469,23 +468,23 @@ NW_DB6_DB.db6.abap.schema = sap{{ sap_swpm_sid | lower }} # NW_DB6_DB.db6.java.connect.user = # NW_DB6_DB.db6.java.schema = {% endif %} - {% if 'db_connection_nw_anydb_oracledb' in sap_swpm_inifile_list %} + ###### # db_connection_nw_anydb_oracledb ###### storageBasedCopy.abapSchemaPassword = {{ sap_swpm_db_schema_abap_password }} storageBasedCopy.javaSchemaPassword = {{ sap_swpm_db_schema_java_password }} {% endif %} - {% if 'db_connection_nw_anydb_sapase' in sap_swpm_inifile_list %} + ###### # db_connection_nw_anydb_sapase ###### # NW_SYB_CIABAP.sapsaPassword = {% endif %} - {% if 'db_restore_hana' in sap_swpm_inifile_list %} + ###### # db_restore_hana ###### @@ -507,8 +506,8 @@ HDB_Recovery_Dialogs.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # HDB_System_Check_Dialogs.initTopology = false # NW_CreateDBandLoad.movePVCforUsagePiAndDi = {% endif %} - {% if 'nw_config_anydb' in sap_swpm_inifile_list %} + ###### # nw_config_anydb ###### @@ -516,8 +515,8 @@ HDB_Recovery_Dialogs.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # Execute ABAP program 'RUTPOADAPT' for depooling. Set it to 'true' if declustering / depooling is selected for the distributed database instance installation option NW_CI_Instance_ABAP_Reports.executeReportsForDepooling = false {% endif %} - {% if 'nw_config_other' in sap_swpm_inifile_list %} + ###### # nw_config_other ###### @@ -538,8 +537,8 @@ NW_getLoadType.loadType = {{ sap_swpm_load_type }} # NW_adaptProfile.skipSecurityProfileSettings = false # OS4.DestinationASP = {% endif %} - {% if 'nw_config_central_services_abap' in sap_swpm_inifile_list %} + ###### # nw_config_central_services_abap # Central Services (ASCS) contains the Message server (MS) and Enqueue work processes (EN) for the ABAP Dispatcher. @@ -550,8 +549,8 @@ NW_CI_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.ascsVirtualHostname = {{ sap_swpm_ascs_instance_hostname }} NW_SCS_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} {% endif %} - {% if 'nw_config_central_services_java' in sap_swpm_inifile_list %} + ###### # nw_config_central_services_java # SAP Java Central Services Instance (SCS) contains the Java Message server (MS), Java Enqueue server (EN), Java Gateway (GW) and Java Internal Web Dispatcher (WD). @@ -563,8 +562,8 @@ NW_SCS_Instance.scsVirtualHostname = {{ sap_swpm_java_scs_instance_hostname }} NW_SCS_Instance.instanceNumber = {{ sap_swpm_java_scs_instance_nr }} NW_JAVA_Export.keyPhrase = {{ sap_swpm_master_password }} {% endif %} - {% if 'nw_config_primary_application_server_instance' in sap_swpm_inifile_list %} + ###### # nw_config_primary_application_server_instance # Primary Application Server (PAS) contains the Internet Communication Manager (ICM), Gateway (GW), and ABAP Dispatcher (DI/WP) work processes. @@ -577,8 +576,8 @@ NW_CI_Instance.ciInstanceNumber = {{ sap_swpm_pas_instance_nr }} # NW_WPConfiguration.ciBtcWPNumber = 6 # NW_WPConfiguration.ciDialogWPNumber = 10 {% endif %} - {% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_list %} + ###### # nw_config_additional_application_server_instance # Additional Application Server (AAS) contains ABAP Dispatcher (DI/WP) work processes. @@ -596,8 +595,8 @@ NW_AS.instanceNumber = {{ sap_swpm_aas_instance_nr }} # Virtual host name of the SAP NetWeaver Application Server instance. Leave empty to use the existing host name NW_DI_Instance.virtualHostname = {{ sap_swpm_aas_instance_hostname }} {% endif %} - {% if 'nw_config_ers' in sap_swpm_inifile_list %} + ###### # nw_config_ers ###### @@ -609,8 +608,8 @@ nw_instance_ers.ersInstanceNumber = {{ sap_swpm_ers_instance_nr }} # "User? Password? Stop. FAIL: Invalid Credentials" nw_instance_ers.restartSCS = false {% endif %} - {% if 'nw_config_ports' in sap_swpm_inifile_list %} + ###### # nw_config_ports ###### @@ -624,8 +623,8 @@ NW_checkMsgServer.abapMSPort = 36{{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.createGlobalProxyInfoFile = false # NW_SCS_Instance.createGlobalRegInfoFile = false {% endif %} - {% if 'nw_config_java_ume' in sap_swpm_inifile_list %} + ###### # nw_config_java_ume ###### @@ -639,8 +638,8 @@ UmeConfiguration.umeInstance = {{ sap_swpm_ume_instance_nr }} UmeConfiguration.umeType = {{ sap_swpm_ume_type }} # UmeConfiguration.sapjsfName = SAPJSF {% endif %} - {% if 'nw_config_java_feature_template_ids' in sap_swpm_inifile_list %} + ###### # nw_config_java_feature_template_ids ###### @@ -659,8 +658,8 @@ Select_PPMS_Instances.ListOfSelectedInstances = {% set selected_ids = [] %}{%- f ## Comma-separated value list containing which product instances (formerly known as usage types) are installed. Used for handling product instances in unattended mode. ## SAP_Software_Features_Select.selectedInstancesForInstallation = AS,AAS,BASIC,NW-MODEL,ESR,PI,PI-AF {%- endif %} - {% if 'nw_config_webdisp_generic' in sap_swpm_inifile_list %} + ###### # nw_config_webdisp_generic ###### @@ -684,8 +683,8 @@ NW_webdispatcher_Instance.rfcClient = {{ sap_swpm_wd_backend_rfc_client_nr }} NW_webdispatcher_Instance.rfcUser = {{ sap_swpm_wd_backend_rfc_user }} NW_webdispatcher_Instance.rfcPassword = {{ sap_swpm_wd_backend_rfc_user_password }} {% endif %} - {% if 'nw_config_webdisp_gateway' in sap_swpm_inifile_list %} + ###### # nw_config_webdisp_gateway # @@ -699,15 +698,15 @@ NW_CI_Instance.ascsInstallGateway = {{ sap_swpm_ascs_install_gateway | lower }} # NW_CI_Instance.ascsInstallWebDispatcher = false # NW_SCS_Instance.ascsInstallWebDispatcher = false {% endif %} - {% if 'nw_config_host_agent' in sap_swpm_inifile_list %} + ###### # nw_config_host_agent ###### NW_System.installSAPHostAgent = {{ sap_swpm_install_saphostagent | lower }} {% endif %} - {% if 'nw_config_post_load_abap_reports' in sap_swpm_inifile_list %} + ###### # nw_config_post_load_abap_reports ###### @@ -747,8 +746,8 @@ NW_CI_Instance_ABAP_Reports.enableActivateICFService = true # Specify new password of the SAP* user in client 001, different from Master Password # NW_CI_Instance_ABAP_Reports.sapStar001Password = {% endif %} - {% if 'nw_config_livecache' in sap_swpm_inifile_list %} + ###### # nw_config_livecache ###### @@ -759,8 +758,8 @@ NW_liveCache.liveCacheUser = NW_liveCache.liveCacheUserPwd = NW_liveCache.useLiveCache = {% endif %} - {% if 'nw_config_sld' in sap_swpm_inifile_list %} + ###### # nw_config_sld ###### @@ -771,8 +770,8 @@ NW_SLD_Configuration.sldUseHttps = NW_SLD_Configuration.sldUser = NW_SLD_Configuration.sldUserPassword = {% endif %} - {% if 'nw_config_abap_language_packages' in sap_swpm_inifile_list %} + ###### # nw_config_abap_language_packages ###### @@ -782,8 +781,8 @@ NW_Language_Inst_Dialogs.folders = /software # Selected languages comma-separated list (by default DE,EN are installed) NW_Language_Inst_Dialogs.languages = AR,BG,CA,CS,DA,EL,ES,ET,FI,FR,HE,HI,HR,HU,IT,JA,KK,KO,LT,LV,MS,NL,NO,PL,PT,RO,RU,SH,SK,SL,SV,TH,TR,UK,VI,ZF,ZH {% endif %} - {% if 'sap_os_linux_user' in sap_swpm_inifile_list %} + ###### # sap_os_linux_user ###### @@ -791,8 +790,8 @@ nwUsers.sapadmUID = {{ sap_swpm_sapadm_uid }} nwUsers.sapsysGID = {{ sap_swpm_sapsys_gid }} nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} {% endif %} - {% if 'swpm_installation_media_download_service' in sap_swpm_inifile_list %} + ###### # swpm_installation_media_download_service # Not in use by sap_swpm Ansible Role @@ -807,26 +806,23 @@ nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} # DownloadService.Username = # DownloadService.planNumber = {% endif %} - - {% if 'nw_config_java_icm_credentials' in sap_swpm_inifile_list %} + ###### # nw_config_java_icm_credentials ###### NW_IcmAuth.webadmPassword = {{ sap_swpm_ume_j2ee_admin_password }} {% endif %} - - {% if 'solman_abap_swpm1' in sap_swpm_inifile_list %} + ###### # solman_abap_swpm1 # Not in use by sap_swpm Ansible Role ###### InitDeclusteringForImport.decluster = false {% endif %} - - {% if 'solman_daa_swpm1' in sap_swpm_inifile_list %} + ###### # solman_daa_swpm1 # Not in use by sap_swpm Ansible Role @@ -852,9 +848,8 @@ InitDeclusteringForImport.decluster = false # DiagnosticsAgent.SolMan.UserName # DiagnosticsAgent.SolMan.UseSSL {% endif %} - - {% if 'syscopy_export_anydb' in sap_swpm_inifile_list %} + ###### # syscopy_export_anydb # Not in use by sap_swpm Ansible Role @@ -925,9 +920,8 @@ NW_readProfileDir.profileDir = /sapmnt/{{ sap_swpm_sid | upper }}/profile NW_getLoadType.loadType = {{ sap_swpm_load_type }} NW_getLoadType.importManuallyExecuted = false {% endif %} - - {% if 'syscopy_import_anydb_ibmdb2' in sap_swpm_inifile_list %} + ###### # syscopy_import_anydb_ibmdb2 # Not in use by sap_swpm Ansible Role From 57a66294c6a9864d3d5ac210f28d4d7b5c614c4e Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 23 Jul 2024 12:33:48 +0200 Subject: [PATCH 101/210] collection: Synchronize all .yamllint.yml files Solves issue #823. Signed-off-by: Bernd Finger --- .yamllint.yml | 1 + roles/sap_anydb_install_oracle/.yamllint.yml | 7 ++++++- roles/sap_general_preconfigure/.yamllint.yml | 7 ++++++- roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml | 7 ++++++- roles/sap_ha_install_hana_hsr/.yamllint.yml | 7 ++++++- roles/sap_ha_pacemaker_cluster/.yamllint.yml | 7 ++++++- roles/sap_hana_install/.yamllint.yml | 7 ++++++- roles/sap_hana_preconfigure/.yamllint.yml | 7 ++++++- roles/sap_hostagent/.yamllint.yml | 7 ++++++- roles/sap_install_media_detect/.yamllint.yml | 7 ++++++- roles/sap_maintain_etc_hosts/.yamllint.yml | 7 ++++++- roles/sap_netweaver_preconfigure/.yamllint.yml | 7 ++++++- roles/sap_storage_setup/.yamllint.yml | 7 ++++++- roles/sap_swpm/.yamllint.yml | 7 ++++++- 14 files changed, 79 insertions(+), 13 deletions(-) diff --git a/.yamllint.yml b/.yamllint.yml index 6d1476a8b..ee4457cfd 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- # Based on ansible-lint config extends: default diff --git a/roles/sap_anydb_install_oracle/.yamllint.yml b/roles/sap_anydb_install_oracle/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_anydb_install_oracle/.yamllint.yml +++ b/roles/sap_anydb_install_oracle/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_general_preconfigure/.yamllint.yml b/roles/sap_general_preconfigure/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_general_preconfigure/.yamllint.yml +++ b/roles/sap_general_preconfigure/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_ha_install_hana_hsr/.yamllint.yml b/roles/sap_ha_install_hana_hsr/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_ha_install_hana_hsr/.yamllint.yml +++ b/roles/sap_ha_install_hana_hsr/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_ha_pacemaker_cluster/.yamllint.yml b/roles/sap_ha_pacemaker_cluster/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_ha_pacemaker_cluster/.yamllint.yml +++ b/roles/sap_ha_pacemaker_cluster/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_hana_install/.yamllint.yml b/roles/sap_hana_install/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_hana_install/.yamllint.yml +++ b/roles/sap_hana_install/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_hana_preconfigure/.yamllint.yml b/roles/sap_hana_preconfigure/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_hana_preconfigure/.yamllint.yml +++ b/roles/sap_hana_preconfigure/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_hostagent/.yamllint.yml b/roles/sap_hostagent/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_hostagent/.yamllint.yml +++ b/roles/sap_hostagent/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_install_media_detect/.yamllint.yml b/roles/sap_install_media_detect/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_install_media_detect/.yamllint.yml +++ b/roles/sap_install_media_detect/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_maintain_etc_hosts/.yamllint.yml b/roles/sap_maintain_etc_hosts/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_maintain_etc_hosts/.yamllint.yml +++ b/roles/sap_maintain_etc_hosts/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_netweaver_preconfigure/.yamllint.yml b/roles/sap_netweaver_preconfigure/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_netweaver_preconfigure/.yamllint.yml +++ b/roles/sap_netweaver_preconfigure/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_storage_setup/.yamllint.yml b/roles/sap_storage_setup/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_storage_setup/.yamllint.yml +++ b/roles/sap_storage_setup/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true diff --git a/roles/sap_swpm/.yamllint.yml b/roles/sap_swpm/.yamllint.yml index ea7a6099f..ee4457cfd 100644 --- a/roles/sap_swpm/.yamllint.yml +++ b/roles/sap_swpm/.yamllint.yml @@ -8,7 +8,9 @@ rules: brackets: {max-spaces-inside: 1, level: error} # colons: {max-spaces-after: -1, level: error} # commas: {max-spaces-after: -1, level: error} - comments: disable + comments: + require-starting-space: false + min-spaces-from-content: 1 comments-indentation: disable # document-start: disable # empty-lines: {max: 3, level: error} @@ -20,3 +22,6 @@ rules: # new-lines: {type: unix} # trailing-spaces: disable truthy: disable + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true From e98ec893433935347f0453ac24e2747701c5f36d Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:07:03 +0100 Subject: [PATCH 102/210] sap_storage_setup: update defaults file with commented out mandatory vars --- roles/sap_storage_setup/defaults/main.yml | 60 ++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/roles/sap_storage_setup/defaults/main.yml b/roles/sap_storage_setup/defaults/main.yml index 3cfc3bd3e..f4925f150 100644 --- a/roles/sap_storage_setup/defaults/main.yml +++ b/roles/sap_storage_setup/defaults/main.yml @@ -1,10 +1,59 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Inherit from global parameters, if they exist -sap_storage_setup_host_type: "{{ sap_host_type }}" +# Mandatory +# Inherit from global parameter, if exist sap_storage_setup_sid: "{{ sap_system_sid }}" +# Mandatory +# Inherit from global parameter, if exist +# Use list with values: hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers +# Sandbox example +## sap_storage_setup_host_type: +## - hana_primary +## - nwas_abap_ascs +## - nwas_abap_pas +sap_storage_setup_host_type: "{{ sap_host_type }}" + + +#### Mandatory variable reference example for SAP System storage definition + +# # Mandatory +# sap_storage_setup_definition: + +# # Block Storage volume +# - name: name # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name +# mountpoint: /directory # required: string, directory path where the filesystem is mounted +# disk_size: 384 # required: integer, size in GB +# filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem +# #lvm_lv_name: # optional: string, value 'lv_' +# #lvm_lv_stripes: # optional: integer, value '1', stripe over LVM Physical Volumes within the LVM Volume Group +# #lvm_lv_stripe_size: # optional: string, value '128K', override definition by the OS. Akin to Virtualized Block Size +# #lvm_vg_name: # optional: string, value 'vg_'' +# #lvm_vg_options: # optional: string, value '', additional LVM VG options (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM VG Physical Extent) +# #lvm_vg_physical_extent_size: # optional: integer, value '4', size in MiB. Akin to Physical Block Size, difficult to change once set +# #lvm_pv_options: # optional: string, value '', additional LVM PV options (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM PV Physical Extent) + +# # File Storage volume +# - name: name # required: string, reference name +# mountpoint: /directory # required: string, directory path where the filesystem is mounted +# nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server +# #nfs_path: # optional: string, value '', subdirectory path on the NFS Server +# #nfs_filesystem_type: # optional: string, value default 'nfs4' from var sap_storage_setup_nfs_filesystem_type, NFS Server protocol +# #nfs_mount_options: # optional: string, value default 'defaults' from var sap_storage_setup_nfs_mount_options, NFS Server specific options e.g. 'relatime' + +# # Swap as file instead of Block Storage volume +# - name: swap # required: string, reference name +# swap_path: /swapfile # required: string, directory path where swap file is created +# disk_size: 4 # required: integer, size in GB of swap file +# filesystem_type: swap # required: string, must be value 'swap' + +# # If applicable, create default for all nfs_server keys within sap_storage_setup_definition +# sap_storage_setup_nfs_server: 'nfs.corp:/' + + +#### Default variable values for SAP System storage + # By default do not look for multipath devices. # When enabled, this includes # - installation of necessary packages @@ -33,7 +82,8 @@ sap_storage_setup_nwas_java_ci_instance_nr: '21' # - NWAS JAVA AS uses J # - NWAS WebDispatcher uses W -#----------------------------------------------------------# + +#### NFS default values sap_storage_setup_nfs_filesystem_type: nfs4 sap_storage_setup_nfs_mount_options: defaults @@ -59,6 +109,7 @@ sap_storage_setup_nfs_dirs_usr_sap: nwas_java_scs: - "{{ sap_storage_setup_sid }}/SCS{{ sap_storage_setup_nwas_java_scs_instance_nr }}" + ##### #### Legacy code - retain vars for commented out code, until decision on specific activities for each Cloud ###### @@ -85,6 +136,3 @@ sap_storage_setup_aws_imds_url: sap_storage_setup_aws_vmsize_url: sap_storage_setup_aws_vmsize: - -# IBM Cloud variables -# From b893a0cadd1048a4dfe6cfbd6dce153a5f5880ba Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:07:27 +0100 Subject: [PATCH 103/210] sap_storage_setup: improve inline README example --- roles/sap_storage_setup/README.md | 32 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index 1f3394813..c8ef190b0 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -62,9 +62,9 @@ Red Hat for SAP Community of Practice, Janine Fuchs, IBM Lab for SAP Solutions Minimum required parameters: -- [sap_storage_setup_definition](#sap_storage_setup_definition) -- [sap_storage_setup_host_type](#sap_storage_setup_host_type) -- [sap_storage_setup_sid](#sap_storage_setup_sid) +- [sap_storage_setup_definition](#sap_storage_setup_definition-required) +- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) +- [sap_storage_setup_sid](#sap_storage_setup_sid-required) ### sap_storage_setup_definition required @@ -110,14 +110,24 @@ Example: ```yaml sap_storage_setup_definition: -- disk_size: 100G - filesystem_type: xfs - mountpoint: /hana/data - name: hanadata -- disk_size: 100G - filesystem_type: xfs - mountpoint: /hana/log - name: hanalog + + # Block Storage volume + - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name + mountpoint: /hana/data # required: string, directory path where the filesystem is mounted + disk_size: 100 # required: integer, size in GB + filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem + + # File Storage volume + - name: hana_shared # required: string, reference name + mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted + nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server + + # Swap as file instead of Block Storage volume + # See SAP Note 1597355 - Swap-space recommendation for Linux + - name: swap # required: string, reference name + swap_path: /swapfile # required: string, directory path where swap file is created + disk_size: 4 # required: integer, size in GB of swap file + filesystem_type: swap # required: string, must be value 'swap' ``` ### sap_storage_setup_host_type required From ebf8f5741c2f612251e253ce03a3b44f35cc0f71 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:08:37 +0100 Subject: [PATCH 104/210] sap_storage_setup: remove legacy sample file --- playbooks/sample-sap-storage-prep.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 playbooks/sample-sap-storage-prep.yml diff --git a/playbooks/sample-sap-storage-prep.yml b/playbooks/sample-sap-storage-prep.yml deleted file mode 100644 index 6a8cac0a6..000000000 --- a/playbooks/sample-sap-storage-prep.yml +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Experimental Ansible Role, do not suggest using this - -- hosts: all - become: true - pre_tasks: -# - include_vars: ./vars/sample-variables-sap-storage-lvm.yml -# - include_vars: ./vars/sample-variables-sap-storage-lvm-stripes.yml - - tasks: - - - name: SAP storage preparation - vars: - sap_storage_cloud_type: 'generic' - sap_storage_sap_type: 'sap_onehost' - sap_storage_action: 'prepare' - include_role: - name: ../roles/sap_storage_setup From e158cfaad9795c0cd7871264f823b199f223648c Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:18:30 +0100 Subject: [PATCH 105/210] sap_storage_setup: update sample file --- ...p-storage-setup_sap_s4hana_distributed.yml | 162 ++++++++++++++ .../sample-storage_sap_s4hana_distributed.yml | 206 ------------------ 2 files changed, 162 insertions(+), 206 deletions(-) create mode 100644 playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml delete mode 100644 playbooks/sample-storage_sap_s4hana_distributed.yml diff --git a/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml b/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml new file mode 100644 index 000000000..4cdcf423a --- /dev/null +++ b/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml @@ -0,0 +1,162 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +- name: Complete Infrastructure setup + hosts: hana_primary, nwas_ascs, nwas_pas, nwas_aas + become: true + any_errors_fatal: true + + vars: + + sap_system_sid: "S01" + sap_system_hana_db_sid: "H01" + sap_system_nwas_abap_ascs_instance_nr: "00" + sap_system_nwas_abap_pas_instance_nr: "01" + sap_system_nwas_abap_aas_instance_nr: "11" + + aws_nfs_mount_point: "fs-1234567890.efs.eu-west-2.amazonaws.com:/" + aws_nfs_mount_point_separate_sap_transport_dir: "fs-0987654321.efs.eu-west-2.amazonaws.com:/" + aws_nfs_mount_point_type: nfs4 + aws_nfs_mount_point_opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,acl,noauto # should include noauto to avoid /etc/fstab mount on boot, when Linux Pacemaker should control mount + + aws_host_specifications_dictionary: + + hana-p: + sap_storage_setup_sid: "{{ sap_system_hana_db_sid }}" + sap_storage_setup_host_type: + - hana_primary + sap_storage_setup_definition: + - name: hana_data + mountpoint: /hana/data + disk_size: 384 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: hana_log + mountpoint: /hana/log + disk_size: 128 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: hana_shared + mountpoint: /hana/shared + disk_size: 320 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: swap + swap_path: /swapfile # use swap file on root disk, instead of creating LVM LV for swap + disk_size: 2 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-ascs: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ sap_system_nwas_abap_ascs_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_ascs + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-pas: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_pas_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_pas + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-aas: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_aas_instance_nr: "{{ sap_system_nwas_abap_aas_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_aas + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + tasks: + + - name: Execute Ansible Role sap_storage_setup + ansible.builtin.include_role: + name: community.sap_install.sap_storage_setup + vars: + sap_storage_setup_sid: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_sid | default('') }}" + sap_storage_setup_host_type: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_host_type | list }}" + sap_storage_setup_definition: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_definition | list }}" + sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ascs_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_ers_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ers_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_pas_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_pas_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_aas_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_aas_instance_nr | default(omit) }}" diff --git a/playbooks/sample-storage_sap_s4hana_distributed.yml b/playbooks/sample-storage_sap_s4hana_distributed.yml deleted file mode 100644 index 6e5b65d7a..000000000 --- a/playbooks/sample-storage_sap_s4hana_distributed.yml +++ /dev/null @@ -1,206 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -- name: Complete Infrastructure setup - hosts: hana_primary, nwas_ascs, nwas_pas, nwas_aas - become: true - any_errors_fatal: true - - vars: - - sap_system_sid: "S01" - sap_system_hana_db_sid: "H01" - sap_system_hana_db_instance_nr: "90" - sap_system_nwas_abap_ascs_instance_nr: "00" - sap_system_nwas_abap_pas_instance_nr: "01" - sap_system_nwas_abap_aas_instance_nr: "11" - - nfs_mount_point: "fs-1234567890.efs.eu-west-2.amazonaws.com:/" - nfs_mount_point_separate_sap_transport_dir: "fs-0987654321.efs.eu-west-2.amazonaws.com:/" - nfs_mount_point_type: nfs4 - nfs_mount_point_opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,acl,noauto # should include noauto to avoid /etc/fstab mount on boot, when Linux Pacemaker should control mount - - host_specifications_dictionary: - - hana-p: # hostname - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - hana_primary - - storage_definition: - - # Commented out variables are the same for each filesystem, only shown once below to ease readability - - name: hana_data - mountpoint: /hana/data - disk_size: 384 # size in GB, integer - filesystem_type: xfs # default: xfs - #lvm_lv_name: # default: lv_ - #lvm_lv_stripes: 2 # default: null, number of disks to stripe over - #lvm_lv_stripe_size: 128K # default: 64K, defined by the OS. Akin to Virtualized Block Size - #lvm_vg_name: # default: vg_ - #lvm_vg_options: # default: none, additional LVM VG options as string in LVM options syntax (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM VG Physical Extent) - #lvm_vg_physical_extent_size: # default: 4, uses 4 MiB default and difficult to change once set. Akin to Physical Block Size - #lvm_pv_device: # default: discovered ansible_devices matching the target size - #lvm_pv_options: # default: none, additional LVM PV options as string in LVM options syntax (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM PV Physical Extent) - #nfs_path: # subdirectory path on the NFS server - #nfs_server: # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - #nfs_filesystem_type: # default: {{ sap_storage_setup_nfs_filesystem_type }} - #nfs_mount_options: # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: hana_log - mountpoint: /hana/log - disk_size: 128 # size in GB, integer - filesystem_type: xfs # default: xfs - - - name: hana_shared - mountpoint: /hana/shared - disk_size: 320 # size in GB, integer - filesystem_type: xfs # default: xfs - - - name: swap - swap_path: /swapfile # use swap file on root disk, instead of creating LVM LV for swap - disk_size: 2 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-ascs: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ sap_system_nwas_abap_ascs_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_ascs - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-pas: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_pas_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_pas - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-aas: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_aas_instance_nr: "{{ sap_system_nwas_abap_aas_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_aas - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - tasks: - - - name: Execute Ansible Role sap_storage_setup - ansible.builtin.include_role: - name: { role: community.sap_install.sap_storage_setup } - vars: - sap_storage_setup_sid: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_sid | default('') }}" - sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_ers_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ers_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" - sap_storage_setup_host_type: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_host_type | list }}" - sap_storage_setup_definition: "{{ host_specifications_dictionary[ansible_hostname].storage_definition | list }}" From 67f7376de3df79b538b4f45ac07e441f8d606e8b Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:29:47 +0100 Subject: [PATCH 106/210] sap_storage_setup: address issue 623 --- roles/sap_storage_setup/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index c8ef190b0..95bc07478 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -17,6 +17,13 @@ This Ansible Role is agnostic, and will run on any Infrastructure Platform. Only Please note, while this Ansible Role has protection against overwrite of existing disks and filesystems - sensible review and care is required for any automation of disk storage. Please review the documentation and samples/examples carefully. It is strongly suggested to initially execute the Ansible Playbook calling this Ansible Role, with `ansible-playbook --check` for Check Mode - this will perform no changes to the host and show which changes would be made. +In addition, this Ansible Role: + +- Does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. +- Enforces 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). + - For granular control of LVM setup, the suggestion is to instead use Ansible Role `storage` from the `fedora.linux_system_roles` Ansible Colletion or the Ansible Roles `lvg/lvol/filesystem` from `community.general` Ansible Collection + + ## Requirements The Ansible Role requires the `community.general` Ansible Collection (uses the `lvg`, `lvol` and `filesystem` Ansible Modules). From d1daec492f7fcd8074636cb97e63f7d08179a92c Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:34:08 +0100 Subject: [PATCH 107/210] sap_storage_setup: fix typo --- roles/sap_storage_setup/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index 95bc07478..d5e5ff23c 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -21,7 +21,7 @@ In addition, this Ansible Role: - Does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. - Enforces 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). - - For granular control of LVM setup, the suggestion is to instead use Ansible Role `storage` from the `fedora.linux_system_roles` Ansible Colletion or the Ansible Roles `lvg/lvol/filesystem` from `community.general` Ansible Collection + - For granular control of LVM setup, the suggestion is to instead use Ansible Role `storage` from the `fedora.linux_system_roles` Ansible Collection or the Ansible Roles `lvg/lvol/filesystem` from `community.general` Ansible Collection ## Requirements From 902a0ad1d5f6daaea733ccdb95e32b7cc5948376 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 29 Jul 2024 10:02:25 +0200 Subject: [PATCH 108/210] sap_general_preconfigure: Use FQCN for import_role We need to use the FQCN when importing the role sap_maintain_etc_hosts. Solves issue #826. Signed-off-by: Bernd Finger --- .../tasks/sapnote/2002167/03-setting-the-hostname.yml | 2 +- .../tasks/sapnote/2772999/03-configure-hostname.yml | 2 +- .../tasks/sapnote/3108316/03-configure-hostname.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml index 610ad2dda..9e96a2657 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2002167/03-setting-the-hostname.yml @@ -16,7 +16,7 @@ - name: Import role sap_maintain_etc_hosts ansible.builtin.import_role: - name: sap_maintain_etc_hosts + name: 'community.sap_install.sap_maintain_etc_hosts' vars: sap_maintain_etc_hosts_list: - node_ip: "{{ sap_general_preconfigure_ip }}" diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml index ecf8866b3..1a22f7c6b 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/03-configure-hostname.yml @@ -16,7 +16,7 @@ - name: Import role sap_maintain_etc_hosts ansible.builtin.import_role: - name: sap_maintain_etc_hosts + name: 'community.sap_install.sap_maintain_etc_hosts' vars: sap_maintain_etc_hosts_list: - node_ip: "{{ sap_general_preconfigure_ip }}" diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml index 0b2e96d04..fab19c6b6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/03-configure-hostname.yml @@ -16,7 +16,7 @@ - name: Import role sap_maintain_etc_hosts ansible.builtin.import_role: - name: sap_maintain_etc_hosts + name: 'community.sap_install.sap_maintain_etc_hosts' vars: sap_maintain_etc_hosts_list: - node_ip: "{{ sap_general_preconfigure_ip }}" From 8d627ffb0c00e897f65c7d8d3103f16e0dd03870 Mon Sep 17 00:00:00 2001 From: "remi.mrozek" Date: Mon, 29 Jul 2024 12:58:10 +0000 Subject: [PATCH 109/210] sap_install_media_detect: fix syntax --- .../tasks/prepare/move_files_to_main_directory.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml index 68134084d..f3d141b5f 100644 --- a/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml +++ b/roles/sap_install_media_detect/tasks/prepare/move_files_to_main_directory.yml @@ -10,9 +10,9 @@ - name: SAP Install Media Detect - Prepare - Move files to parent for known subdirs - Find the relevant non-extract subdirectories # noqa risky-shell-pipe ansible.builtin.shell: cmd: > - ls -d \ - sap_hana sap_swpm sap_swpm_download_basket \ - sapase sapmaxdb oracledb ibmdb2 sap_export_nwas_java sap_export_ecc sap_export_nwas_abap sap_export_solman_java sap_export_ecc_ides \ + ls -d + sap_hana sap_swpm sap_swpm_download_basket + sapase sapmaxdb oracledb ibmdb2 sap_export_nwas_java sap_export_ecc sap_export_nwas_abap sap_export_solman_java sap_export_ecc_ides $({{ __sap_install_media_detect_sapfile_path }} -s) 2>/dev/null | awk '{print ("'{{ __sap_install_media_detect_software_main_directory }}'/"$0"/")}' chdir: "{{ __sap_install_media_detect_software_main_directory }}" From b779f873a0bdb0c0338fdc1f21837c13314410a4 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 30 Jul 2024 14:56:19 +0200 Subject: [PATCH 110/210] Stonith SBD, fence and repo dictionaries --- roles/sap_ha_pacemaker_cluster/README.md | 94 +++++++++++-- .../defaults/main.yml | 1 + .../meta/argument_specs.yml | 68 +++++++-- .../tasks/construct_final_hacluster_vars.yml | 22 +++ .../tasks/construct_vars_common.yml | 45 +++++- .../tasks/construct_vars_stonith.yml | 133 +++++++++++++++--- .../import_hacluster_vars_from_inventory.yml | 15 ++ .../preconfigure_cloud_aws_ec2_vs.yml | 9 ++ .../vars/platform_cloud_aws_ec2_vs.yml | 64 ++++++--- .../vars/platform_cloud_gcp_ce_vm.yml | 45 +++--- .../vars/platform_cloud_ibmcloud_powervs.yml | 77 +++++----- .../vars/platform_cloud_ibmcloud_vs.yml | 35 ++--- .../vars/platform_cloud_msazure_vm.yml | 34 ++--- .../vars/platform_hyp_ibmpower_vm.yml | 65 +++++---- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 51 +++++-- roles/sap_ha_pacemaker_cluster/vars/suse.yml | 13 +- 16 files changed, 569 insertions(+), 202 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 206377818..b96e4a0d4 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -13,8 +13,8 @@ This Ansible Role provides: - setup and instantiation of Linux Pacemaker cluster (using `ha_cluster` Linux System Role) This Ansible Role has been tested for the following SAP Software Solution scenario deployments: -- SAP HANA Scale-up High Availability -- `Beta:` SAP NetWeaver (ABAP) AS ASCS and ERS High Availability +- SAP HANA Scale-up High Availability (SAPHanaSR Classic and SAPHanaSR-angi) +- SAP NetWeaver (ABAP) AS ASCS and ERS High Availability - `Experimental:` SAP NetWeaver (ABAP) AS PAS and AAS High Availability - `Experimental:` SAP NetWeaver (JAVA) AS SCS and ERS High Availability @@ -71,8 +71,8 @@ The Ansible Control System (where Ansible is executed from) must have: - Ansible Core 2.9+ - Access to dependency Ansible Collections and Ansible Roles: - **Upstream**: - - Ansible Collection [`community.sap_install` from Ansible Galaxy](https://galaxy.ansible.com/community/sap_install) version `1.3.0` or later - - Ansible Collection [`fedora.linux_system_roles` from Ansible Galaxy](https://galaxy.ansible.com/fedora/linux_system_roles) version `1.20.0` or later + - Ansible Collection [`community.sap_install` from Ansible Galaxy](https://galaxy.ansible.com/community/sap_install) version `1.4.1` or later + - Ansible Collection [`fedora.linux_system_roles` from Ansible Galaxy](https://galaxy.ansible.com/fedora/linux_system_roles) version `1.82.0` or later - **Supported (Downstream)** via Red Hat Ansible Automation Platform (AAP) license: - Ansible Collection [`redhat.sap_install` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/sap_install) version `1.3.0` or later - Ansible Collection [`redhat.rhel_system_roles` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles) version `1.20.0` or later @@ -148,6 +148,13 @@ Additional minimum requirements depend on the type of cluster setup and on the t AWS access key to allow control of instances (for example for fencing operations).
Mandatory for the cluster nodes setup on AWS EC2 instances.
+### sap_ha_pacemaker_cluster_aws_credentials_setup + +- _Type:_ `string` + +Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
+Required: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
+ ### sap_ha_pacemaker_cluster_aws_region - _Type:_ `string` @@ -259,19 +266,14 @@ Set this parameter to 'false' if the SAP HA interface should not be installed an Additional extra packages to be installed, for instance specific resource packages.
For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
-### sap_ha_pacemaker_cluster_fence_agent_minimal_packages - -- _Type:_ `list` -- _Default:_ `['fence-agents-all']` - -The minimal set of fence agent packages that will be installed.
- ### sap_ha_pacemaker_cluster_fence_agent_packages - _Type:_ `list` Additional fence agent packages to be installed.
-This is automatically combined with `sap_ha_pacemaker_cluster_fence_agent_minimal_packages`.
+This is automatically combined with default packages in:
+`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`
+`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
### sap_ha_pacemaker_cluster_gcp_project @@ -460,7 +462,7 @@ When set to "true" (default) a failover to secondary will be initiated on resour - _Default:_ `msl_SAPHana__HDB` Customize the cluster resource name of the SAP HANA DB resource master slave clone.
-Master Slave clone is specific to SAPHana resource on SUSE.
+Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
### sap_ha_pacemaker_cluster_hana_resource_clone_name @@ -849,6 +851,70 @@ sap_ha_pacemaker_cluster_resource_defaults: Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
+### sap_ha_pacemaker_cluster_sbd_devices + +- _Type:_ `list` + +Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of block devices for Stonith SBD agent
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +``` + +### sap_ha_pacemaker_cluster_sbd_enabled + +- _Type:_ `bool` + +Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
+Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
+Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +sap_ha_pacemaker_cluster_sbd_enabled: true +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:external/sbd + name: rsc_stonith_sbd + options: + pcmk_delay_max: 15 +``` + +### sap_ha_pacemaker_cluster_sbd_options + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list SBD specific options that are added into SBD configuration file.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_options: +- name: startmode + value: clean +``` + +### sap_ha_pacemaker_cluster_sbd_watchdog + +- _Type:_ `str` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide watchdog name to override default /dev/watchdog
+ +### sap_ha_pacemaker_cluster_sbd_watchdog_modules + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
+ ### sap_ha_pacemaker_cluster_stonith_custom - _Type:_ `list` @@ -861,7 +927,7 @@ This definition override any defaults the role would apply otherwise.
- **name**
Name that will be used as the resource ID (name). - **options**
- The resource options listed in dictionary format, one option per line.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. + The resource options listed in dictionary format, one option per line.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. Example: diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 94efa79d8..3af1f9cbb 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -365,6 +365,7 @@ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name: >- # sap_ha_pacemaker_cluster_aws_access_key_id # sap_ha_pacemaker_cluster_aws_secret_access_key # sap_ha_pacemaker_cluster_aws_region +# sap_ha_pacemaker_cluster_aws_credentials_setup ## Google Cloud platform, Compute Engine Virtual Machines # sap_ha_pacemaker_cluster_gcp_project diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 4ea9ecc51..a2138e22b 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -102,12 +102,6 @@ argument_specs: node_ip: 192.168.5.1 - hana_site: DC02 - sap_ha_pacemaker_cluster_fence_agent_minimal_packages: - type: list - default: ['fence-agents-all'] - description: - - The minimal set of fence agent packages that will be installed. - sap_ha_pacemaker_cluster_resource_defaults: type: dict default: @@ -181,6 +175,8 @@ argument_specs: - The resource options listed in dictionary format, one option per line. - Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. + - "Example: stonith:fence_sbd agent requires devices option with list of SBD disks." + - "Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`." required: true example: @@ -194,6 +190,56 @@ argument_specs: pcmk_host_list: node1,node2 power_wait: 3 + sap_ha_pacemaker_cluster_sbd_enabled: + type: bool + description: + - Set this parameter to 'true' to enable workflow to add Stonith SBD resource. + - Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`. + - "Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL" + + example: + sap_ha_pacemaker_cluster_sbd_enabled: true + sap_ha_pacemaker_cluster_stonith_custom: + - name: rsc_stonith_sbd + agent: stonith:external/sbd + options: + pcmk_delay_max: 15 + sap_ha_pacemaker_cluster_sbd_devices: + - /dev/disk/by-id/scsi-3600 + + sap_ha_pacemaker_cluster_sbd_devices: + type: list + description: + - Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. + - Provide list of block devices for Stonith SBD agent + + example: + sap_ha_pacemaker_cluster_sbd_devices: + - /dev/disk/by-id/scsi-3600 + + sap_ha_pacemaker_cluster_sbd_options: + type: list + description: + - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. + - Provide list SBD specific options that are added into SBD configuration file. + + example: + sap_ha_pacemaker_cluster_sbd_options: + - name: startmode + value: clean + + sap_ha_pacemaker_cluster_sbd_watchdog: + type: str + description: + - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. + - Provide watchdog name to override default /dev/watchdog + + sap_ha_pacemaker_cluster_sbd_watchdog_modules: + type: list + description: + - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. + - Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices). + sap_ha_pacemaker_cluster_cluster_properties: type: dict default: @@ -251,7 +297,9 @@ argument_specs: type: list description: - Additional fence agent packages to be installed. - - This is automatically combined with `sap_ha_pacemaker_cluster_fence_agent_minimal_packages`. + - "This is automatically combined with default packages in:" + - "`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`" + - "`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`" sap_ha_pacemaker_cluster_hacluster_user_password: description: @@ -321,7 +369,7 @@ argument_specs: default: "msl_SAPHana__HDB" description: - Customize the cluster resource name of the SAP HANA DB resource master slave clone. - - Master Slave clone is specific to SAPHana resource on SUSE. + - Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi). sap_ha_pacemaker_cluster_hanacontroller_resource_name: default: "rsc_SAPHanaCon__HDB" @@ -798,6 +846,10 @@ argument_specs: - AWS secret key, paired with the access key for instance control. - Mandatory for the cluster setup on AWS EC2 instances. + sap_ha_pacemaker_cluster_aws_credentials_setup: + description: + - Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials. + - "Required: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`" ########################################################################## # Platforms: GCP specific parameters diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml index 2367aee08..9c9af77f4 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_final_hacluster_vars.yml @@ -29,6 +29,18 @@ # __sap_ha_pacemaker_cluster_resource_primitives ha_cluster_resource_primitives # __sap_ha_pacemaker_cluster_corosync_totem ha_cluster_totem +# Combines SBD stonith options with ha_cluster if it was not imported as extra var. +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Include SBD config into 'ha_cluster'" # noqa jinja[spacing] + when: + - __sap_ha_pacemaker_cluster_ha_cluster_stonith is defined and __sap_ha_pacemaker_cluster_ha_cluster_stonith | length > 0 + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_ha_cluster: >- + {%- if __sap_ha_pacemaker_cluster_ha_cluster is defined and __sap_ha_pacemaker_cluster_ha_cluster | length > 0 -%} + {{ __sap_ha_pacemaker_cluster_ha_cluster | combine(__sap_ha_pacemaker_cluster_ha_cluster_stonith) }} + {%- else -%} + {{ __sap_ha_pacemaker_cluster_ha_cluster_stonith }} + {%- endif -%} + - name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster'" when: __sap_ha_pacemaker_cluster_ha_cluster is defined ansible.builtin.set_fact: @@ -110,3 +122,13 @@ when: __sap_ha_pacemaker_cluster_corosync_totem is defined ansible.builtin.set_fact: ha_cluster_totem: "{{ __sap_ha_pacemaker_cluster_corosync_totem }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_sbd_options'" + when: __sap_ha_pacemaker_cluster_sbd_options is defined + ansible.builtin.set_fact: + ha_cluster_sbd_options: "{{ __sap_ha_pacemaker_cluster_sbd_options }}" + +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Define parameter 'ha_cluster_sbd_enabled'" + when: __sap_ha_pacemaker_cluster_sbd_enabled is defined + ansible.builtin.set_fact: + ha_cluster_sbd_enabled: "{{ __sap_ha_pacemaker_cluster_sbd_enabled }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index 8a5bd6dc3..b0f8324d0 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -22,7 +22,25 @@ __sap_ha_pacemaker_cluster_hacluster_user_password: "{{ sap_ha_pacemaker_cluster_hacluster_user_password }}" no_log: true # secure the credential +# sap_ha_pacemaker_cluster_ha_cluster -> user-defined or default inherited from {{ ha_cluster }} +- name: "SAP HA Prepare Pacemaker - Register sap_ha_pacemaker_cluster_ha_cluster" + when: + - __sap_ha_pacemaker_cluster_ha_cluster is not defined + - sap_ha_pacemaker_cluster_ha_cluster is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_ha_cluster: "{{ sap_ha_pacemaker_cluster_ha_cluster }}" + +- name: "SAP HA Prepare Pacemaker - Generate default sap_ha_pacemaker_cluster_ha_cluster" + when: + - not __sap_ha_pacemaker_cluster_ha_cluster is defined + - not sap_ha_pacemaker_cluster_ha_cluster is defined + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_ha_cluster: + node_name: "{{ ansible_hostname }}" + pcs_address: "{{ ansible_default_ipv4.address }}" + +# Combine following extra packages together: # sap_ha_pacemaker_cluster_extra_packages -> user-defined, empty by global default # __sap_ha_pacemaker_cluster_sap_extra_packages -> included from vars/* # __sap_ha_pacemaker_cluster_platform_extra_packages -> included from vars/platform* @@ -36,17 +54,32 @@ | unique | select() }}" # remove duplicates and empty elements -# sap_ha_pacemaker_cluster_fence_agent_minimal_packages -> global default -# sap_ha_pacemaker_cluster_fence_agent_packages -> global default -# __sap_ha_pacemaker_cluster_fence_agent_packages -> internal default (vars/main.yml) +# Combine following fence packages together: +# __sap_ha_pacemaker_cluster_fence_agent_packages_minimal -> os default +# __sap_ha_pacemaker_cluster_fence_agent_packages_platform -> platform defaults from dict +# sap_ha_pacemaker_cluster_fence_agent_packages -> user input or default [] + +# __sap_ha_pacemaker_cluster_fence_agent_packages loaded from ha_cluster is not included, +# because it would still not be used due to precedence. +# TODO: Remove Tech debt conditionals in future. - name: "SAP HA Prepare Pacemaker - Combine fence agent packages lists" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ - (sap_ha_pacemaker_cluster_fence_agent_minimal_packages - + sap_ha_pacemaker_cluster_fence_agent_packages - + __sap_ha_pacemaker_cluster_fence_agent_packages) + (__sap_ha_pacemaker_cluster_fence_agent_packages_minimal_combined + + __sap_ha_pacemaker_cluster_fence_agent_packages_platform + + sap_ha_pacemaker_cluster_fence_agent_packages) | unique }}" + vars: + # Tech debt for sap_ha_pacemaker_cluster_fence_agent_minimal_packages + __sap_ha_pacemaker_cluster_fence_agent_packages_minimal_combined: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_minimal + + sap_ha_pacemaker_cluster_fence_agent_minimal_packages + if (sap_ha_pacemaker_cluster_fence_agent_minimal_packages is defined + and sap_ha_pacemaker_cluster_fence_agent_minimal_packages | length > 0 + and sap_ha_pacemaker_cluster_fence_agent_minimal_packages is iterable) + else __sap_ha_pacemaker_cluster_fence_agent_packages_minimal }}" + # Prepare corosync totem variable with either: # - User provided sap_ha_pacemaker_cluster_corosync_totem if present diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index a525ced88..2cb3129e9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -21,17 +21,17 @@ or ( sap_ha_pacemaker_cluster_stonith_custom is not defined - and sap_ha_pacemaker_cluster_stonith_default is defined + and __sap_ha_pacemaker_cluster_stonith_default is defined and ( - sap_ha_pacemaker_cluster_stonith_default == '' - or sap_ha_pacemaker_cluster_stonith_default | length == 0 + __sap_ha_pacemaker_cluster_stonith_default == '' + or __sap_ha_pacemaker_cluster_stonith_default | length == 0 ) ) or ( sap_ha_pacemaker_cluster_stonith_custom is not defined - and sap_ha_pacemaker_cluster_stonith_default is not defined + and __sap_ha_pacemaker_cluster_stonith_default is not defined ) block: @@ -59,9 +59,9 @@ ansible.builtin.set_fact: sap_ha_pacemaker_cluster_cluster_properties: "{{ sap_ha_pacemaker_cluster_cluster_properties | combine({'priority-fencing-delay': - sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max | int * 2}) - if sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max is defined - and sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max | int != 0 + __sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max | int * 2}) + if __sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max is defined + and __sap_ha_pacemaker_cluster_stonith_default.options.pcmk_delay_max | int != 0 else sap_ha_pacemaker_cluster_cluster_properties }}" - name: "SAP HA Prepare Pacemaker - (STONITH) Define cluster properties" @@ -88,11 +88,12 @@ {%- endfor %} {{ attrs }} + # Combine the default stonith resource config from # - assembled pcmk_host_map # (see platform tasks: __sap_ha_pacemaker_cluster_pcmk_host_map) # - fence agent specific required options -# (see platform vars: sap_ha_pacemaker_cluster_stonith_default) +# (see platform vars: __sap_ha_pacemaker_cluster_stonith_default) # - generic pacemaker fence resource options # (see defaults: sap_ha_pacemaker_cluster_fence_options) @@ -101,16 +102,17 @@ - name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resource definition from platform default" when: - - sap_ha_pacemaker_cluster_stonith_default is defined - - sap_ha_pacemaker_cluster_stonith_default | length > 0 + - __sap_ha_pacemaker_cluster_stonith_default is defined + - __sap_ha_pacemaker_cluster_stonith_default | length > 0 - sap_ha_pacemaker_cluster_stonith_custom is not defined + or sap_ha_pacemaker_cluster_stonith_custom | length == 0 - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([])| map(attribute='id')) ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [__stonith_resource_element] }}" vars: __stonith_resource_element: - id: "{{ sap_ha_pacemaker_cluster_stonith_default.id + __plug_suffix }}" - agent: "{{ sap_ha_pacemaker_cluster_stonith_default.agent }}" + id: "{{ __sap_ha_pacemaker_cluster_stonith_default.id + __plug_suffix }}" + agent: "{{ __sap_ha_pacemaker_cluster_stonith_default.agent }}" instance_attrs: - attrs: >- {% set attrs = [] -%} @@ -127,9 +129,9 @@ 'value': stonith_host_item }]) -%} {%- endif %} - {%- if sap_ha_pacemaker_cluster_stonith_default.options is defined - and sap_ha_pacemaker_cluster_stonith_default.options | length > 0 -%} - {%- for agent_opt in (sap_ha_pacemaker_cluster_stonith_default.options | default({}) | dict2items) -%} + {%- if __sap_ha_pacemaker_cluster_stonith_default.options is defined + and __sap_ha_pacemaker_cluster_stonith_default.options | length > 0 -%} + {%- for agent_opt in (__sap_ha_pacemaker_cluster_stonith_default.options | default({}) | dict2items) -%} {% set aopts = attrs.extend([ { 'name': agent_opt.key, @@ -150,15 +152,114 @@ label: "{{ stonith_host_item }}" +# Requirements to run SBD block: +# sap_ha_pacemaker_cluster_sbd_enabled is true +# sap_ha_pacemaker_cluster_sbd_devices is defined, list and not empty +# sap_ha_pacemaker_cluster_stonith_custom is defined, list and not empty +# __sap_ha_pacemaker_cluster_sbd_enabled is not defined +- name: "SAP HA Prepare Pacemaker - (STONITH SBD) Prepare SBD configuration" + when: + - sap_ha_pacemaker_cluster_sbd_enabled is defined + and sap_ha_pacemaker_cluster_sbd_enabled + - sap_ha_pacemaker_cluster_sbd_devices is defined + and sap_ha_pacemaker_cluster_sbd_devices | length > 0 + and sap_ha_pacemaker_cluster_sbd_devices is iterable + and sap_ha_pacemaker_cluster_sbd_devices is not string + - sap_ha_pacemaker_cluster_stonith_custom is defined + and sap_ha_pacemaker_cluster_stonith_custom | length > 0 + and sap_ha_pacemaker_cluster_stonith_custom is iterable + and sap_ha_pacemaker_cluster_stonith_custom is not string + - __sap_ha_pacemaker_cluster_sbd_enabled is not defined + block: + # Create sbd_options for ha_cluster_sbd_options when + # ha_cluster_sbd_options is not defined or it is empty or not List + # ha_cluster_sbd_options is defined but it does not contain required startmode + - name: "SAP HA Prepare Pacemaker - (STONITH SBD) Create sbd_options" + when: + - not sap_ha_pacemaker_cluster_sbd_options is defined + or sap_ha_pacemaker_cluster_sbd_options | length == 0 + or not sap_ha_pacemaker_cluster_sbd_options is iterable + or (sap_ha_pacemaker_cluster_sbd_options is defined + and sap_ha_pacemaker_cluster_sbd_options | selectattr('name', 'equalto', 'startmode') | list | length == 0) + # Skip if startmode is already present + - not (sap_ha_pacemaker_cluster_sbd_options is defined + and sap_ha_pacemaker_cluster_sbd_options | selectattr('name', 'equalto', 'startmode') | list | length > 0) + # Skip if ha_cluster_sbd_options are provided + - __sap_ha_pacemaker_cluster_sbd_options is not defined + or __sap_ha_pacemaker_cluster_sbd_options | length == 0 + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_sbd_options: >- + {%- if sap_ha_pacemaker_cluster_sbd_options is defined + and (sap_ha_pacemaker_cluster_sbd_options | selectattr('name', 'equalto', 'startmode') | list | length == 0) -%} + {{ sap_ha_pacemaker_cluster_sbd_options + [{'name': 'startmode', 'value': __sbd_startmode}]}} + {%- else -%} + {{ [{'name': 'startmode', 'value': __sbd_startmode}] }} + {%- endif -%} + vars: + __sbd_startmode: "{{ 'clean' if sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 else 'always' }}" + + + # Create dictionary with SBD specific parameters for ha_cluster + # Omit parameters if they are already present in provided dictionary sap_ha_pacemaker_cluster_ha_cluster + - name: "SAP HA Prepare Pacemaker - (STONITH SBD) Create ha_cluster parameters for SBD" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_ha_cluster_stonith: >- + {{ + dict( + sbd_devices=(sap_ha_pacemaker_cluster_sbd_devices if sap_ha_pacemaker_cluster_sbd_devices is defined + and sap_ha_pacemaker_cluster_sbd_devices | length > 0 and not __sap_ha_pacemaker_cluster_ha_cluster_sbd_devices_exists + else omit), + sbd_watchdog=(sap_ha_pacemaker_cluster_sbd_watchdog if sap_ha_pacemaker_cluster_sbd_watchdog is defined + and sap_ha_pacemaker_cluster_sbd_watchdog | length > 0 and not __sap_ha_pacemaker_cluster_ha_cluster_sbd_watchdog_exists + else omit), + sbd_watchdog_modules=(sap_ha_pacemaker_cluster_sbd_watchdog_modules + if sap_ha_pacemaker_cluster_sbd_watchdog_modules is defined + and sap_ha_pacemaker_cluster_sbd_watchdog_modules | length > 0 + and not __sap_ha_pacemaker_cluster_ha_cluster_sbd_watchdog_modules_exists + else omit) + ) + }} + vars: + # Detect if parameters were already provided in sap_ha_pacemaker_cluster_ha_cluster + __sap_ha_pacemaker_cluster_ha_cluster_sbd_devices_exists: + "{{ true if __sap_ha_pacemaker_cluster_ha_cluster is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_devices is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_devices | length > 0 + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_devices is iterable else false }}" + __sap_ha_pacemaker_cluster_ha_cluster_sbd_watchdog_exists: + "{{ true if __sap_ha_pacemaker_cluster_ha_cluster is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_watchdog is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_watchdog | length > 0 else false }}" + __sap_ha_pacemaker_cluster_ha_cluster_sbd_watchdog_modules_exists: + "{{ true if __sap_ha_pacemaker_cluster_ha_cluster is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_watchdog_modules is defined + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_watchdog_modules | length > 0 + and __sap_ha_pacemaker_cluster_ha_cluster.sbd_watchdog_modules is iterable else false }}" + + + - name: "SAP HA Prepare Pacemaker - (STONITH SBD) Include sbd fence agent" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_fence_agent_packages: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages + ['sbd'] }}" + + - name: "SAP HA Prepare Pacemaker - (STONITH SBD) Set __sap_ha_pacemaker_cluster_sbd_enabled" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_sbd_enabled: true + + - name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition" when: - sap_ha_pacemaker_cluster_stonith_custom is defined + and sap_ha_pacemaker_cluster_stonith_custom | length > 0 + and sap_ha_pacemaker_cluster_stonith_custom is iterable + and sap_ha_pacemaker_cluster_stonith_custom is not string - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([]) | map(attribute='id')) ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [__stonith_resource_element] }}" vars: __stonith_resource_element: - id: "res_{{ item.name }}" + # Ensure that resource name conforms with naming convention rsc_ + id: "{{ item.name if item.name.startswith('rsc_') else 'rsc_' ~ item.name }}" # "rsc_{{ item.name }}" agent: "{{ item.agent }}" instance_attrs: - attrs: |- diff --git a/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml index f0905e1a6..c2fa67448 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/import_hacluster_vars_from_inventory.yml @@ -101,3 +101,18 @@ when: ha_cluster_totem is defined ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_corosync_totem: "{{ ha_cluster_totem }}" + +# ha_cluster_sbd_options +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_sbd_options'" + when: + - ha_cluster_sbd_options is defined + and ha_cluster_sbd_options | length > 0 + and ha_cluster_sbd_options is iterable + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_sbd_options: "{{ ha_cluster_sbd_options }}" + +# ha_cluster_sbd_enabled +- name: "SAP HA Prepare Pacemaker - (ha_cluster) Register parameter 'ha_cluster_sbd_enabled'" + when: ha_cluster_sbd_enabled is defined and ha_cluster_sbd_enabled | bool + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_sbd_enabled: "{{ ha_cluster_sbd_enabled }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml index c4f90bce1..26436e0ae 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml @@ -20,7 +20,16 @@ owner: root path: /root/.aws/config +# New variable to disable default saving of AWS credentials file. +# Reason: It overrides attached IAM Role or IAM Instance Profile. - name: "SAP HA Prepare Pacemaker - AWS EC2 VS - Store awscli credentials" + when: + - sap_ha_pacemaker_cluster_aws_credentials_setup is defined + and sap_ha_pacemaker_cluster_aws_credentials_setup + - sap_ha_pacemaker_cluster_aws_access_key_id is defined + and sap_ha_pacemaker_cluster_aws_access_key_id | length > 0 + - sap_ha_pacemaker_cluster_aws_secret_access_key is defined + and sap_ha_pacemaker_cluster_aws_secret_access_key | length > 0 ansible.builtin.blockinfile: backup: true block: | diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index 6a11f22e2..a8cd4bf1a 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -4,38 +4,58 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws | default([]) }}" +# Package definition +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws_ec2_vs | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws_ec2_vs | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" - name: High Availability - -# Predefine -__sap_ha_pacemaker_cluster_aws_instances: [] - -# When aws credentials and region are not defined it will -# default to using the aws cli configuration. -# The aws cli is currently configured anyway for the standard AWS VIP resource. -sap_ha_pacemaker_cluster_stonith_default: - id: "rsc_fence_aws" - # SUSE officially supports only stonith:external/ec2 for AWS. - agent: "{{ 'stonith:fence_aws' if ansible_os_family != 'Suse' else 'stonith:external/ec2' }}" - options: - # Fencing action delay is recommended. Default: 0 - pcmk_delay_max: "{{ 0 if ansible_os_family != 'Suse' else 15 }}" -# access_key: "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" -# secret_key: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" -# region: "{{ sap_ha_pacemaker_cluster_aws_region }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_aws_ec2_vs | default([]) }}" + + +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_aws: + id: "rsc_fence_aws" + # AWS Fence agent is not recommended. + agent: "stonith:fence_aws" + options: + # Fencing action delay is recommended. Default: 0 + # Production pcmk_delay_max is recommended 30-60 + pcmk_delay_max: 15 + # AWS Credentials are not defined here, because they override attached + # IAM Role or IAM Instance Profile + # access_key: "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" + # secret_key: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" + # region: "{{ sap_ha_pacemaker_cluster_aws_region }}" + + external_ec2: + id: "rsc_fence_aws" + # SUSE Recommends stonith:external/ec2 instead of fence_aws + agent: "stonith:external/ec2" + options: + # Fencing action delay is recommended. Default: 0 + # Production pcmk_delay_max is recommended 30-60 + pcmk_delay_max: 15 + tag: pacemaker # tag instance with pacemaker: {{ ansible_hostname }} + # profile: default # Additional tag to use awscli config + +# Select __sap_ha_pacemaker_cluster_stonith_default +# SUSE does not support stonith:fence_aws +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.external_ec2 if ansible_os_family == 'Suse' + else __sap_ha_pacemaker_cluster_stonith_default_dict.fence_aws }}" + # Default corosync options - Platform specific __sap_ha_pacemaker_cluster_corosync_totem_platform: options: token: 30000 + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: aws_vpc_move_ip sap_ha_pacemaker_cluster_vip_group_prefix: '' # the default supported VIP agent is a single resource only diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 24f7e4f79..0cd87d213 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -4,32 +4,33 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp | default([]) }}" +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp_ce_vm | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp_ce_vm | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" - name: High Availability + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_gcp_ce_vm | default([]) }}" -# Predefine -__sap_ha_pacemaker_cluster_gcp_hosts: [] -sap_ha_pacemaker_cluster_stonith_default: - id: "res_fence_gce" - agent: "stonith:fence_gce" - options: - project: "{{ sap_ha_pacemaker_cluster_gcp_project }}" - zone: "{{ sap_ha_pacemaker_cluster_gcp_region_zone }}" - pcmk_reboot_timeout: 300 - pcmk_monitor_retries: 4 - pcmk_delay_max: 30 +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_gce: + id: "rsc_fence_gce" + agent: "stonith:fence_gce" + options: + project: "{{ sap_ha_pacemaker_cluster_gcp_project }}" + zone: "{{ sap_ha_pacemaker_cluster_gcp_region_zone }}" + pcmk_reboot_timeout: 300 + pcmk_monitor_retries: 4 + pcmk_delay_max: 30 + +# Select __sap_ha_pacemaker_cluster_stonith_default +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_gce }}" -# Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: gcp_nlb_reserved_ip_haproxy # gcp_vpc_move_route -sap_ha_pacemaker_cluster_vip_group_prefix: group_ # GCP needs haproxy and ports defined sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" @@ -42,6 +43,7 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: "620{{ sap_ha_pacemaker sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" + # Default corosync options - Platform specific __sap_ha_pacemaker_cluster_corosync_totem_platform: options: @@ -50,6 +52,11 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: join: 60 max_messages: 20 + +# Platform specific VIP handling +sap_ha_pacemaker_cluster_vip_method: gcp_nlb_reserved_ip_haproxy # gcp_vpc_move_route +sap_ha_pacemaker_cluster_vip_group_prefix: group_ + __sap_ha_pacemaker_cluster_available_vip_agents: ipaddr: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index ec31fda05..40afc5f2c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -4,50 +4,49 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs | default([]) }}" +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_powervs | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" - name: High Availability E4S (4-Year) for Power, little endian -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" -# name: High Availability EUS (2-Year) for Power, little endian -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" -# name: High Availability for Power, little endian - -# Predefine -__sap_ha_pacemaker_cluster_ibmcloud_powervs_hosts: [] - - -sap_ha_pacemaker_cluster_stonith_default: - id: "res_fence_ibm_powervs" - agent: "stonith:fence_ibm_powervs" - options: - token: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" - region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" - crn: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn }}" - - # Identified during execution initial tasks, populated when variables are imported - instance: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" - - # Identified during execution initial tasks, populated when variables are imported. - # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported - # plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }}" - - # Dependent on network interface attachments, if no public network interface - # then 'private' value must be provided. - api-type: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" - - # Dependent on network interface attachments, if no public network interface - # then a valid HTTP Proxy URL value must be provided. - proxy: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" - - pcmk_reboot_timeout: 600 - pcmk_monitor_timeout: 600 - pcmk_status_timeout: 60 + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_powervs | default([]) }}" + + +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_ibm_powervs: + id: "rsc_fence_ibm_powervs" + agent: "stonith:fence_ibm_powervs" + options: + token: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" + region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" + crn: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn }}" + + # Identified during execution initial tasks, populated when variables are imported + instance: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" + + # Identified during execution initial tasks, populated when variables are imported. + # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported + # plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }}" + + # Dependent on network interface attachments, if no public network interface + # then 'private' value must be provided. + api-type: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" + + # Dependent on network interface attachments, if no public network interface + # then a valid HTTP Proxy URL value must be provided. + proxy: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" + + pcmk_reboot_timeout: 600 + pcmk_monitor_timeout: 600 + pcmk_status_timeout: 60 + +# Select __sap_ha_pacemaker_cluster_stonith_default +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_ibm_powervs }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index 81e13f417..d54a1f7ed 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -4,30 +4,31 @@ # # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs | default([]) }}" +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_vs | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" - name: High Availability E4S (4-Year) -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" -# name: High Availability EUS (2-Year) -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" -# name: High Availability + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_vs | default([]) }}" -# Predefine -__sap_ha_pacemaker_cluster_ibmcloud_hosts: [] -sap_ha_pacemaker_cluster_stonith_default: - id: "res_fence_ibm_vpc" - agent: "stonith:fence_ibm_vpc" - options: - apikey: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" - region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" - pcmk_monitor_timeout: 600 +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_ibm_vpc: + id: "rsc_fence_ibm_vpc" + agent: "stonith:fence_ibm_vpc" + options: + apikey: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" + region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" + pcmk_monitor_timeout: 600 + +# Select __sap_ha_pacemaker_cluster_stonith_default +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_ibm_vpc }}" + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: ibmcloud_alb_haproxy diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index a94c1bfcb..fb3279134 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -7,29 +7,31 @@ # The packages of the following lists will be installed by the 'ha_cluster' Linux System Role. # Any packages that are pre-requisites for variable construction must be installed before, e.g. # in the preconfigure-* tasks. -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | default([]) }}" +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_msazure_vm | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" - name: High Availability - - id: "rhui-microsoft-azure-rhel8-sap-ha" - name: Microsoft Azure RPMs for Red Hat Enterprise Linux 8 (rhel8-sap-ha) + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_msazure_vm | default([]) }}" -# Predefine -__sap_ha_pacemaker_cluster_msazure_hosts: [] -# Fencing via MS Azure Managed Service Identity (MSI) per cluster node -sap_ha_pacemaker_cluster_stonith_default: - id: "res_fence_azure_arm" - agent: "stonith:fence_azure_arm" - options: - msi: true - subscriptionId: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" - resourceGroup: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_azure_arm: + id: "rsc_fence_azure_arm" + agent: "stonith:fence_azure_arm" + options: + msi: true + subscriptionId: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" + resourceGroup: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + +# Select __sap_ha_pacemaker_cluster_stonith_default +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_azure_arm }}" + # Default corosync options - Platform specific __sap_ha_pacemaker_cluster_corosync_totem_platform: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index d20cbd8b6..0e14079fa 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -4,44 +4,43 @@ # TODO: rename this file to match the actual "chassis_asset_tag" output # TODO: make sure to first respect 'ha_cluster' native variables -sap_ha_pacemaker_cluster_fence_agent_packages: - "{{ sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm | default([]) }}" +__sap_ha_pacemaker_cluster_fence_agent_packages_platform: + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm | default([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.hyp_ibmpower_vm | default([]) }}" __sap_ha_pacemaker_cluster_repos: - - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" - name: High Availability E4S (4-Year) for Power, little endian -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" -# name: High Availability EUS (2-Year) for Power, little endian -# - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" -# name: High Availability for Power, little endian - -# Predefine -__sap_ha_pacemaker_cluster_ibmpower_vm_hosts: [] - - -sap_ha_pacemaker_cluster_stonith_default: - id: "res_fence_lpar" - agent: "stonith:fence_lpar" - options: - ip: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host }}" - ipport: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_port }}" - username: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login }}" - password: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password }}" - hmc_version: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | default('4') }}" - managed: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_host_mtms }}" - # Identified during execution initial tasks, populated when variables are imported - - # plug: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_partition_name }}" - # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported - - pcmk_reboot_retries: 4 - pcmk_reboot_timeout: 600 - pcmk_monitor_timeout: 600 - pcmk_status_timeout: 60 - power_timeout: 240 + "{{ __sap_ha_pacemaker_cluster_repos_dict.hyp_ibmpower_vm | default([]) }}" + + +# Stonith dictionary for default stonith agents. +# Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +__sap_ha_pacemaker_cluster_stonith_default_dict: + fence_lpar: + id: "rsc_fence_lpar" + agent: "stonith:fence_lpar" + options: + ip: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host }}" + ipport: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_port }}" + username: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login }}" + password: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password }}" + hmc_version: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | default('4') }}" + managed: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_host_mtms }}" + # Identified during execution initial tasks, populated when variables are imported + + # plug: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_partition_name }}" + # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported + + pcmk_reboot_retries: 4 + pcmk_reboot_timeout: 600 + pcmk_monitor_timeout: 600 + pcmk_status_timeout: 60 + power_timeout: 240 + +# Select __sap_ha_pacemaker_cluster_stonith_default +__sap_ha_pacemaker_cluster_stonith_default: + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_lpar }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 82fafecf3..93e2d40a6 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -1,11 +1,46 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Overwrite HA_CLUSTER repository ID to use E4S repository -# - an alternative logic could be to enable the repo before running ha_cluster +# Default repositories if platform does not override them. +# This selection does not affect imported __ha_cluster_repos due to precedence. __sap_ha_pacemaker_cluster_repos: - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" name: High Availability +# Dictionary with repos for each platform +__sap_ha_pacemaker_cluster_repos_dict: + cloud_aws_ec2_vs: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" + name: High Availability + cloud_gcp_ce_vm: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" + name: High Availability + cloud_ibmcloud_powervs: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" + name: High Availability E4S (4-Year) for Power, little endian + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" + # name: High Availability EUS (2-Year) for Power, little endian + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" + # name: High Availability for Power, little endian + cloud_ibmcloud_vs: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" + name: High Availability E4S (4-Year) + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" + # name: High Availability EUS (2-Year) + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" + # name: High Availability + cloud_msazure_vm: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" + name: High Availability + - id: "rhui-microsoft-azure-rhel8-sap-ha" + name: Microsoft Azure RPMs for Red Hat Enterprise Linux 8 (rhel8-sap-ha) + hyp_ibmpower_vm: + - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" + name: High Availability E4S (4-Year) for Power, little endian + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-eus-rpms" + # name: High Availability EUS (2-Year) for Power, little endian + # - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-rpms" + # name: High Availability for Power, little endian + __sap_ha_pacemaker_cluster_halib_package: sap-cluster-connector # List of configuration lines that must be added to the instance profiles. @@ -28,14 +63,14 @@ __sap_ha_pacemaker_cluster_corosync_totem_default: # Make sure that there is always the minimal default fed into the included role. # This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'. -sap_ha_pacemaker_cluster_fence_agent_minimal_packages: +__sap_ha_pacemaker_cluster_fence_agent_packages_minimal: - fence-agents-all # Dictionary with fence packages for each platform -sap_ha_pacemaker_cluster_fence_agent_packages_dict: - cloud_aws: +__sap_ha_pacemaker_cluster_fence_agent_packages_dict: + cloud_aws_ec2_vs: - fence-agents-aws - cloud_gcp: + cloud_gcp_ce_vm: - fence-agents-gce cloud_ibmcloud_powervs: - fence-agents-ibm-powervs @@ -48,9 +83,9 @@ sap_ha_pacemaker_cluster_fence_agent_packages_dict: # Dictionary with extra platform specific packages __sap_ha_pacemaker_cluster_platform_extra_packages_dict: - cloud_aws: + cloud_aws_ec2_vs: - awscli - cloud_gcp: + cloud_gcp_ce_vm: - resource-agents-gcp cloud_msazure_vm: - socat diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index e62d9389b..d7c010280 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -1,5 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 --- +# Default repositories are tied to subscription for SLES4SAP, no need to specify them. +# __sap_ha_pacemaker_cluster_repos: +# __sap_ha_pacemaker_cluster_repos_dict: + __sap_ha_pacemaker_cluster_halib_package: sap-suse-cluster-connector # List of configuration lines that must be added to the instance profiles. @@ -27,16 +31,16 @@ __sap_ha_pacemaker_cluster_corosync_totem_default: # Make sure that there is always the minimal default fed into the included role. # This is combined with the custom list 'sap_ha_pacemaker_cluster_fence_agent_packages'. -sap_ha_pacemaker_cluster_fence_agent_minimal_packages: +__sap_ha_pacemaker_cluster_fence_agent_packages_minimal: - fence-agents # Dictionary with fence packages for each platform -# fence-agents are defined in sap_ha_pacemaker_cluster_fence_agent_minimal_packages already. -# sap_ha_pacemaker_cluster_fence_agent_packages_dict: +# fence-agents are defined in __sap_ha_pacemaker_cluster_fence_agent_packages_minimal already. +# __sap_ha_pacemaker_cluster_fence_agent_packages_dict: # Dictionary with extra platform specific packages __sap_ha_pacemaker_cluster_platform_extra_packages_dict: - cloud_aws: + cloud_aws_ec2_vs: - awscli cloud_msazure_vm: - socat @@ -121,6 +125,7 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleout: [] __sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: [] # Overwrite resource clone name for SAP HANA +# SAPHanaSR-angi uses different variables, so it applies only to classic HANA. sap_ha_pacemaker_cluster_hana_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" From 9191e3e761bb81810eb8142263f42056a36c8d31 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 1 Aug 2024 15:54:48 +0200 Subject: [PATCH 111/210] feat: stonith dict ha_cluster structure --- .../defaults/main.yml | 2 +- .../meta/argument_specs.yml | 64 +++++-- .../tasks/construct_vars_common.yml | 2 +- .../tasks/construct_vars_stonith.yml | 59 ++---- .../preconfigure_cloud_aws_ec2_vs.yml | 17 ++ .../vars/platform_cloud_aws_ec2_vs.yml | 174 +++++++++++++++--- .../vars/platform_cloud_gcp_ce_vm.yml | 44 ++++- .../vars/platform_cloud_ibmcloud_powervs.yml | 46 +++-- .../vars/platform_cloud_ibmcloud_vs.yml | 12 +- .../vars/platform_cloud_msazure_vm.yml | 73 +++++++- .../vars/platform_hyp_ibmpower_vm.yml | 46 +++-- 11 files changed, 402 insertions(+), 137 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 3af1f9cbb..959800add 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -365,7 +365,7 @@ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name: >- # sap_ha_pacemaker_cluster_aws_access_key_id # sap_ha_pacemaker_cluster_aws_secret_access_key # sap_ha_pacemaker_cluster_aws_region -# sap_ha_pacemaker_cluster_aws_credentials_setup +# sap_ha_pacemaker_cluster_aws_credentials_setup: false ## Google Cloud platform, Compute Engine Virtual Machines # sap_ha_pacemaker_cluster_gcp_project diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index a2138e22b..1b5386ffe 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -160,9 +160,10 @@ argument_specs: description: - Custom list of STONITH resource(s) to be configured in the cluster. - This definition override any defaults the role would apply otherwise. + - Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster elements: dict options: - name: + id: description: - Name that will be used as the resource ID (name). required: true @@ -170,25 +171,55 @@ argument_specs: description: - Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. required: true - options: + instance_attrs.attrs: description: - - The resource options listed in dictionary format, one option per line. + - Defines resource agent params as list of name/value pairs. - Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. - "Example: stonith:fence_sbd agent requires devices option with list of SBD disks." - "Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`." required: true + operations: + description: + - Defines list of resource agent operations. + action: + description: + - Name of resource agent operation. + required: true + attrs: + description: + - Defines operation parameters as list of name/value pairs. + meta_attrs.attrs: + description: + - Defines meta attributes as list of name/value pairs. example: sap_ha_pacemaker_cluster_stonith_custom: - name: "my-fence-resource" agent: "stonith:fence_rhevm" - options: - ip: rhevm-server - username: login-user - password: login-user-password - pcmk_host_list: node1,node2 - power_wait: 3 + instance_attrs: + - attrs: + - name: ip + value: rhevm-server + - name: username + value: login-user + - name: password + value: login-user-password + - name: pcmk_host_list + value: node1,node2 + - name: power_wait + value: 3 + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 sap_ha_pacemaker_cluster_sbd_enabled: type: bool @@ -200,10 +231,12 @@ argument_specs: example: sap_ha_pacemaker_cluster_sbd_enabled: true sap_ha_pacemaker_cluster_stonith_custom: - - name: rsc_stonith_sbd + - id: stonith_sbd agent: stonith:external/sbd - options: - pcmk_delay_max: 15 + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 15 sap_ha_pacemaker_cluster_sbd_devices: - /dev/disk/by-id/scsi-3600 @@ -221,7 +254,7 @@ argument_specs: type: list description: - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. - - Provide list SBD specific options that are added into SBD configuration file. + - Provide list of SBD specific options that are added into SBD configuration file. example: sap_ha_pacemaker_cluster_sbd_options: @@ -230,6 +263,7 @@ argument_specs: sap_ha_pacemaker_cluster_sbd_watchdog: type: str + default: /dev/watchdog description: - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. - Provide watchdog name to override default /dev/watchdog @@ -240,6 +274,10 @@ argument_specs: - Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled. - Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices). + example: + sap_ha_pacemaker_cluster_sbd_watchdog_modules: + - softdog + sap_ha_pacemaker_cluster_cluster_properties: type: dict default: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index b0f8324d0..e34dd1584 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -62,7 +62,7 @@ # __sap_ha_pacemaker_cluster_fence_agent_packages loaded from ha_cluster is not included, # because it would still not be used due to precedence. -# TODO: Remove Tech debt conditionals in future. +# TODO: Remove Tech debt conditionals in future for deprecated var 'sap_ha_pacemaker_cluster_fence_agent_minimal_packages' - name: "SAP HA Prepare Pacemaker - Combine fence agent packages lists" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index 2cb3129e9..682ec8395 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -89,13 +89,11 @@ {{ attrs }} -# Combine the default stonith resource config from -# - assembled pcmk_host_map -# (see platform tasks: __sap_ha_pacemaker_cluster_pcmk_host_map) -# - fence agent specific required options -# (see platform vars: __sap_ha_pacemaker_cluster_stonith_default) -# - generic pacemaker fence resource options -# (see defaults: sap_ha_pacemaker_cluster_fence_options) +# Prepare default stonith method based on __sap_ha_pacemaker_cluster_stonith_default loaded +# from platform __sap_ha_pacemaker_cluster_stonith_default_dict dictionary. +# Resulting primitive stonith resource is combination of: +# 1. platform specific default: id, agent and options +# 2. pcmk_host_map: string of hosts assembled in include_vars_platform # Note: the 'ha_cluster' LSR only calls the stonith creation for ONE host # -> the definition must contain the resources for all hosts, if multiple @@ -106,52 +104,17 @@ - __sap_ha_pacemaker_cluster_stonith_default | length > 0 - sap_ha_pacemaker_cluster_stonith_custom is not defined or sap_ha_pacemaker_cluster_stonith_custom | length == 0 - - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([])| map(attribute='id')) + - (hostvars[stonith_host_item].__sap_ha_pacemaker_cluster_stonith_default).id + not in (__sap_ha_pacemaker_cluster_stonith_resource | default([])| map(attribute='id')) ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [__stonith_resource_element] }}" - vars: - __stonith_resource_element: - id: "{{ __sap_ha_pacemaker_cluster_stonith_default.id + __plug_suffix }}" - agent: "{{ __sap_ha_pacemaker_cluster_stonith_default.agent }}" - instance_attrs: - - attrs: >- - {% set attrs = [] -%} - {% if __sap_ha_pacemaker_cluster_pcmk_host_map | length > 0 -%} - {% set map = attrs.extend([ - { - 'name': 'pcmk_host_map', - 'value': __sap_ha_pacemaker_cluster_pcmk_host_map - }]) -%} - {%- else -%} - {% set map = attrs.extend([ - { - 'name': 'plug', - 'value': stonith_host_item - }]) -%} - {%- endif %} - {%- if __sap_ha_pacemaker_cluster_stonith_default.options is defined - and __sap_ha_pacemaker_cluster_stonith_default.options | length > 0 -%} - {%- for agent_opt in (__sap_ha_pacemaker_cluster_stonith_default.options | default({}) | dict2items) -%} - {% set aopts = attrs.extend([ - { - 'name': agent_opt.key, - 'value': agent_opt.value - }]) -%} - {%- endfor %} - {%- endif -%} - {{ attrs }} - - __plug_suffix: >- - {%- if __sap_ha_pacemaker_cluster_pcmk_host_map | length == 0 -%} - _{{ stonith_host_item }} - {%- else %}{% endif -%} - + __sap_ha_pacemaker_cluster_stonith_resource: + "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + + [hostvars[stonith_host_item].__sap_ha_pacemaker_cluster_stonith_default] }}" loop: "{{ ansible_play_hosts_all }}" loop_control: loop_var: stonith_host_item label: "{{ stonith_host_item }}" - # Requirements to run SBD block: # sap_ha_pacemaker_cluster_sbd_enabled is true # sap_ha_pacemaker_cluster_sbd_devices is defined, list and not empty @@ -247,6 +210,8 @@ __sap_ha_pacemaker_cluster_sbd_enabled: true +# sap_ha_pacemaker_cluster_stonith_custom input was redesigned to use ha_cluster structure. +# Following task will remain until next release to ensure compatibility with previous structure. - name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition" when: - sap_ha_pacemaker_cluster_stonith_custom is defined diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml index 26436e0ae..1165a0a0f 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_aws_ec2_vs.yml @@ -41,3 +41,20 @@ owner: root path: /root/.aws/credentials no_log: true + +# Notification about dependency on IAM Attachment if +# sap_ha_pacemaker_cluster_aws_credentials_setup is not set to true +- name: "SAP HA Prepare Pacemaker - AWS EC2 VS - awscli credentials warning" + when: + - sap_ha_pacemaker_cluster_aws_credentials_setup is not defined + or (sap_ha_pacemaker_cluster_aws_credentials_setup is defined + and not sap_ha_pacemaker_cluster_aws_credentials_setup) + ansible.builtin.debug: + msg: "{{ __awscli_message.splitlines() }}" + vars: + __awscli_message: | + Notification: AWS CLI credentials were not stored because the variable + sap_ha_pacemaker_cluster_aws_credentials_setup is not defined or it is not true. + + Please ensure that your instances have IAM Role or Instance Profile attached, per AWS documentation + You can ignore this message if provisioning was completed using community.sap_infrastructure. diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index a8cd4bf1a..0ede390fa 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -17,37 +17,165 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +# Documentation sources: +# HANA: +# SLES: https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-stonith-device.html +# RHEL: https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-resources-1.html +# NWAS: +# SLES: https://docs.aws.amazon.com/sap/latest/sap-netweaver/sles-netweaver-ha-cluster-resources.html#create-stonith +# RHEL: https://docs.aws.amazon.com/sap/latest/sap-netweaver/rhel-netweaver-ha-cluster-resources.html#create-stonith + __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_aws: + redhat_hana: + id: "rsc_fence_aws" + agent: "stonith:fence_aws" + instance_attrs: + - attrs: + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" + - name: pcmk_delay_max + value: 45 + - name: power_timeout + value: 600 + # It is recommended to disable default reboot action for Production environment or when manual investigation is required. + - name: pcmk_reboot_action + value: 'off' + - name: pcmk_reboot_timeout + value: 600 + - name: pcmk_reboot_retries + value: 4 + # AWS Credentials are not defined here, because they override attached + # IAM Role or IAM Instance Profile + # - name: access_key + # value: "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" + # - name: secret_key + # value: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" + # - name: region + # value: "{{ sap_ha_pacemaker_cluster_aws_region }}" + operations: + - action: start + attrs: + - name: timeout + value: 600 + - action: monitor + attrs: + - name: interval + value: 300 + - name: timeout + value: 60 + + redhat_nwas: id: "rsc_fence_aws" - # AWS Fence agent is not recommended. agent: "stonith:fence_aws" - options: - # Fencing action delay is recommended. Default: 0 - # Production pcmk_delay_max is recommended 30-60 - pcmk_delay_max: 15 - # AWS Credentials are not defined here, because they override attached - # IAM Role or IAM Instance Profile - # access_key: "{{ sap_ha_pacemaker_cluster_aws_access_key_id }}" - # secret_key: "{{ sap_ha_pacemaker_cluster_aws_secret_access_key }}" - # region: "{{ sap_ha_pacemaker_cluster_aws_region }}" - - external_ec2: + instance_attrs: + - attrs: + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" + - name: pcmk_delay_max + value: 30 + - name: power_timeout + value: 240 + # It is recommended to disable default reboot action for Production environment or when manual investigation is required. + - name: pcmk_reboot_action + value: 'off' + - name: pcmk_reboot_timeout + value: 300 + - name: pcmk_reboot_retries + value: 2 + operations: + - action: start + attrs: + - name: timeout + value: 180 + - action: stop + attrs: + - name: timeout + value: 180 + - action: monitor + attrs: + - name: interval + value: 180 + - name: timeout + value: 60 + + # SUSE Recommends stonith:external/ec2 instead of fence_aws + suse_hana: + id: "rsc_fence_aws" + agent: "stonith:external/ec2" + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 45 + - name: tag + value: "pacemaker" # tag instance with pacemaker: {{ ansible_hostname }} + # Use AWS config profile if AWS credentials are used. + # - name: profile + # value: cluster + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 + - action: stop + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 + - action: monitor + attrs: + - name: interval + value: 120 + - name: timeout + value: 60 + + suse_nwas: id: "rsc_fence_aws" - # SUSE Recommends stonith:external/ec2 instead of fence_aws agent: "stonith:external/ec2" - options: - # Fencing action delay is recommended. Default: 0 - # Production pcmk_delay_max is recommended 30-60 - pcmk_delay_max: 15 - tag: pacemaker # tag instance with pacemaker: {{ ansible_hostname }} - # profile: default # Additional tag to use awscli config + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 30 + - name: tag + value: "pacemaker" # tag instance with pacemaker: {{ ansible_hostname }} + # Use AWS config profile if AWS credentials are used. + # - name: profile + # value: cluster + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 + - action: stop + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 + - action: monitor + attrs: + - name: interval + value: 120 + - name: timeout + value: 60 # Select __sap_ha_pacemaker_cluster_stonith_default -# SUSE does not support stonith:fence_aws __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.external_ec2 if ansible_os_family == 'Suse' - else __sap_ha_pacemaker_cluster_stonith_default_dict.fence_aws }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict[ansible_os_family | lower ~ '_hana'] + if sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 + else __sap_ha_pacemaker_cluster_stonith_default_dict[ansible_os_family | lower ~ '_nwas'] }}" # Default corosync options - Platform specific diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 0cd87d213..a693cfa6a 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -16,16 +16,46 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +# Documentation sources: +# HANA: +# SLES: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#set_up_fencing +# RHEL: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-rhel#set_up_fencing +# NWAS: +# SLES: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-sles#set_up_fencing +# RHEL: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-rhel#set_up_fencing +# NOTE: fence_gce parameters are identical across all listed documents. + __sap_ha_pacemaker_cluster_stonith_default_dict: fence_gce: - id: "rsc_fence_gce" + id: "rsc_fence_gce_{{ ansible_hostname }}" agent: "stonith:fence_gce" - options: - project: "{{ sap_ha_pacemaker_cluster_gcp_project }}" - zone: "{{ sap_ha_pacemaker_cluster_gcp_region_zone }}" - pcmk_reboot_timeout: 300 - pcmk_monitor_retries: 4 - pcmk_delay_max: 30 + instance_attrs: + - attrs: + - name: port + value: "{{ ansible_hostname }}" + - name: project + value: "{{ sap_ha_pacemaker_cluster_gcp_project }}" + - name: zone + value: "{{ sap_ha_pacemaker_cluster_gcp_region_zone }}" + - name: pcmk_delay_max + value: 30 + - name: pcmk_monitor_retries + value: 4 + - name: pcmk_reboot_timeout + value: 300 + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 60 + - action: monitor + attrs: + - name: interval + value: 300 + - name: timeout + value: 120 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index 40afc5f2c..625b37097 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -20,29 +20,39 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: fence_ibm_powervs: id: "rsc_fence_ibm_powervs" agent: "stonith:fence_ibm_powervs" - options: - token: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" - region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" - crn: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn }}" + instance_attrs: + - attrs: + - name: token + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" + - name: region + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" + - name: crn + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn }}" - # Identified during execution initial tasks, populated when variables are imported - instance: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" + # Identified during execution initial tasks, populated when variables are imported + - name: instance + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_guid }}" - # Identified during execution initial tasks, populated when variables are imported. - # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported - # plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }}" + # Identified during execution initial tasks, populated when variables are imported. + # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported + # plug: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_instance_id }}" - # Dependent on network interface attachments, if no public network interface - # then 'private' value must be provided. - api-type: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" + # Dependent on network interface attachments, if no public network interface + # then 'private' value must be provided. + - name: api-type + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" - # Dependent on network interface attachments, if no public network interface - # then a valid HTTP Proxy URL value must be provided. - proxy: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" + # Dependent on network interface attachments, if no public network interface + # then a valid HTTP Proxy URL value must be provided. + - name: proxy + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" - pcmk_reboot_timeout: 600 - pcmk_monitor_timeout: 600 - pcmk_status_timeout: 60 + - name: pcmk_reboot_timeout + value: 600 + - name: pcmk_monitor_timeout + value: 600 + - name: pcmk_status_timeout + value: 60 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index d54a1f7ed..a5bc30cb2 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -20,10 +20,14 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: fence_ibm_vpc: id: "rsc_fence_ibm_vpc" agent: "stonith:fence_ibm_vpc" - options: - apikey: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" - region: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" - pcmk_monitor_timeout: 600 + instance_attrs: + - attrs: + - name: apikey + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" + - name: region + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" + - name: pcmk_monitor_timeout + value: 600 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index fb3279134..e65f35c15 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -19,18 +19,79 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom +# Documentation sources: +# HANA: +# SLES: https://learn.microsoft.com/en-us/azure/sap/workloads/high-availability-guide-suse-pacemaker?tabs=msi#create-a-fencing-device-on-the-pacemaker-cluster +# RHEL: https://learn.microsoft.com/en-us/azure/sap/workloads/high-availability-guide-rhel-pacemaker?tabs=msi#azure-fence-agent-as-fencing-device +# NWAS: +# NOTE: There is no separate documentation for NWAS stonith setup. + __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_azure_arm: + redhat: + id: "rsc_fence_azure_arm" + agent: "stonith:fence_azure_arm" + instance_attrs: + - attrs: + - name: msi + value: true + - name: subscriptionId + value: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" + - name: resourceGroup + value: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + - name: pcmk_action_limit + value: 3 + - name: pcmk_delay_max + value: 15 + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" + - name: pcmk_monitor_retries + value: 4 + - name: pcmk_monitor_timeout + value: 120 + - name: pcmk_reboot_timeout + value: 900 + - name: power_timeout + value: 240 + operations: + - action: monitor + attrs: + - name: interval + value: 3600 + + suse: id: "rsc_fence_azure_arm" agent: "stonith:fence_azure_arm" - options: - msi: true - subscriptionId: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" - resourceGroup: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + instance_attrs: + - attrs: + - name: msi + value: true + - name: subscriptionId + value: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" + - name: resourceGroup + value: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + - name: pcmk_action_limit + value: 3 + - name: pcmk_delay_max + value: 15 + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" + - name: pcmk_monitor_retries + value: 4 + - name: pcmk_reboot_timeout + value: 900 + - name: power_timeout + value: 240 + operations: + - action: monitor + attrs: + - name: interval + value: 3600 + - name: timeout + value: 120 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_azure_arm }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict[ansible_os_family | lower] }}" # Default corosync options - Platform specific diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index 0e14079fa..825651093 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -20,23 +20,35 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: fence_lpar: id: "rsc_fence_lpar" agent: "stonith:fence_lpar" - options: - ip: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host }}" - ipport: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_port }}" - username: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login }}" - password: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password }}" - hmc_version: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | default('4') }}" - managed: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_host_mtms }}" - # Identified during execution initial tasks, populated when variables are imported - - # plug: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_partition_name }}" - # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported - - pcmk_reboot_retries: 4 - pcmk_reboot_timeout: 600 - pcmk_monitor_timeout: 600 - pcmk_status_timeout: 60 - power_timeout: 240 + instance_attrs: + - attrs: + - name: ip + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host }}" + - name: ipport + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_port }}" + - name: username + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login }}" + - name: password + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password }}" + - name: hmc_version + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | default('4') }}" + - name: managed + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_host_mtms }}" + + # Identified during execution initial tasks, populated when variables are imported + + # plug: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_partition_name }}" + # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported + - name: pcmk_reboot_retries + value: 4 + - name: pcmk_reboot_timeout + value: 600 + - name: pcmk_monitor_timeout + value: 600 + - name: pcmk_status_timeout + value: 60 + - name: power_timeout + value: 240 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: From ccfcebac01f7f6cafe2c96c3f8fa41a59129ce0e Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 2 Aug 2024 12:37:12 +0200 Subject: [PATCH 112/210] feat: pcmk_host_map, ha_cluster structure - separated pcmk_host_map into platform variables, except GCP - Added support for Tech Debt stonith_custom dictionary --- roles/sap_ha_pacemaker_cluster/README.md | 60 +++++++++++++++---- .../meta/argument_specs.yml | 25 ++++++-- .../tasks/construct_vars_stonith.yml | 48 ++++++++++----- .../vars/platform_cloud_aws_ec2_vs.yml | 2 + .../vars/platform_cloud_gcp_ce_vm.yml | 8 ++- .../vars/platform_cloud_ibmcloud_powervs.yml | 7 ++- .../vars/platform_cloud_ibmcloud_vs.yml | 8 ++- .../vars/platform_cloud_msazure_vm.yml | 12 ++-- .../vars/platform_hyp_ibmpower_vm.yml | 7 ++- 9 files changed, 133 insertions(+), 44 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index b96e4a0d4..a355941a0 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -881,9 +881,11 @@ sap_ha_pacemaker_cluster_sbd_devices: sap_ha_pacemaker_cluster_sbd_enabled: true sap_ha_pacemaker_cluster_stonith_custom: - agent: stonith:external/sbd - name: rsc_stonith_sbd - options: - pcmk_delay_max: 15 + id: stonith_sbd + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 15 ``` ### sap_ha_pacemaker_cluster_sbd_options @@ -891,7 +893,7 @@ sap_ha_pacemaker_cluster_stonith_custom: - _Type:_ `list` Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list SBD specific options that are added into SBD configuration file.
+Provide list of SBD specific options that are added into SBD configuration file.
Example: @@ -904,6 +906,7 @@ sap_ha_pacemaker_cluster_sbd_options: ### sap_ha_pacemaker_cluster_sbd_watchdog - _Type:_ `str` +- _Default:_ `/dev/watchdog` Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide watchdog name to override default /dev/watchdog
@@ -915,32 +918,65 @@ Provide watchdog name to override default /dev/watchdog
Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
+Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_watchdog_modules: +- softdog +``` + ### sap_ha_pacemaker_cluster_stonith_custom - _Type:_ `list` Custom list of STONITH resource(s) to be configured in the cluster.
This definition override any defaults the role would apply otherwise.
+Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
- **agent**
Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. +- **id**
+ Parameter `id` is required.
Name that will be used as the resource ID (name). +- **instance_attrs**
+ Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. +- **meta_attrs**
+ Defines meta attributes as list of name/value pairs. - **name**
- Name that will be used as the resource ID (name). + WARNING! This option will be removed in future release. +- **operations**
+ Defines list of resource agent operations. - **options**
- The resource options listed in dictionary format, one option per line.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. + WARNING! This option will be removed in future release. Example: ```yaml sap_ha_pacemaker_cluster_stonith_custom: - agent: stonith:fence_rhevm + instance_attrs: + - attrs: + - name: ip + value: rhevm-server + - name: username + value: login-user + - name: password + value: login-user-password + - name: pcmk_host_list + value: node1,node2 + - name: power_wait + value: 3 + meta_attrs: + - attrs: + - name: target-role + value: Started name: my-fence-resource - options: - ip: rhevm-server - password: login-user-password - pcmk_host_list: node1,node2 - power_wait: 3 - username: login-user + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 ``` ### sap_ha_pacemaker_cluster_storage_definition diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 1b5386ffe..9781d3adb 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -164,34 +164,49 @@ argument_specs: elements: dict options: id: + type: str description: + - Parameter `id` is required. - Name that will be used as the resource ID (name). - required: true + # TODO: Enable to remove Tech debt after name and options are removed! + # required: true agent: + type: str description: - Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. required: true - instance_attrs.attrs: + instance_attrs: + type: list description: - Defines resource agent params as list of name/value pairs. - Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail. - "Example: stonith:fence_sbd agent requires devices option with list of SBD disks." - "Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`." - required: true operations: + type: list description: - Defines list of resource agent operations. action: description: - Name of resource agent operation. - required: true attrs: description: - Defines operation parameters as list of name/value pairs. - meta_attrs.attrs: + meta_attrs: + type: list description: - Defines meta attributes as list of name/value pairs. + # TODO: Tech Debt: Remove name and options in next release + name: + type: str + description: + - WARNING! This option will be removed in future release. + # TODO: Tech Debt: Remove name and options in next release + options: + type: dict + description: + - WARNING! This option will be removed in future release. example: sap_ha_pacemaker_cluster_stonith_custom: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index 682ec8395..daf3c7217 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -91,12 +91,6 @@ # Prepare default stonith method based on __sap_ha_pacemaker_cluster_stonith_default loaded # from platform __sap_ha_pacemaker_cluster_stonith_default_dict dictionary. -# Resulting primitive stonith resource is combination of: -# 1. platform specific default: id, agent and options -# 2. pcmk_host_map: string of hosts assembled in include_vars_platform - -# Note: the 'ha_cluster' LSR only calls the stonith creation for ONE host -# -> the definition must contain the resources for all hosts, if multiple - name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resource definition from platform default" when: @@ -212,24 +206,30 @@ # sap_ha_pacemaker_cluster_stonith_custom input was redesigned to use ha_cluster structure. # Following task will remain until next release to ensure compatibility with previous structure. -- name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition" + +# TODO: Remove Tech debt task in future release, once options and name are no longer supported. +- name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition - Legacy" when: - sap_ha_pacemaker_cluster_stonith_custom is defined - and sap_ha_pacemaker_cluster_stonith_custom | length > 0 - and sap_ha_pacemaker_cluster_stonith_custom is iterable - and sap_ha_pacemaker_cluster_stonith_custom is not string + and sap_ha_pacemaker_cluster_stonith_custom | length > 0 + and sap_ha_pacemaker_cluster_stonith_custom is iterable + and sap_ha_pacemaker_cluster_stonith_custom is not string + # Tech Debt: Execute only if name and options are provided, previously required parameters. + - stonith_item.name is defined and stonith_item.name | length > 0 + and stonith_item.options is defined and stonith_item.options | length > 0 + # Keep following conditional after removing Tech Debt - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([]) | map(attribute='id')) ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [__stonith_resource_element] }}" vars: __stonith_resource_element: # Ensure that resource name conforms with naming convention rsc_ - id: "{{ item.name if item.name.startswith('rsc_') else 'rsc_' ~ item.name }}" # "rsc_{{ item.name }}" - agent: "{{ item.agent }}" + id: "{{ stonith_item.name if stonith_item.name.startswith('rsc_') else 'rsc_' ~ stonith_item.name }}" # "rsc_{{ stonith_item.name }}" + agent: "{{ stonith_item.agent }}" instance_attrs: - attrs: |- {% set attrs = [] -%} - {%- for option in (item.options | dict2items) -%} + {%- for option in (stonith_item.options | dict2items) -%} {% set aopts = attrs.extend([ { 'name': option.key, @@ -240,7 +240,25 @@ {{ attrs }} loop: "{{ sap_ha_pacemaker_cluster_stonith_custom }}" loop_control: - label: "{{ item.name }}" + label: "{{ stonith_item.name if stonith_item.name is defined else stonith_item.id }}" + loop_var: stonith_item + + +- name: "SAP HA Prepare Pacemaker - (STONITH) Assemble the resources from custom definition" + when: + - sap_ha_pacemaker_cluster_stonith_custom is defined + and sap_ha_pacemaker_cluster_stonith_custom | length > 0 + and sap_ha_pacemaker_cluster_stonith_custom is iterable + and sap_ha_pacemaker_cluster_stonith_custom is not string + - stonith_item.id is defined and stonith_item.id | length > 0 + - stonith_item.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([]) | map(attribute='id')) + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_stonith_resource: + "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [stonith_item] }}" + loop: "{{ sap_ha_pacemaker_cluster_stonith_custom }}" + loop_control: + label: "{{ stonith_item.name if stonith_item.name is defined else stonith_item.id }}" + loop_var: stonith_item # The STONITH resource is an element in the cluster_resource_primitives list @@ -254,4 +272,4 @@ + (__sap_ha_pacemaker_cluster_stonith_resource | from_yaml) }} - no_log: true # stonith resources usually contain secrets + no_log: true # stonith resources can contain secrets diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index 0ede390fa..aa040891c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -31,6 +31,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: agent: "stonith:fence_aws" instance_attrs: - attrs: + # String of cluster hosts defined in include_vars_platform - name: pcmk_host_map value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_delay_max @@ -69,6 +70,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: agent: "stonith:fence_aws" instance_attrs: - attrs: + # String of cluster hosts defined in include_vars_platform - name: pcmk_host_map value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_delay_max diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index a693cfa6a..9fb4c18f3 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -26,13 +26,17 @@ __sap_ha_pacemaker_cluster_repos: # NOTE: fence_gce parameters are identical across all listed documents. __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_gce: + generic: + # fence_gce agent is created for every host in cluster id: "rsc_fence_gce_{{ ansible_hostname }}" agent: "stonith:fence_gce" instance_attrs: - attrs: + # GCP does not use pcmk_host_map, instead it specifies port + # fence_gce supports plug parameter, but all documentations mention only port. - name: port value: "{{ ansible_hostname }}" + - name: project value: "{{ sap_ha_pacemaker_cluster_gcp_project }}" - name: zone @@ -59,7 +63,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_gce }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" # GCP needs haproxy and ports defined diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index 625b37097..ce9fdb30d 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -17,7 +17,7 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_ibm_powervs: + generic: id: "rsc_fence_ibm_powervs" agent: "stonith:fence_ibm_powervs" instance_attrs: @@ -47,6 +47,9 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: - name: proxy value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" + # String of cluster hosts defined in include_vars_platform + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_reboot_timeout value: 600 - name: pcmk_monitor_timeout @@ -56,7 +59,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_ibm_powervs }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index a5bc30cb2..33f604170 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -17,7 +17,7 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_ibm_vpc: + generic: id: "rsc_fence_ibm_vpc" agent: "stonith:fence_ibm_vpc" instance_attrs: @@ -26,12 +26,16 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: value: "{{ sap_ha_pacemaker_cluster_ibmcloud_api_key }}" - name: region value: "{{ sap_ha_pacemaker_cluster_ibmcloud_region }}" + + # String of cluster hosts defined in include_vars_platform + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_monitor_timeout value: 600 # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_ibm_vpc }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index e65f35c15..8a17d6621 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -38,12 +38,14 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: value: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" - name: resourceGroup value: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + + # String of cluster hosts defined in include_vars_platform + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_action_limit value: 3 - name: pcmk_delay_max value: 15 - - name: pcmk_host_map - value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_monitor_retries value: 4 - name: pcmk_monitor_timeout @@ -69,12 +71,14 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: value: "{{ sap_ha_pacemaker_cluster_msazure_subscription_id }}" - name: resourceGroup value: "{{ sap_ha_pacemaker_cluster_msazure_resource_group }}" + + # String of cluster hosts defined in include_vars_platform + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_action_limit value: 3 - name: pcmk_delay_max value: 15 - - name: pcmk_host_map - value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_monitor_retries value: 4 - name: pcmk_reboot_timeout diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index 825651093..5574bcc26 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -17,7 +17,7 @@ __sap_ha_pacemaker_cluster_repos: # Stonith dictionary for default stonith agents. # Custom stonith resource can be defined using sap_ha_pacemaker_cluster_stonith_custom __sap_ha_pacemaker_cluster_stonith_default_dict: - fence_lpar: + generic: id: "rsc_fence_lpar" agent: "stonith:fence_lpar" instance_attrs: @@ -39,6 +39,9 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: # plug: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_partition_name }}" # Unnecessary when using pcmk_host_map. Identified during execution initial tasks, populated when variables are imported + # String of cluster hosts defined in include_vars_platform + - name: pcmk_host_map + value: "{{ __sap_ha_pacemaker_cluster_pcmk_host_map }}" - name: pcmk_reboot_retries value: 4 - name: pcmk_reboot_timeout @@ -52,7 +55,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: # Select __sap_ha_pacemaker_cluster_stonith_default __sap_ha_pacemaker_cluster_stonith_default: - "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.fence_lpar }}" + "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" # Platform specific VIP handling From d47474a4cc4f62ce8eb05963136765fa442290af Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 2 Aug 2024 16:27:41 +0200 Subject: [PATCH 113/210] docs: updated readme for aws --- roles/sap_ha_pacemaker_cluster/README.md | 14 ++++++++++---- .../meta/argument_specs.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index a355941a0..de8c02791 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -146,14 +146,18 @@ Additional minimum requirements depend on the type of cluster setup and on the t - _Type:_ `string` AWS access key to allow control of instances (for example for fencing operations).
-Mandatory for the cluster nodes setup on AWS EC2 instances.
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
### sap_ha_pacemaker_cluster_aws_credentials_setup - _Type:_ `string` Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
-Required: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
+Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
### sap_ha_pacemaker_cluster_aws_region @@ -167,7 +171,9 @@ Mandatory for cluster nodes setup on AWS EC2 instances.
- _Type:_ `string` AWS secret key, paired with the access key for instance control.
-Mandatory for the cluster setup on AWS EC2 instances.
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
### sap_ha_pacemaker_cluster_aws_vip_update_rt @@ -953,6 +959,7 @@ Example: ```yaml sap_ha_pacemaker_cluster_stonith_custom: - agent: stonith:fence_rhevm + id: my-fence-resource instance_attrs: - attrs: - name: ip @@ -969,7 +976,6 @@ sap_ha_pacemaker_cluster_stonith_custom: - attrs: - name: target-role value: Started - name: my-fence-resource operations: - action: start attrs: diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 9781d3adb..365675987 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -210,7 +210,7 @@ argument_specs: example: sap_ha_pacemaker_cluster_stonith_custom: - - name: "my-fence-resource" + - id: "my-fence-resource" agent: "stonith:fence_rhevm" instance_attrs: - attrs: @@ -892,17 +892,23 @@ argument_specs: sap_ha_pacemaker_cluster_aws_access_key_id: description: - AWS access key to allow control of instances (for example for fencing operations). - - Mandatory for the cluster nodes setup on AWS EC2 instances. + - "Mandatory for the cluster nodes setup on AWS EC2 instances, when:" + - "1. IAM Role or Instance profile is not attached to EC2 instance." + - "2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`" sap_ha_pacemaker_cluster_aws_secret_access_key: description: - AWS secret key, paired with the access key for instance control. - - Mandatory for the cluster setup on AWS EC2 instances. + - "Mandatory for the cluster nodes setup on AWS EC2 instances, when:" + - "1. IAM Role or Instance profile is not attached to EC2 instance." + - "2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`" sap_ha_pacemaker_cluster_aws_credentials_setup: description: - Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials. - - "Required: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`" + - "Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`" + - "Mandatory for the cluster nodes setup on AWS EC2 instances, when:" + - "1. IAM Role or Instance profile is not attached to EC2 instance." ########################################################################## # Platforms: GCP specific parameters From a2cae14f9d66e294598031769a3e573b6e3d175b Mon Sep 17 00:00:00 2001 From: Wabri <12409541+Wabri@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:12:03 +0200 Subject: [PATCH 114/210] feat(requirements): update requirements with ansible 9.5.1 --- docs/README.md | 6 +++--- requirements-workflow.txt | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/README.md b/docs/README.md index 040360fcd..b71bedb27 100644 --- a/docs/README.md +++ b/docs/README.md @@ -90,13 +90,13 @@ N.B. The Ansible Collection works with SLES from version 15 SP3 and upwards, for ### Execution/Controller host - Operating System requirements Execution of Ansible Playbooks using this Ansible Collection have been tested with: -- Python 3.9.7 and above (i.e. CPython distribution) -- Ansible Core 2.12.0 and above _(included with optional installation of Ansible Community Edition 5.0 and above)_ +- Python 3.10.14 and above (i.e. CPython distribution) +- Ansible Core 2.16.9 and above _(included with optional installation of Ansible Community Edition 5.0 and above)_ - OS: macOS with Homebrew, RHEL, SLES, and containers in Task Runners (e.g. Azure DevOps) #### Ansible Core version -This Ansible Collection was designed for maximum backwards compatibility, with full compatibility starting from Ansible Core 2.12.0 and above. +This Ansible Collection was designed for maximum backwards compatibility, with full compatibility starting from Ansible Core 2.16.9 and above. **Note 1:** Ansible 2.9 was the last release before the Ansible project was split into Ansible Core and Ansible Community Edition, and was before Ansible Collections functionality was introduced. This Ansible Collection should execute when Ansible 2.9 is used, but it is not recommended and errors should be expected (and will not be resolved). diff --git a/requirements-workflow.txt b/requirements-workflow.txt index b3d9256a4..559499b7c 100644 --- a/requirements-workflow.txt +++ b/requirements-workflow.txt @@ -1,4 +1,4 @@ -ansible==9.1.0 -ansible-compat==4.1.10 -ansible-core==2.16.2 -ansible-lint==6.22.1 +ansible==9.5.1 +ansible-compat==24.7.0 +ansible-core==2.16.9 +ansible-lint==24.7.0 From 43865994b74ac1e23c5b6e6c6f9432a9192bcbc3 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 2 Aug 2024 22:16:49 +0200 Subject: [PATCH 115/210] sap_swpm: No longer use different execution modes Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 72 +++----- roles/sap_swpm/defaults/main.yml | 22 ++- roles/sap_swpm/tasks/main.yml | 2 + roles/sap_swpm/tasks/pre_install.yml | 60 +++++-- .../tasks/pre_install/install_type.yml | 5 +- .../tasks/pre_install/password_facts.yml | 22 --- roles/sap_swpm/tasks/swpm.yml | 24 +-- .../sap_swpm/tasks/swpm/detect_variables.yml | 12 +- .../tasks/swpm/swpm_inifile_generate.yml | 163 ++++++++++++++++++ .../swpm/swpm_inifile_generate_advanced.yml | 35 ---- ...pm_inifile_generate_advanced_templates.yml | 64 ------- .../swpm/swpm_inifile_generate_default.yml | 31 ---- ...wpm_inifile_generate_default_templates.yml | 51 ------ .../sap_swpm/tasks/swpm/swpm_pre_install.yml | 46 +++-- .../{configfile.j2 => inifile_params.j2} | 126 +++++++------- 15 files changed, 366 insertions(+), 369 deletions(-) delete mode 100644 roles/sap_swpm/tasks/pre_install/password_facts.yml create mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml delete mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml delete mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml delete mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml delete mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml rename roles/sap_swpm/templates/{configfile.j2 => inifile_params.j2} (90%) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index f8a16e789..f9e03a94b 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -157,66 +157,42 @@ Sample Ansible Playbook Execution - Apply firewall rules for SAP HANA (optional - no by default) -- Process SAP SWPM `inifile.params` based on inputs +- At this stage, a sapinst inifile is created by the role on the control node if not already present. -### SAP SWPM + - If a file `inifile.params` is located on the managed node in the directory specified in `sap_swpm_inifile_directory`, + the role will not create a new one but rather download this file to the control node. -- Execute SWPM + - If such a file does not exist, the role will create an SAP SWPM `inifile.params` file by one of the following methods: -### Post-Install + Method 1: Predefined sections of the file inifile_params.j2 will be used to create the file `inifile.params`. + The variable `sap_swpm_inifile_sections_list` determines which sections will be used. All other sections will be ignored. + The inifile parameters themselves will be set according to other role parameters. + Example: The inifile parameter `archives.downloadBasket` will be set to the content of the role parameter + `sap_swpm_software_path` -- Set expiry of Unix created users to 'never' + Method 2: The file `inifile.params` will be configured from the content of the dictionary `sap_swpm_inifile_parameters_dict`. + This dictionary is defined like in the following example: -- Apply firewall rules for SAP NW (optional - no by default) +``` +sap_swpm_inifile_parameters_dict: + archives.downloadBasket: /software/download_basket + NW_getFQDN.FQDN: poc.cloud +``` + It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: + Just define both of the related parameters, `sap_swpm_inifile_sections_list` and `sap_swpm_inifile_parameters_dict`. -## Execution Modes +- The file inifile.params is then transferred to a temporary directory on the control node, to be used by the sapinst process. -Every SAP Software installation via SAP Software Provisioning Manager (SWPM) is possible, there are different Ansible Role execution modes available: +### SAP SWPM -- Default (`sap_swpm_templates_product_input: default`), run software install tasks using easy Ansible Variable to generate SWPM Unattended installations - - Default Templates (`sap_swpm_templates_product_input: default_templates`), optional use of templating definitions for repeated installations -- Advanced (`sap_swpm_templates_product_input: advanced`), run software install tasks with Ansible Variables one-to-one matched to SWPM Unattended Inifile parameters to generate bespoke SWPM Unattended installations - - Advanced Templates (`sap_swpm_templates_product_input: advanced_templates`), optional use of templating definitions for repeated installations -- Inifile Reuse (`sap_swpm_templates_product_input: inifile_reuse`), run previously-defined installations with an existing SWPM Unattended inifile.params +- Execute SWPM. This and the remaining steps can be skipped by setting the default of the parameter `sap_swpm_run_sapinst` to `false`. -### Default Templates mode variables +### Post-Install -Example using all inifile list parameters with the Default Templates mode to install SAP ECC EhP8 on IBM Db2: +- Set expiry of Unix created users to 'never' -``` -sap_swpm_ansible_role_mode: default_templates -sap_swpm_templates_product_input: default_templates - -sap_swpm_templates_install_dictionary: - - template_name_ecc_ehp8_ibmdb2: - - sap_swpm_product_catalog_id: NW_ABAP_OneHost:BS2016.ERP608.DB6.PD - sap_swpm_inifile_dictionary: - sap_swpm_sid: - ... - sap_swpm_inifile_list: - - swpm_installation_media - - swpm_installation_media_swpm1 - - swpm_installation_media_swpm1_exportfiles - - swpm_installation_media_swpm1_ibmdb2 - - sum_config - - credentials - - credentials_anydb_ibmdb2 - - db_config_anydb_all - - db_config_anydb_ibmdb2 - - db_connection_nw_anydb_ibmdb2 - - nw_config_anydb - - nw_config_other - - nw_config_central_services_abap - # - nw_config_central_services_java - - nw_config_primary_application_server_instance - - nw_config_ports - - nw_config_host_agent - # - nw_config_post_abap_reports - - sap_os_linux_user -``` +- Apply firewall rules for SAP NW (optional - no by default) ## Tags diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index 5ab134ff8..9977972ec 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -5,7 +5,8 @@ # SWPM Ansible Role variables ######################################## -sap_swpm_ansible_role_mode: "default" +# We do not use role modes any more: +# sap_swpm_ansible_role_mode: "default" # default # default_templates # advanced @@ -45,22 +46,21 @@ sap_swpm_files_non_sapcar_group: root ######################################## # SWPM Ansible Role variables -# for Inifile Reuse, Advanced, and Defaults/Advanced Templates Mode +# for creating the sapinst inifile ######################################## +# Have the role run the sapinst command with an existing inifile or after creating the inifile: +sap_swpm_run_sapinst: true + # Inifile Reuse Mode sap_swpm_inifile_reuse_source: sap_swpm_inifile_reuse_destination: -# Advanced Mode -#sap_swpm_inifile_custom_values_dictionary: +#sap_swpm_inifile_parameters_dict: # archives.downloadBasket: /software/download_basket # NW_getFQDN.FQDN: poc.cloud ## add.additional.parameters: '' -# Default/Advanced Templates Mode -#sap_swpm_templates_product_input: "" - ######################################## # SWPM Ansible Role variables @@ -68,7 +68,7 @@ sap_swpm_inifile_reuse_destination: # - List of inifile parameters to generate ######################################## -sap_swpm_inifile_list: +sap_swpm_inifile_sections_list: - swpm_installation_media - swpm_installation_media_swpm2_hana # - swpm_installation_media_swpm1 @@ -156,7 +156,7 @@ sap_swpm_software_extract_directory: # e.g. /software/sap_swpm_extracted sap_swpm_software_use_media: 'false' # Main path that this role will look for .SAR files -sap_swpm_software_path: +sap_swpm_software_path: /software/sapfiles ## This directory path should include these files: ## - igs*sar ## - igshelper*sar @@ -165,6 +165,10 @@ sap_swpm_software_path: ## - IMDB_CLIENT*SAR ## - SAPHOSTAGENT*SAR +# Directory in which a sapinst inifile which is to be used by the role can be stored: +sap_swpm_inifile_directory: "{{ sap_swpm_software_path }}/inifiles" +#sap_swpm_local_inifile_directory: '/tmp/inifiles' + # SWPM1 - paths that this role will look for CD Media software sap_swpm_cd_export_pt1_path: sap_swpm_cd_export_pt2_path: diff --git a/roles/sap_swpm/tasks/main.yml b/roles/sap_swpm/tasks/main.yml index aa784ef91..a35c3967d 100644 --- a/roles/sap_swpm/tasks/main.yml +++ b/roles/sap_swpm/tasks/main.yml @@ -9,8 +9,10 @@ - name: SAP SWPM - run swpm ansible.builtin.import_tasks: swpm.yml + when: sap_swpm_run_sapinst tags: - sap_swpm_install - name: SAP SWPM - run postinstall task ansible.builtin.import_tasks: post_install.yml + when: sap_swpm_run_sapinst diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index cdafb3b0f..1f330fb3e 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -1,6 +1,12 @@ # SPDX-License-Identifier: Apache-2.0 --- +- name: SAP SWPM Pre Install - Rename variables + ansible.builtin.set_fact: + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list) }}" + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary | d(sap_swpm_inifile_parameters_dict) }}" + tags: always + ################ # Run Preinstallation Steps Based on Run Mode ################ @@ -11,23 +17,6 @@ - sap_swpm_generate_inifile - sap_swpm_sapinst_commandline -################ -# Set sapinst command -################ - -- name: SAP SWPM Pre Install - Set sapinst command - vars: - sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '' }}" - ansible.builtin.set_fact: - sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" - sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" - # If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank - # IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" - # If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}" - sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" - tags: sap_swpm_sapinst_commandline - ################ # Pre Install Optional Tasks ################ @@ -39,7 +28,9 @@ file: pre_install/firewall.yml apply: tags: sap_swpm_setup_firewall - when: "sap_swpm_setup_firewall | bool" + when: + - sap_swpm_run_sapinst + - "sap_swpm_setup_firewall | bool" tags: sap_swpm_setup_firewall # /etc/hosts @@ -49,7 +40,9 @@ file: pre_install/update_etchosts.yml apply: tags: sap_swpm_update_etchosts - when: "sap_swpm_update_etchosts | bool" + when: + - sap_swpm_run_sapinst + - "sap_swpm_update_etchosts | bool" tags: sap_swpm_update_etchosts ################ @@ -81,3 +74,32 @@ - ' The installation can take up to 3 hours. Run the following command as root' - ' on {{ ansible_hostname }} to display the installation logs:' - ' # tail -f $(cat /tmp/sapinst_instdir/.lastInstallationLocation)/sapinst.log' + +################ +# Set sapinst command +################ + +- name: SAP SWPM Pre Install - Set the sapinst command parameters + vars: + sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '' }}" + ansible.builtin.set_fact: + sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" + sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" + # If SWPM is running a normal install Ansible Variable sap_swpm_swpm_command_virtual_hostname is blank + # IF SWPM is running a HA installation, Ansible Variable sap_swpm_swpm_command_virtual_hostname is set and contains "SAPINST_USE_HOSTNAME={{ sap_swpm_virtual_hostname }} IS_HOST_LOCAL_USING_STRING_COMPARE=true" + # If SWPM is running a MP Stack XML installation, Ansible Variable sap_swpm_swpm_command_mp_stack is set and contains "SAPINST_STACK_XML={{ sap_swpm_mp_stack_path }} + '/' (if needed) + {{ sap_swpm_mp_stack_file_name }}" + sap_swpm_swpm_command_extra_args: "SAPINST_SKIP_DIALOGS=true {{ sap_swpm_swpm_command_guiserver }} {{ sap_swpm_swpm_command_observer }} {{ sap_swpm_swpm_command_virtual_hostname }} {{ sap_swpm_swpm_command_mp_stack }}" + tags: sap_swpm_sapinst_commandline + +- name: Set fact for the sapinst command line + ansible.builtin.set_fact: + __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }} + {{ sap_swpm_swpm_command_product_id }} + {{ sap_swpm_swpm_command_extra_args }}" + tags: sap_swpm_sapinst_commandline + +- name: Display the sapinst command line + ansible.builtin.debug: + msg: "SAP SWPM install command: '{{ __sap_swpm_sapinst_command }}'" + tags: sap_swpm_sapinst_commandline diff --git a/roles/sap_swpm/tasks/pre_install/install_type.yml b/roles/sap_swpm/tasks/pre_install/install_type.yml index ced5bbc98..10936a31c 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type.yml @@ -4,7 +4,7 @@ - name: SAP SWPM Pre Install - Determine Installation Type ansible.builtin.set_fact: sap_swpm_swpm_installation_type: "" - sap_swpm_swpm_installation_header: "" + sap_swpm_swpm_installation_header: "Standard installation of SAP Software" sap_swpm_swpm_command_virtual_hostname: "" sap_swpm_swpm_command_mp_stack: "" @@ -60,7 +60,8 @@ - name: SAP SWPM Pre Install - Display the Installation Type ansible.builtin.debug: - var: sap_swpm_swpm_installation_type + msg: "The Installation Type is: '{{ sap_swpm_swpm_installation_type }}'" + when: "sap_swpm_swpm_installation_type | length > 0" - name: SAP SWPM Pre Install - Run Installation Type Steps ansible.builtin.include_tasks: "install_type/{{ sap_swpm_swpm_installation_type }}_install.yml" diff --git a/roles/sap_swpm/tasks/pre_install/password_facts.yml b/roles/sap_swpm/tasks/pre_install/password_facts.yml deleted file mode 100644 index 850283d88..000000000 --- a/roles/sap_swpm/tasks/pre_install/password_facts.yml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -- name: SAP SWPM Pre Install - Set password facts when ABAP - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" - when: - - "'ABAP' in sap_swpm_product_catalog_id" - -- name: SAP SWPM Pre Install - Set password facts when Java - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" - when: - - "'Java' in sap_swpm_product_catalog_id" - -- name: SAP SWPM Pre Install - Set other user passwords using master password - ansible.builtin.set_fact: - sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" diff --git a/roles/sap_swpm/tasks/swpm.yml b/roles/sap_swpm/tasks/swpm.yml index 462587505..d9d0bd4eb 100644 --- a/roles/sap_swpm/tasks/swpm.yml +++ b/roles/sap_swpm/tasks/swpm.yml @@ -23,17 +23,19 @@ ### Async method -- name: Set fact for the sapinst command line - ansible.builtin.set_fact: - __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }} - {{ sap_swpm_swpm_command_product_id }} - {{ sap_swpm_swpm_command_extra_args }}" - tags: sap_swpm_sapinst_commandline - -- name: Display the sapinst command line - ansible.builtin.debug: - msg: "SAP SWPM install command: '{{ __sap_swpm_sapinst_command }}'" - tags: sap_swpm_sapinst_commandline +# now in file pre_install.yml: +#- name: Set fact for the sapinst command line +# ansible.builtin.set_fact: +# __sap_swpm_sapinst_command: "umask {{ sap_swpm_umask | d('022') }} ; ./sapinst {{ sap_swpm_swpm_command_inifile }} +# {{ sap_swpm_swpm_command_product_id }} +# {{ sap_swpm_swpm_command_extra_args }}" +# tags: sap_swpm_sapinst_commandline + +# now in file pre_install.yml: +#- name: Display the sapinst command line +# ansible.builtin.debug: +# msg: "SAP SWPM install command: '{{ __sap_swpm_sapinst_command }}'" +# tags: sap_swpm_sapinst_commandline # Call sapinst synchronously # Reason for noqa: This command installs software, so it will change things diff --git a/roles/sap_swpm/tasks/swpm/detect_variables.yml b/roles/sap_swpm/tasks/swpm/detect_variables.yml index 557c988ad..ce9dc4794 100644 --- a/roles/sap_swpm/tasks/swpm/detect_variables.yml +++ b/roles/sap_swpm/tasks/swpm/detect_variables.yml @@ -6,7 +6,8 @@ ansible.builtin.command: | awk 'BEGIN{IGNORECASE=1;a=0} /Product ID/&&a==0{a=1; gsub ("#", ""); gsub ("\047", ""); product_id=$NF} - END{print product_id}' {{ sap_swpm_tmpdir.path }}/inifile.params + END{print product_id}' {{ sap_swpm_tmpdir_local.path }}/inifile.params + delegate_to: localhost register: sap_swpm_inifile_product_id_detect changed_when: false when: not sap_swpm_product_catalog_id is defined @@ -25,7 +26,8 @@ # Detect Software Path - name: SAP SWPM - Detect Software Path ansible.builtin.command: | - awk '!/^#/&&/archives.downloadBasket/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params + awk '!/^#/&&/archives.downloadBasket/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params + delegate_to: localhost register: sap_swpm_inifile_software_path changed_when: false when: not sap_swpm_software_path is defined @@ -44,7 +46,8 @@ # Detect SID - name: SAP SWPM - Detect SID ansible.builtin.command: | - awk '!/^#/&&/NW_GetSidNoProfiles.sid/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params + awk '!/^#/&&/NW_GetSidNoProfiles.sid/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params + delegate_to: localhost register: sap_swpm_inifile_sid changed_when: false when: not sap_swpm_sid is defined @@ -63,7 +66,8 @@ # Detect FQDN - name: SAP SWPM - Detect FQDN ansible.builtin.command: | - awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params + awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params + delegate_to: localhost register: sap_swpm_inifile_fqdn changed_when: false when: not sap_swpm_fqdn is defined diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml new file mode 100644 index 000000000..81414b65e --- /dev/null +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml @@ -0,0 +1,163 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... +- name: SAP SWPM default mode - Determine Installation Type + ansible.builtin.include_tasks: + file: ../pre_install/install_type.yml + apply: + tags: sap_swpm_generate_inifile + tags: sap_swpm_generate_inifile + +# Password Facts +- name: SAP SWPM Pre Install - Set password facts when ABAP + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" + when: "'ABAP' in sap_swpm_product_catalog_id" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Set password facts when Java + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" + when: "'Java' in sap_swpm_product_catalog_id" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Set other user passwords using master password + ansible.builtin.set_fact: + sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists + ansible.builtin.file: + path: "{{ sap_swpm_inifile_directory }}" + state: directory + owner: 'root' + group: 'root' + mode: '0755' + +- name: SAP SWPM Pre Install - Check if file '{{ sap_swpm_inifile_directory }}/inifile.params' exists + ansible.builtin.stat: + path: "{{ sap_swpm_inifile_directory }}/inifile.params" + check_mode: no + register: __sap_swpm_register_stat_sapinst_inifile + +- name: SAP SWPM Pre Install - Notify about existing sapinst inifile + ansible.builtin.debug: + msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." + when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + +- name: SAP SWPM Pre Install - Slurp the remote 'inifile.params' for copying to managed node + ansible.builtin.slurp: + src: "{{ sap_swpm_inifile_directory }}/inifile.params" + register: sap_swpm_slurped_remote_inifile + when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + +- name: SAP SWPM Pre Install - Copy 'inifile.params' to the control node + ansible.builtin.copy: + content: "{{ sap_swpm_slurped_remote_inifile['content'] | b64decode }}" + dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + owner: 'root' + group: 'root' + mode: '0640' + delegate_to: localhost + when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + +# Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. +#- name: SAP SWPM Pre Install - Download existing sapinst inifile to '{{ sap_swpm_local_inifile_directory }}' +# ansible.builtin.fetch: +# src: "{{ sap_swpm_inifile_directory }}/inifile.params" +# dest: "{{ sap_swpm_tmpdir_local.path }}/" +## dest: "{{ sap_swpm_local_inifile_directory }}/" +# flat: true +# become: true +# when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + +#- name: SAP SWPM Pre Install - Copy sapinst inifile to '{{ sap_swpm_tmpdir_local.path }}' +# ansible.builtin.copy: +# src: "{{ sap_swpm_local_inifile_directory }}/inifile.params" +# dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" +# delegate_to: localhost +# when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + +- name: SAP SWPM Pre Install - Create the SWPM inifile 'inifile.params' dynamically + when: + - not __sap_swpm_register_stat_sapinst_inifile.stat.exists + block: + +# Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params + - name: SAP SWPM Pre Install - Process SWPM inifile template for for creating 'inifile.params' + ansible.builtin.template: + src: "{{ role_path }}/templates/inifile_params.j2" + dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + owner: 'root' + group: 'root' + mode: '0640' + delegate_to: localhost + when: + - sap_swpm_inifile_sections_list is defined + - sap_swpm_inifile_sections_list | length > 0 + tags: sap_swpm_generate_inifile + +# Generate inifile.params, step 2: Use any entries from sap_swpm_inifile_parameters_dict + - name: SAP SWPM Pre Install - Replace existing, or add missing, any inifile.params entries from sap_swpm_inifile_parameters_dict + ansible.builtin.lineinfile: + path: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + create: true + state: present + line: "{{ sap_swpm_line_item.key }} = {{ sap_swpm_line_item.value }}" + regexp: "^{{ sap_swpm_line_item.key }}[\\s]*=[\\s]*.*" + owner: 'root' + group: 'root' + mode: '0640' + loop: "{{ sap_swpm_inifile_parameters_dict | dict2items }}" + loop_control: + loop_var: sap_swpm_line_item + register: replace_result + delegate_to: localhost + when: + - sap_swpm_inifile_parameters_dict is defined + - sap_swpm_inifile_parameters_dict | length > 0 + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Display the path of the local 'inifile.params' + ansible.builtin.debug: + msg: "The local inifile.params is: '{{ sap_swpm_tmpdir_local.path }}/inifile.params'" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Detect Variables + ansible.builtin.include_tasks: + file: detect_variables.yml + apply: + tags: sap_swpm_generate_inifile + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Slurp the local 'inifile.params' for copying to managed node + ansible.builtin.slurp: + src: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + register: sap_swpm_slurped_local_inifile + delegate_to: localhost + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Copy 'inifile.params' to the managed node + ansible.builtin.copy: + content: "{{ sap_swpm_slurped_local_inifile['content'] | b64decode }}" + dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" + owner: 'root' + group: 'root' + mode: '0640' + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Display the path of the remote 'inifile.params' + ansible.builtin.debug: + msg: "The local inifile.params has been copied to: '{{ sap_swpm_tmpdir.path }}/inifile.params'" + tags: sap_swpm_generate_inifile + +# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) +# Prepare Software +- name: SAP SWPM advanced mode - Prepare Software + ansible.builtin.include_tasks: prepare_software.yml + when: sap_swpm_run_sapinst diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml deleted file mode 100644 index 234dfb5db..000000000 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced.yml +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Remove Existing inifile.params -- name: SAP SWPM advanced mode - Ensure 'inifile.params' exists - ansible.builtin.copy: - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - mode: '0640' - content: | - ### inifile.params generated for SWPM Catalog Product ID is {{ sap_swpm_product_catalog_id }} - tags: sap_swpm_generate_inifile - -- name: SAP SWPM advanced mode - Loop over the dictionary and output to file - ansible.builtin.lineinfile: - path: "{{ sap_swpm_tmpdir.path }}/inifile.params" - state: present - insertafter: EOF - line: "{{ item.key }} = {{ item.value }}" - with_dict: "{{ sap_swpm_inifile_custom_values_dictionary }}" - tags: sap_swpm_generate_inifile - -# NOTE: Values in Dictionary Keys for instance numbers must be string using '01' single quote, otherwise SAP SWPM will crash - -# Detect variables from generated inifile -- name: SAP SWPM advanced mode - Detect Variables - ansible.builtin.include_tasks: - file: detect_variables.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) -# Prepare Software -- name: SAP SWPM advanced mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml deleted file mode 100644 index b6685e343..000000000 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_advanced_templates.yml +++ /dev/null @@ -1,64 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Set facts based on the install dictionary -- name: SAP SWPM advanced_templates mode - Set product_catalog_id - ansible.builtin.set_fact: - sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM advanced_templates mode - Create temporary directory - ansible.builtin.tempfile: - state: directory - suffix: swpmconfig - register: sap_swpm_tmpdir - tags: sap_swpm_generate_inifile - -# Remove Existing inifile.params -- name: SAP SWPM advanced_templates mode - Ensure 'inifile.params' exists - ansible.builtin.copy: - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - mode: '0640' - content: | - ### inifile.params generated for SWPM Catalog Product ID is {{ sap_swpm_product_catalog_id }} - tags: sap_swpm_generate_inifile - -- name: SAP SWPM advanced_templates mode - Loop over the dictionary and output to file - ansible.builtin.lineinfile: - path: "{{ sap_swpm_tmpdir.path }}/inifile.params" - state: present - insertafter: EOF - line: "{{ item.key }} = {{ item.value }}" - with_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] }}" - tags: sap_swpm_generate_inifile - -# NOTE: Values in Dictionary Keys for instance numbers must be string using '01' single quote, otherwise SAP SWPM will crash - - -# Detect variables from generated inifile -- name: SAP SWPM advanced_templates mode - Detect Variables - ansible.builtin.include_tasks: - file: detect_variables.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) -# Prepare Software -- name: SAP SWPM advanced_templates mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml - -# ALT: Generate complete inifile.params with all parameters from control.xml, for every SAP software product -#- name: ALT: SAP SWPM advanced_templates mode - Generate complete inifile.params -# script: ./plugins/module_utils/swpm2_parameters_inifile_generate.py '/path/to/controlxml/' -# args: -# executable: /bin/python3 - -# ALT: Replace values of generated inifile with custom values -#- name: ALT: SAP SWPM advanced_templates mode - Replace values of generated inifile with custom values -# replace: -# path: "{{ sap_swpm_tmpdir.path }}/inifile.params" -# regexp: '^{{ item.key }}.*$' -# replace: '{{ item.key }}={{ item.value }}' -# backup: yes -# with_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] }}" diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml deleted file mode 100644 index b04362cb6..000000000 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default.yml +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Determine Installation Type -- name: SAP SWPM default mode - Determine Installation Type - ansible.builtin.include_tasks: - file: ../pre_install/install_type.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Password Facts -- name: SAP SWPM default mode - Password Facts - ansible.builtin.include_tasks: - file: ../pre_install/password_facts.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Prepare Software -- name: SAP SWPM default mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml - -# Process SWPM Configfile Template -- name: SAP SWPM default mode - Process SWPM Configfile Template - ansible.builtin.template: - src: "{{ role_path }}/templates/configfile.j2" - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - mode: '0640' - register: sap_swpm_cftemplate - tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml deleted file mode 100644 index b51706218..000000000 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_default_templates.yml +++ /dev/null @@ -1,51 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Set facts based on the install dictionary -- name: SAP SWPM default_templates mode - Set product_catalog_id and inifile_list - ansible.builtin.set_fact: - sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" - sap_swpm_inifile_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] }}" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM default_templates mode - Set product_catalog_id and inifile_list - ansible.builtin.set_fact: - sap_swpm_java_template_id_selected_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_java_template_id_selected_list'] }}" - when: "'java' in sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] | lower" - tags: sap_swpm_generate_inifile - -# Reason for noqa: We want to define variable names based on what is in the dictionary. -- name: SAP SWPM default_templates mode - If not already defined, use the default variable for the template # noqa var-naming[no-jinja] - ansible.builtin.set_fact: - "{{ item.key }}": "{{ item.value }}" - with_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_dictionary'] }}" - tags: sap_swpm_generate_inifile - -# Determine Installation Type -- name: SAP SWPM default_templates mode - Determine Installation Type - ansible.builtin.include_tasks: - file: ../pre_install/install_type.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Password Facts -- name: SAP SWPM default_templates mode - Password Facts - ansible.builtin.include_tasks: - file: ../pre_install/password_facts.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Prepare Software -- name: SAP SWPM default_templates mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml - -# Process SWPM Configfile Template -- name: SAP SWPM default_templates mode - Process SWPM Configfile Template - ansible.builtin.template: - src: "{{ role_path }}/templates/configfile.j2" - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - mode: '0640' - register: sap_swpm_cftemplate - tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml b/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml index 360df233f..8664f9dbd 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml @@ -1,11 +1,30 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Create temporary directory -- name: SAP SWPM Pre Install - Create temporary directory +- name: SAP SWPM Pre Install - Create temporary directory on control node ansible.builtin.tempfile: state: directory - suffix: swpmconfig + suffix: _swpm_tmp + delegate_to: localhost + register: sap_swpm_tmpdir_local + tags: + - sap_swpm_generate_inifile + - sap_swpm_sapinst_commandline + +- name: SAP SWPM Pre Install - Make the temporary directory on control node world readable + ansible.builtin.file: + path: "{{ sap_swpm_tmpdir_local.path }}" + state: directory + mode: '0777' + delegate_to: localhost + tags: + - sap_swpm_generate_inifile + - sap_swpm_sapinst_commandline + +- name: SAP SWPM Pre Install - Create temporary directory on managed node + ansible.builtin.tempfile: + state: directory + suffix: _swpm_config register: sap_swpm_tmpdir tags: - sap_swpm_generate_inifile @@ -21,21 +40,25 @@ when: sap_swpm_use_password_file == "y" tags: sap_swpm_generate_inifile -# Run SWPM inifile generation based on ansible role mode -- name: SAP SWPM Pre Install - generate swpm inifile - ansible.builtin.include_tasks: "swpm_inifile_generate_{{ sap_swpm_ansible_role_mode }}.yml" +# Create the SWPM inifile +## Run SWPM inifile generation based on ansible role mode +- name: SAP SWPM Pre Install - Generate the SWPM inifile + ansible.builtin.include_tasks: "swpm_inifile_generate.yml" +# ansible.builtin.include_tasks: "swpm_inifile_generate_{{ sap_swpm_ansible_role_mode }}.yml" tags: sap_swpm_generate_inifile -- name: SAP SWPM Pre Install - Display the location of file 'inifile.params' - ansible.builtin.debug: - msg: "{{ sap_swpm_tmpdir.path }}/inifile.params" - tags: sap_swpm_generate_inifile +#- name: SAP SWPM Pre Install - Display the location of file 'inifile.params' +# ansible.builtin.debug: +# msg: "/tmp/inifile.params" +# msg: "{{ sap_swpm_tmpdir.path }}/inifile.params" +# tags: sap_swpm_generate_inifile # Set fact for SWPM path - name: SAP SWPM Pre Install - Set fact for SWPM path when extract directory defined ansible.builtin.set_fact: sap_swpm_sapinst_path: "{{ sap_swpm_software_extract_directory }}" when: + - sap_swpm_run_sapinst - sap_swpm_software_extract_directory is defined - not (sap_swpm_software_extract_directory is none or (sap_swpm_software_extract_directory | length == 0)) @@ -44,6 +67,7 @@ ansible.builtin.set_fact: sap_swpm_sapinst_path: "{{ (sap_swpm_swpm_path | regex_replace('\\/$', '')) + '/extracted' }}" when: + - sap_swpm_run_sapinst - sap_swpm_software_extract_directory is undefined or (sap_swpm_software_extract_directory is none or (sap_swpm_software_extract_directory | length) == 0) - name: SAP SWPM Pre Install - Ensure directory '{{ sap_swpm_sapinst_path }}' exists @@ -51,6 +75,7 @@ path: "{{ sap_swpm_sapinst_path }}" state: directory mode: '0755' + when: sap_swpm_run_sapinst # Extract SWPM - name: SAP SWPM Pre Install - Extract SWPM @@ -62,3 +87,4 @@ args: chdir: "{{ sap_swpm_sapinst_path }}" changed_when: "'SAPCAR: processing archive' in sap_swpm_extractswpm.stdout" + when: sap_swpm_run_sapinst diff --git a/roles/sap_swpm/templates/configfile.j2 b/roles/sap_swpm/templates/inifile_params.j2 similarity index 90% rename from roles/sap_swpm/templates/configfile.j2 rename to roles/sap_swpm/templates/inifile_params.j2 index e71291e11..a5797e4c0 100644 --- a/roles/sap_swpm/templates/configfile.j2 +++ b/roles/sap_swpm/templates/inifile_params.j2 @@ -1,6 +1,6 @@ ### inifile.params generated for SWPM Catalog Product ID is {{ sap_swpm_product_catalog_id }} -{% if 'swpm_installation_media' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media ###### @@ -11,14 +11,14 @@ archives.downloadBasket = {{ sap_swpm_software_path }} # NOTE: Specific media requirements will use format # SAPINST.CD.PACKAGE. = {% endif %} -{% if 'swpm_installation_media_swpm2_hana' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm2_hana' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm2_hana ###### HDB_Software_Dialogs.useMediaCD = {{ sap_swpm_software_use_media }} {% endif %} -{% if 'swpm_installation_media_swpm1' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1 @@ -36,7 +36,7 @@ SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdbms_path }} # SAPINST.CD.PACKAGE.J2EE-INST = /path/JAVA_J2EE_OSINDEP_J2EE_INST # SAPINST.CD.PACKAGE.SCA = /path/JAVA_J2EE_OSINDEP_UT {% endif %} -{% if 'swpm_installation_media_swpm1_exportfiles' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_exportfiles' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_exportfiles @@ -47,7 +47,7 @@ SAPINST.CD.PACKAGE.LOAD1 = {{ sap_swpm_cd_export_pt1_path }} SAPINST.CD.PACKAGE.LOAD2 = {{ sap_swpm_cd_export_pt2_path }} # SAPINST.CD.PACKAGE.JMIG = {% endif %} -{% if 'swpm_installation_media_swpm1_ibmdb2' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_ibmdb2' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_ibmdb2 @@ -61,7 +61,7 @@ SAPINST.CD.PACKAGE.DB2CLIENT = {{ sap_swpm_cd_ibmdb2_client_path }} # IBM DB2 software unpack path e.g. /db2/db2x01/db2_software db6.DB2SoftwarePath = {{ sap_swpm_ibmdb2_unpack_path }} {% endif %} -{% if 'swpm_installation_media_swpm1_oracledb_121' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_oracledb_121' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_oracledb_121 @@ -72,7 +72,7 @@ SAPINST.CD.PACKAGE.RDBMS-ORA121 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI121 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} -{% if 'swpm_installation_media_swpm1_oracledb_122' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_oracledb_122' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_oracledb_122 @@ -83,7 +83,7 @@ SAPINST.CD.PACKAGE.RDBMS-ORA122 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI122 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} -{% if 'swpm_installation_media_swpm1_oracledb_19' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_oracledb_19' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_oracledb_19 @@ -94,7 +94,7 @@ SAPINST.CD.PACKAGE.RDBMS-ORA19 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI19 = {{ sap_swpm_cd_oracle_client_path }} {% endif %} -{% if 'swpm_installation_media_swpm1_sapase' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_sapase' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_sapase @@ -104,7 +104,7 @@ SAPINST.CD.PACKAGE.RDBMS-SYB = {{ sap_swpm_cd_sapase_path }} SAPINST.CD.PACKAGE.RDBMS-SYB-CLIENT = {{ sap_swpm_cd_sapase_client_path }} {% endif %} -{% if 'swpm_installation_media_swpm1_sapmaxdb' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_swpm1_sapmaxdb' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_swpm1_sapmaxdb @@ -112,7 +112,7 @@ SAPINST.CD.PACKAGE.RDBMS-SYB-CLIENT = {{ sap_swpm_cd_sapase_client_path }} # Requested package : RDBMS-ADA SAPINST.CD.PACKAGE.RDBMS-ADA = {{ sap_swpm_cd_sapmaxdb_path }} {% endif %} -{% if 'maintenance_plan_stack_tms_config' in sap_swpm_inifile_list %} +{% if 'maintenance_plan_stack_tms_config' in sap_swpm_inifile_sections_list %} ###### # maintenance_plan_stack_tms_config @@ -120,7 +120,7 @@ SAPINST.CD.PACKAGE.RDBMS-ADA = {{ sap_swpm_cd_sapmaxdb_path }} NW_ABAP_TMSConfig.configureTMS = {{ sap_swpm_configure_tms | lower }} NW_ABAP_TMSConfig.transportPassword = {{ sap_swpm_tmsadm_password }} {% endif %} -{% if 'maintenance_plan_stack_tms_transports' in sap_swpm_inifile_list %} +{% if 'maintenance_plan_stack_tms_transports' in sap_swpm_inifile_sections_list %} ###### # maintenance_plan_stack_tms_transports @@ -128,7 +128,7 @@ NW_ABAP_TMSConfig.transportPassword = {{ sap_swpm_tmsadm_password }} NW_ABAP_Include_Corrections.includeTransports = true NW_ABAP_Include_Corrections.transportFilesLocations = {{ sap_swpm_tms_tr_files_path }} {% endif %} -{% if 'maintenance_plan_stack_spam_config' in sap_swpm_inifile_list %} +{% if 'maintenance_plan_stack_spam_config' in sap_swpm_inifile_sections_list %} ###### # maintenance_plan_stack_spam_config @@ -140,7 +140,7 @@ NW_ABAP_SPAM_Update.SPAMUpdateArchive = {{ sap_swpm_spam_update_sar }} #NW_ABAP_SPAM_Update.SPAMUpdateArchive = {% endif %} {% endif %} -{% if 'maintenance_plan_stack_sum_config' in sap_swpm_inifile_list %} +{% if 'maintenance_plan_stack_sum_config' in sap_swpm_inifile_sections_list %} ###### # maintenance_plan_stack_sum_config @@ -151,7 +151,7 @@ NW_ABAP_Prepare_SUM.startSUM = {{ sap_swpm_sum_start | lower }} # Password for SUM must be for 'adm' user NW_ABAP_Prepare_SUM.Password = {{ sap_swpm_sap_sidadm_password }} {% endif %} -{% if 'maintenance_plan_stack_sum_10_batch_mode' in sap_swpm_inifile_list %} +{% if 'maintenance_plan_stack_sum_10_batch_mode' in sap_swpm_inifile_sections_list %} ###### # maintenance_plan_stack_sum_10_batch_mode @@ -159,7 +159,7 @@ NW_ABAP_Prepare_SUM.Password = {{ sap_swpm_sap_sidadm_password }} # Re-run of existing BatchModeInputFile.xml for NWAS JAVA (generated by SUM 1.0 on previous host into the /sdt/param/ subdirectory) NW_ABAP_Prepare_SUM.SUMBatchFile = {{ sap_swpm_sum_batch_file }} {% endif %} -{% if 'credentials' in sap_swpm_inifile_list %} +{% if 'credentials' in sap_swpm_inifile_sections_list %} ###### # credentials @@ -175,7 +175,7 @@ DiagnosticsAgent.dasidAdmPassword = {{ sap_swpm_diagnostics_agent_password }} # 'sapadm' user of the SAP Host Agent hostAgent.sapAdmPassword = {{ sap_swpm_sapadm_password }} {% endif %} -{% if 'credentials_hana' in sap_swpm_inifile_list %} +{% if 'credentials_hana' in sap_swpm_inifile_sections_list %} ###### # credentials_hana @@ -183,7 +183,7 @@ hostAgent.sapAdmPassword = {{ sap_swpm_sapadm_password }} HDB_Schema_Check_Dialogs.schemaPassword = {{ sap_swpm_db_schema_password }} storageBasedCopy.hdb.systemPassword = {{ sap_swpm_db_system_password }} {% endif %} -{% if 'credentials_anydb_ibmdb2' in sap_swpm_inifile_list %} +{% if 'credentials_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} ###### # credentials_anydb_ibmdb2 @@ -191,7 +191,7 @@ storageBasedCopy.hdb.systemPassword = {{ sap_swpm_db_system_password }} nwUsers.db6.db2sidPassword = {{ sap_swpm_sap_sidadm_password }} # nwUsers.db6.db2sidUid = {% endif %} -{% if 'credentials_anydb_oracledb' in sap_swpm_inifile_list %} +{% if 'credentials_anydb_oracledb' in sap_swpm_inifile_sections_list %} ###### # credentials_anydb_oracledb @@ -208,7 +208,7 @@ ora.SysPassword = {{ sap_swpm_db_system_password }} # Oracle 'SYSTEM' password ora.SystemPassword = {{ sap_swpm_db_system_password }} {% endif %} -{% if 'credentials_anydb_sapase' in sap_swpm_inifile_list %} +{% if 'credentials_anydb_sapase' in sap_swpm_inifile_sections_list %} ###### # credentials_anydb_sapase @@ -222,7 +222,7 @@ SYB.NW_DB.sapsr3db_pass = {{ sap_swpm_db_system_password }} # SYB.NW_DB.sapsso_pass = # SYB.NW_DB.sslPassword = {% endif %} -{% if 'credentials_anydb_sapmaxdb' in sap_swpm_inifile_list %} +{% if 'credentials_anydb_sapmaxdb' in sap_swpm_inifile_sections_list %} ###### # credentials_anydb_sapmaxdb @@ -234,7 +234,7 @@ Sdb_DBUser.dbaPassword = {{ sap_swpm_db_system_password }} Sdb_DBUser.dbmPassword = {{ sap_swpm_db_system_password }} Sdb_Schema_Dialogs.dbSchemaPassword = {{ sap_swpm_db_schema_password }} {% endif %} -{% if 'credentials_nwas_ssfs' in sap_swpm_inifile_list %} +{% if 'credentials_nwas_ssfs' in sap_swpm_inifile_sections_list %} ###### # credentials_nwas_ssfs @@ -242,7 +242,7 @@ Sdb_Schema_Dialogs.dbSchemaPassword = {{ sap_swpm_db_schema_password }} HDB_Userstore.useABAPSSFS = true # NW_ABAP_SSFS_CustomKey.ssfsKeyInputFile = {% endif %} -{% if 'credentials_hdbuserstore' in sap_swpm_inifile_list %} +{% if 'credentials_hdbuserstore' in sap_swpm_inifile_sections_list %} ###### # credentials_hdbuserstore @@ -254,7 +254,7 @@ HDB_Userstore.useABAPSSFS = false # NW_HDB_DBClient.checkCreateUserstore = true # NW_HDB_DBClient.clientPathStrategy = LOCAL {% endif %} -{% if 'credentials_syscopy' in sap_swpm_inifile_list %} +{% if 'credentials_syscopy' in sap_swpm_inifile_sections_list %} ###### # credentials_syscopy @@ -264,14 +264,14 @@ NW_DDIC_Password.needDDICPasswords = true NW_DDIC_Password.ddic000Password = {{ sap_swpm_ddic_000_password }} #NW_DDIC_Password.ddic001Password = {% endif %} -{% if 'db_config_hana' in sap_swpm_inifile_list %} +{% if 'db_config_hana' in sap_swpm_inifile_sections_list %} ###### # db_config_hana ###### storageBasedCopy.hdb.instanceNumber = {{ sap_swpm_db_instance_nr }} HDB_Schema_Check_Dialogs.schemaName = {{ sap_swpm_db_schema }} -{% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_list %} +{% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_sections_list %} HDB_Schema_Check_Dialogs.validateSchemaName = true {% else %} @@ -281,14 +281,14 @@ HDB_Schema_Check_Dialogs.validateSchemaName = false # HDB_Schema_Check_Dialogs.dropSchema = false # hdb.create.dbacockpit.user = false {% endif %} -{% if 'db_config_anydb_all' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_all' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_all ###### NW_ABAP_Import_Dialog.dbCodepage = 4103 {% endif %} -{% if 'db_config_anydb_ibmdb2' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_ibmdb2 @@ -317,7 +317,7 @@ storageBasedCopy.db6.CommunicationPortNumber = 5912 storageBasedCopy.db6.PortRangeEnd = 5917 storageBasedCopy.db6.PortRangeStart = 5914 {% endif %} -{% if 'db_config_anydb_oracledb' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_oracledb' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_oracledb @@ -345,7 +345,7 @@ ora.whatInstallation = isSingle ## CDB_ONLY: install CDB only. ora.multitenant.installMT = FALSE {% endif %} -{% if 'db_config_anydb_oracledb_121' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_oracledb_121' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_oracledb_121 @@ -355,7 +355,7 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/121 storageBasedCopy.ora.clientVersion = 121 storageBasedCopy.ora.serverVersion = 121 {% endif %} -{% if 'db_config_anydb_oracledb_122' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_oracledb_122' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_oracledb_122 @@ -365,7 +365,7 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/122 storageBasedCopy.ora.clientVersion = 122 storageBasedCopy.ora.serverVersion = 122 {% endif %} -{% if 'db_config_anydb_oracledb_19' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_oracledb_19' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_oracledb_19 @@ -375,7 +375,7 @@ ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/19 storageBasedCopy.ora.clientVersion = 19 storageBasedCopy.ora.serverVersion = 19 {% endif %} -{% if 'db_config_anydb_sapase' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_sapase' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_sapase @@ -412,7 +412,7 @@ SYB.NW_DB.portBackupServer = SYB.NW_DB.portJobScheduler = SYB.NW_DB.portXPServer = {% endif %} -{% if 'db_config_anydb_sapmaxdb' in sap_swpm_inifile_list %} +{% if 'db_config_anydb_sapmaxdb' in sap_swpm_inifile_sections_list %} ###### # db_config_anydb_sapmaxdb @@ -425,7 +425,7 @@ SdbInstanceDialogs.minlogsize = 4000 SdbInstanceDialogs.sapdataFolder = sapdata SdbInstanceDialogs.saplogFolder = saplog {% endif %} -{% if 'db_connection_nw_hana' in sap_swpm_inifile_list %} +{% if 'db_connection_nw_hana' in sap_swpm_inifile_sections_list %} ###### # db_connection_nw_hana @@ -450,7 +450,7 @@ NW_Recovery_Install_HDB.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # NW_HDB_getDBInfo.tenantOsUser = {{ sap_swpm_db_sid | lower }}usr # NW_HDB_getDBInfo.tenantPort = {% endif %} -{% if 'db_connection_nw_anydb_ibmdb2' in sap_swpm_inifile_list %} +{% if 'db_connection_nw_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} ###### # db_connection_nw_anydb_ibmdb2 @@ -468,7 +468,7 @@ NW_DB6_DB.db6.abap.schema = sap{{ sap_swpm_sid | lower }} # NW_DB6_DB.db6.java.connect.user = # NW_DB6_DB.db6.java.schema = {% endif %} -{% if 'db_connection_nw_anydb_oracledb' in sap_swpm_inifile_list %} +{% if 'db_connection_nw_anydb_oracledb' in sap_swpm_inifile_sections_list %} ###### # db_connection_nw_anydb_oracledb @@ -476,14 +476,14 @@ NW_DB6_DB.db6.abap.schema = sap{{ sap_swpm_sid | lower }} storageBasedCopy.abapSchemaPassword = {{ sap_swpm_db_schema_abap_password }} storageBasedCopy.javaSchemaPassword = {{ sap_swpm_db_schema_java_password }} {% endif %} -{% if 'db_connection_nw_anydb_sapase' in sap_swpm_inifile_list %} +{% if 'db_connection_nw_anydb_sapase' in sap_swpm_inifile_sections_list %} ###### # db_connection_nw_anydb_sapase ###### # NW_SYB_CIABAP.sapsaPassword = {% endif %} -{% if 'db_restore_hana' in sap_swpm_inifile_list %} +{% if 'db_restore_hana' in sap_swpm_inifile_sections_list %} ###### # db_restore_hana @@ -506,7 +506,7 @@ HDB_Recovery_Dialogs.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # HDB_System_Check_Dialogs.initTopology = false # NW_CreateDBandLoad.movePVCforUsagePiAndDi = {% endif %} -{% if 'nw_config_anydb' in sap_swpm_inifile_list %} +{% if 'nw_config_anydb' in sap_swpm_inifile_sections_list %} ###### # nw_config_anydb @@ -515,7 +515,7 @@ HDB_Recovery_Dialogs.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # Execute ABAP program 'RUTPOADAPT' for depooling. Set it to 'true' if declustering / depooling is selected for the distributed database instance installation option NW_CI_Instance_ABAP_Reports.executeReportsForDepooling = false {% endif %} -{% if 'nw_config_other' in sap_swpm_inifile_list %} +{% if 'nw_config_other' in sap_swpm_inifile_sections_list %} ###### # nw_config_other @@ -537,7 +537,7 @@ NW_getLoadType.loadType = {{ sap_swpm_load_type }} # NW_adaptProfile.skipSecurityProfileSettings = false # OS4.DestinationASP = {% endif %} -{% if 'nw_config_central_services_abap' in sap_swpm_inifile_list %} +{% if 'nw_config_central_services_abap' in sap_swpm_inifile_sections_list %} ###### # nw_config_central_services_abap @@ -549,7 +549,7 @@ NW_CI_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.ascsVirtualHostname = {{ sap_swpm_ascs_instance_hostname }} NW_SCS_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} {% endif %} -{% if 'nw_config_central_services_java' in sap_swpm_inifile_list %} +{% if 'nw_config_central_services_java' in sap_swpm_inifile_sections_list %} ###### # nw_config_central_services_java @@ -562,7 +562,7 @@ NW_SCS_Instance.scsVirtualHostname = {{ sap_swpm_java_scs_instance_hostname }} NW_SCS_Instance.instanceNumber = {{ sap_swpm_java_scs_instance_nr }} NW_JAVA_Export.keyPhrase = {{ sap_swpm_master_password }} {% endif %} -{% if 'nw_config_primary_application_server_instance' in sap_swpm_inifile_list %} +{% if 'nw_config_primary_application_server_instance' in sap_swpm_inifile_sections_list %} ###### # nw_config_primary_application_server_instance @@ -576,7 +576,7 @@ NW_CI_Instance.ciInstanceNumber = {{ sap_swpm_pas_instance_nr }} # NW_WPConfiguration.ciBtcWPNumber = 6 # NW_WPConfiguration.ciDialogWPNumber = 10 {% endif %} -{% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_list %} +{% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_sections_list %} ###### # nw_config_additional_application_server_instance @@ -595,7 +595,7 @@ NW_AS.instanceNumber = {{ sap_swpm_aas_instance_nr }} # Virtual host name of the SAP NetWeaver Application Server instance. Leave empty to use the existing host name NW_DI_Instance.virtualHostname = {{ sap_swpm_aas_instance_hostname }} {% endif %} -{% if 'nw_config_ers' in sap_swpm_inifile_list %} +{% if 'nw_config_ers' in sap_swpm_inifile_sections_list %} ###### # nw_config_ers @@ -608,7 +608,7 @@ nw_instance_ers.ersInstanceNumber = {{ sap_swpm_ers_instance_nr }} # "User? Password? Stop. FAIL: Invalid Credentials" nw_instance_ers.restartSCS = false {% endif %} -{% if 'nw_config_ports' in sap_swpm_inifile_list %} +{% if 'nw_config_ports' in sap_swpm_inifile_sections_list %} ###### # nw_config_ports @@ -623,7 +623,7 @@ NW_checkMsgServer.abapMSPort = 36{{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.createGlobalProxyInfoFile = false # NW_SCS_Instance.createGlobalRegInfoFile = false {% endif %} -{% if 'nw_config_java_ume' in sap_swpm_inifile_list %} +{% if 'nw_config_java_ume' in sap_swpm_inifile_sections_list %} ###### # nw_config_java_ume @@ -638,7 +638,7 @@ UmeConfiguration.umeInstance = {{ sap_swpm_ume_instance_nr }} UmeConfiguration.umeType = {{ sap_swpm_ume_type }} # UmeConfiguration.sapjsfName = SAPJSF {% endif %} -{% if 'nw_config_java_feature_template_ids' in sap_swpm_inifile_list %} +{% if 'nw_config_java_feature_template_ids' in sap_swpm_inifile_sections_list %} ###### # nw_config_java_feature_template_ids @@ -658,7 +658,7 @@ Select_PPMS_Instances.ListOfSelectedInstances = {% set selected_ids = [] %}{%- f ## Comma-separated value list containing which product instances (formerly known as usage types) are installed. Used for handling product instances in unattended mode. ## SAP_Software_Features_Select.selectedInstancesForInstallation = AS,AAS,BASIC,NW-MODEL,ESR,PI,PI-AF {%- endif %} -{% if 'nw_config_webdisp_generic' in sap_swpm_inifile_list %} +{% if 'nw_config_webdisp_generic' in sap_swpm_inifile_sections_list %} ###### # nw_config_webdisp_generic @@ -683,7 +683,7 @@ NW_webdispatcher_Instance.rfcClient = {{ sap_swpm_wd_backend_rfc_client_nr }} NW_webdispatcher_Instance.rfcUser = {{ sap_swpm_wd_backend_rfc_user }} NW_webdispatcher_Instance.rfcPassword = {{ sap_swpm_wd_backend_rfc_user_password }} {% endif %} -{% if 'nw_config_webdisp_gateway' in sap_swpm_inifile_list %} +{% if 'nw_config_webdisp_gateway' in sap_swpm_inifile_sections_list %} ###### # nw_config_webdisp_gateway @@ -698,14 +698,14 @@ NW_CI_Instance.ascsInstallGateway = {{ sap_swpm_ascs_install_gateway | lower }} # NW_CI_Instance.ascsInstallWebDispatcher = false # NW_SCS_Instance.ascsInstallWebDispatcher = false {% endif %} -{% if 'nw_config_host_agent' in sap_swpm_inifile_list %} +{% if 'nw_config_host_agent' in sap_swpm_inifile_sections_list %} ###### # nw_config_host_agent ###### NW_System.installSAPHostAgent = {{ sap_swpm_install_saphostagent | lower }} {% endif %} -{% if 'nw_config_post_load_abap_reports' in sap_swpm_inifile_list %} +{% if 'nw_config_post_load_abap_reports' in sap_swpm_inifile_sections_list %} ###### # nw_config_post_load_abap_reports @@ -746,7 +746,7 @@ NW_CI_Instance_ABAP_Reports.enableActivateICFService = true # Specify new password of the SAP* user in client 001, different from Master Password # NW_CI_Instance_ABAP_Reports.sapStar001Password = {% endif %} -{% if 'nw_config_livecache' in sap_swpm_inifile_list %} +{% if 'nw_config_livecache' in sap_swpm_inifile_sections_list %} ###### # nw_config_livecache @@ -758,7 +758,7 @@ NW_liveCache.liveCacheUser = NW_liveCache.liveCacheUserPwd = NW_liveCache.useLiveCache = {% endif %} -{% if 'nw_config_sld' in sap_swpm_inifile_list %} +{% if 'nw_config_sld' in sap_swpm_inifile_sections_list %} ###### # nw_config_sld @@ -770,7 +770,7 @@ NW_SLD_Configuration.sldUseHttps = NW_SLD_Configuration.sldUser = NW_SLD_Configuration.sldUserPassword = {% endif %} -{% if 'nw_config_abap_language_packages' in sap_swpm_inifile_list %} +{% if 'nw_config_abap_language_packages' in sap_swpm_inifile_sections_list %} ###### # nw_config_abap_language_packages @@ -781,7 +781,7 @@ NW_Language_Inst_Dialogs.folders = /software # Selected languages comma-separated list (by default DE,EN are installed) NW_Language_Inst_Dialogs.languages = AR,BG,CA,CS,DA,EL,ES,ET,FI,FR,HE,HI,HR,HU,IT,JA,KK,KO,LT,LV,MS,NL,NO,PL,PT,RO,RU,SH,SK,SL,SV,TH,TR,UK,VI,ZF,ZH {% endif %} -{% if 'sap_os_linux_user' in sap_swpm_inifile_list %} +{% if 'sap_os_linux_user' in sap_swpm_inifile_sections_list %} ###### # sap_os_linux_user @@ -790,7 +790,7 @@ nwUsers.sapadmUID = {{ sap_swpm_sapadm_uid }} nwUsers.sapsysGID = {{ sap_swpm_sapsys_gid }} nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} {% endif %} -{% if 'swpm_installation_media_download_service' in sap_swpm_inifile_list %} +{% if 'swpm_installation_media_download_service' in sap_swpm_inifile_sections_list %} ###### # swpm_installation_media_download_service @@ -806,14 +806,14 @@ nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} # DownloadService.Username = # DownloadService.planNumber = {% endif %} -{% if 'nw_config_java_icm_credentials' in sap_swpm_inifile_list %} +{% if 'nw_config_java_icm_credentials' in sap_swpm_inifile_sections_list %} ###### # nw_config_java_icm_credentials ###### NW_IcmAuth.webadmPassword = {{ sap_swpm_ume_j2ee_admin_password }} {% endif %} -{% if 'solman_abap_swpm1' in sap_swpm_inifile_list %} +{% if 'solman_abap_swpm1' in sap_swpm_inifile_sections_list %} ###### # solman_abap_swpm1 @@ -821,7 +821,7 @@ NW_IcmAuth.webadmPassword = {{ sap_swpm_ume_j2ee_admin_password }} ###### InitDeclusteringForImport.decluster = false {% endif %} -{% if 'solman_daa_swpm1' in sap_swpm_inifile_list %} +{% if 'solman_daa_swpm1' in sap_swpm_inifile_sections_list %} ###### # solman_daa_swpm1 @@ -848,7 +848,7 @@ InitDeclusteringForImport.decluster = false # DiagnosticsAgent.SolMan.UserName # DiagnosticsAgent.SolMan.UseSSL {% endif %} -{% if 'syscopy_export_anydb' in sap_swpm_inifile_list %} +{% if 'syscopy_export_anydb' in sap_swpm_inifile_sections_list %} ###### # syscopy_export_anydb @@ -920,7 +920,7 @@ NW_readProfileDir.profileDir = /sapmnt/{{ sap_swpm_sid | upper }}/profile NW_getLoadType.loadType = {{ sap_swpm_load_type }} NW_getLoadType.importManuallyExecuted = false {% endif %} -{% if 'syscopy_import_anydb_ibmdb2' in sap_swpm_inifile_list %} +{% if 'syscopy_import_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} ###### # syscopy_import_anydb_ibmdb2 From ba5fe7c51dcdd281ba076d8bf77b8c1a39826f84 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 5 Aug 2024 16:52:53 +0200 Subject: [PATCH 116/210] sap_swpm: Improved section markers for inifile Signed-off-by: Bernd Finger --- .../tasks/swpm/swpm_inifile_generate.yml | 2 + roles/sap_swpm/templates/inifile_params.j2 | 613 ++++++++++++------ 2 files changed, 408 insertions(+), 207 deletions(-) diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml index 81414b65e..bb7b2ca0c 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml @@ -38,12 +38,14 @@ owner: 'root' group: 'root' mode: '0755' + tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Check if file '{{ sap_swpm_inifile_directory }}/inifile.params' exists ansible.builtin.stat: path: "{{ sap_swpm_inifile_directory }}/inifile.params" check_mode: no register: __sap_swpm_register_stat_sapinst_inifile + tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Notify about existing sapinst inifile ansible.builtin.debug: diff --git a/roles/sap_swpm/templates/inifile_params.j2 b/roles/sap_swpm/templates/inifile_params.j2 index a5797e4c0..576259d92 100644 --- a/roles/sap_swpm/templates/inifile_params.j2 +++ b/roles/sap_swpm/templates/inifile_params.j2 @@ -1,28 +1,34 @@ -### inifile.params generated for SWPM Catalog Product ID is {{ sap_swpm_product_catalog_id }} +### inifile.params generated for SWPM. Product Catalog ID is {{ sap_swpm_product_catalog_id }} . {% if 'swpm_installation_media' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media -###### +################################################################### +# BEGIN section swpm_installation_media # +# # archives.downloadBasket = {{ sap_swpm_software_path }} # installation_export.archivesFolder = {{ sap_swpm_cd_export_path }} # NOTE: Specific media requirements will use format # SAPINST.CD.PACKAGE. = +# # +# END section swpm_installation_media # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm2_hana' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm2_hana -###### +################################################################### +# BEGIN section swpm_installation_media_swpm2_hana # +# # HDB_Software_Dialogs.useMediaCD = {{ sap_swpm_software_use_media }} +# # +# END section swpm_installation_media_swpm2_hana # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1 -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1 # +# # SAPINST.CD.PACKAGE.LANGUAGE = {{ sap_swpm_cd_language_path }} SAPINST.CD.PACKAGE.JAVA = {{ sap_swpm_cd_java_path }} SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdbms_path }} @@ -35,23 +41,29 @@ SAPINST.CD.PACKAGE.RDBMS = {{ sap_swpm_cd_rdbms_path }} # SAPINST.CD.PACKAGE.J2EE = /path/JAVA_J2EE_OSINDEP # SAPINST.CD.PACKAGE.J2EE-INST = /path/JAVA_J2EE_OSINDEP_J2EE_INST # SAPINST.CD.PACKAGE.SCA = /path/JAVA_J2EE_OSINDEP_UT +# # +# END section swpm_installation_media_swpm1 # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_exportfiles' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_exportfiles -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_exportfiles # +# # SAPINST.CD.PACKAGE.EXPORT = {{ sap_swpm_cd_export_path }} # SAPINST.CD.PACKAGE.LOAD = SAPINST.CD.PACKAGE.LOAD1 = {{ sap_swpm_cd_export_pt1_path }} SAPINST.CD.PACKAGE.LOAD2 = {{ sap_swpm_cd_export_pt2_path }} # SAPINST.CD.PACKAGE.JMIG = +# # +# END section swpm_installation_media_swpm1_exportfiles # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_ibmdb2' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_ibmdb2 -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_ibmdb2 # +# # # Requested package : RDBMS-DB6 SAPINST.CD.PACKAGE.DB2 = {{ sap_swpm_cd_ibmdb2_path }} @@ -60,159 +72,210 @@ SAPINST.CD.PACKAGE.DB2CLIENT = {{ sap_swpm_cd_ibmdb2_client_path }} # IBM DB2 software unpack path e.g. /db2/db2x01/db2_software db6.DB2SoftwarePath = {{ sap_swpm_ibmdb2_unpack_path }} +# # +# END section swpm_installation_media_swpm1_ibmdb2 # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_oracledb_121' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_oracledb_121 -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_oracledb_121 # +# # # Requested package : RDBMS-ORA SAPINST.CD.PACKAGE.RDBMS-ORA121 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI121 = {{ sap_swpm_cd_oracle_client_path }} +# # +# END section swpm_installation_media_swpm1_oracledb_121 # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_oracledb_122' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_oracledb_122 -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_oracledb_122 # +# # # Requested package : RDBMS-ORA SAPINST.CD.PACKAGE.RDBMS-ORA122 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI122 = {{ sap_swpm_cd_oracle_client_path }} +# # +# END section swpm_installation_media_swpm1_oracledb_122 # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_oracledb_19' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_oracledb_19 -###### # Requested package : RDBMS-ORA +################################################################### +# BEGIN section swpm_installation_media_swpm1_oracledb_19 # +# # SAPINST.CD.PACKAGE.RDBMS-ORA19 = {{ sap_swpm_cd_oracle_path }} # Requested package : RDBMS-ORA CLIENT SAPINST.CD.PACKAGE.ORACLI19 = {{ sap_swpm_cd_oracle_client_path }} +# # +# END section swpm_installation_media_swpm1_oracledb_19 # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_sapase' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_sapase -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_sapase # +# # # Requested package : RDBMS-SYB SAPINST.CD.PACKAGE.RDBMS-SYB = {{ sap_swpm_cd_sapase_path }} SAPINST.CD.PACKAGE.RDBMS-SYB-CLIENT = {{ sap_swpm_cd_sapase_client_path }} - +# # +# END section swpm_installation_media_swpm1_sapase # +################################################################### {% endif %} {% if 'swpm_installation_media_swpm1_sapmaxdb' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_swpm1_sapmaxdb -###### +################################################################### +# BEGIN section swpm_installation_media_swpm1_sapmaxdb # +# # # Requested package : RDBMS-ADA SAPINST.CD.PACKAGE.RDBMS-ADA = {{ sap_swpm_cd_sapmaxdb_path }} +# # +# END section swpm_installation_media_swpm1_sapmaxdb # +################################################################### {% endif %} {% if 'maintenance_plan_stack_tms_config' in sap_swpm_inifile_sections_list %} -###### -# maintenance_plan_stack_tms_config -###### +################################################################### +# BEGIN section maintenance_plan_stack_tms_config # +# # NW_ABAP_TMSConfig.configureTMS = {{ sap_swpm_configure_tms | lower }} NW_ABAP_TMSConfig.transportPassword = {{ sap_swpm_tmsadm_password }} +# # +# END section maintenance_plan_stack_tms_config # +################################################################### {% endif %} {% if 'maintenance_plan_stack_tms_transports' in sap_swpm_inifile_sections_list %} -###### -# maintenance_plan_stack_tms_transports -###### +################################################################### +# BEGIN section maintenance_plan_stack_tms_transports # +# # NW_ABAP_Include_Corrections.includeTransports = true NW_ABAP_Include_Corrections.transportFilesLocations = {{ sap_swpm_tms_tr_files_path }} +# # +# END section maintenance_plan_stack_tms_transports # +################################################################### {% endif %} {% if 'maintenance_plan_stack_spam_config' in sap_swpm_inifile_sections_list %} -###### -# maintenance_plan_stack_spam_config -###### +################################################################### +# BEGIN section maintenance_plan_stack_spam_config # +# # NW_ABAP_SPAM_Update.SPAMUpdateDecision = {{ sap_swpm_spam_update | lower }} {% if sap_swpm_spam_update %} NW_ABAP_SPAM_Update.SPAMUpdateArchive = {{ sap_swpm_spam_update_sar }} {% else %} #NW_ABAP_SPAM_Update.SPAMUpdateArchive = {% endif %} +# # +# END section maintenance_plan_stack_spam_config # +################################################################### {% endif %} {% if 'maintenance_plan_stack_sum_config' in sap_swpm_inifile_sections_list %} -###### -# maintenance_plan_stack_sum_config -###### +################################################################### +# BEGIN section maintenance_plan_stack_sum_config +# # NW_ABAP_Prepare_SUM.prepareSUM = {{ sap_swpm_sum_prepare | lower }} NW_ABAP_Prepare_SUM.startSUM = {{ sap_swpm_sum_start | lower }} # Password for SUM must be for 'adm' user NW_ABAP_Prepare_SUM.Password = {{ sap_swpm_sap_sidadm_password }} +# # +# END section maintenance_plan_stack_sum_config +################################################################### {% endif %} {% if 'maintenance_plan_stack_sum_10_batch_mode' in sap_swpm_inifile_sections_list %} -###### -# maintenance_plan_stack_sum_10_batch_mode -###### +################################################################### +# BEGIN section maintenance_plan_stack_sum_10_batch_mode # +# # # Re-run of existing BatchModeInputFile.xml for NWAS JAVA (generated by SUM 1.0 on previous host into the /sdt/param/ subdirectory) NW_ABAP_Prepare_SUM.SUMBatchFile = {{ sap_swpm_sum_batch_file }} +# # +# END section maintenance_plan_stack_sum_10_batch_mode # +################################################################### {% endif %} {% if 'credentials' in sap_swpm_inifile_sections_list %} -###### -# credentials -###### -# Master password +################################################################### +# BEGIN section credentials # +# # +# Master password: NW_GetMasterPassword.masterPwd = {{ sap_swpm_master_password }} - -# 'adm' user +# 'adm' user: nwUsers.sidadmPassword = {{ sap_swpm_sap_sidadm_password }} - DiagnosticsAgent.dasidAdmPassword = {{ sap_swpm_diagnostics_agent_password }} - -# 'sapadm' user of the SAP Host Agent +# 'sapadm' user of the SAP Host Agent: hostAgent.sapAdmPassword = {{ sap_swpm_sapadm_password }} +# # +# END section credentials # +################################################################### {% endif %} {% if 'credentials_hana' in sap_swpm_inifile_sections_list %} -###### -# credentials_hana -###### +################################################################### +# BEGIN section credentials_hana # +# # +HDB_Schema_Check_Dialogs.schemaPassword = {{ sap_swpm_db_schema_password }} +storageBasedCopy.hdb.systemPassword = {{ sap_swpm_db_system_password }} +# # +# END section credentials_hana # +################################################################### HDB_Schema_Check_Dialogs.schemaPassword = {{ sap_swpm_db_schema_password }} storageBasedCopy.hdb.systemPassword = {{ sap_swpm_db_system_password }} {% endif %} {% if 'credentials_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} -###### -# credentials_anydb_ibmdb2 -###### +################################################################### +# BEGIN section credentials_anydb_ibmdb2 # +# # nwUsers.db6.db2sidPassword = {{ sap_swpm_sap_sidadm_password }} # nwUsers.db6.db2sidUid = +# # +# END section credentials_anydb_ibmdb2 # +################################################################### {% endif %} {% if 'credentials_anydb_oracledb' in sap_swpm_inifile_sections_list %} -###### -# credentials_anydb_oracledb -###### +################################################################### +# BEGIN section credentials_anydb_oracledb # +# # # Oracle database software owner ora.oraclePassword = {{ sap_swpm_sap_sidadm_password }} - # 'ora' user ora.orasidPassword = {{ sap_swpm_sap_sidadm_password }} - # Oracle 'SYS' password ora.SysPassword = {{ sap_swpm_db_system_password }} - # Oracle 'SYSTEM' password ora.SystemPassword = {{ sap_swpm_db_system_password }} +# # +# END section credentials_anydb_oracledb # +################################################################### +{% endif %} +{% if 'credentials_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} + +################################################################### +# BEGIN section credentials_anydb_ibmdb2 # +# # +nwUsers.db6.db2sidPassword = {{ sap_swpm_sap_sidadm_password }} +# nwUsers.db6.db2sidUid = +# # +# END section credentials_anydb_ibmdb2 # +################################################################### {% endif %} {% if 'credentials_anydb_sapase' in sap_swpm_inifile_sections_list %} -###### -# credentials_anydb_sapase -###### +################################################################### +# BEGIN section credentials_anydb_sapase # +# # nwUsers.syb.sybsidPassword = {{ sap_swpm_sap_sidadm_password }} SYB.NW_DB.sa_pass = {{ sap_swpm_master_password }} SYB.NW_DB.sapsa_pass = {{ sap_swpm_master_password }} @@ -221,78 +284,102 @@ SYB.NW_DB.sapsr3db_pass = {{ sap_swpm_db_system_password }} # SYB.NW_DB.encryptionMasterKeyPassword = # SYB.NW_DB.sapsso_pass = # SYB.NW_DB.sslPassword = +# # +# END section credentials_anydb_sapase # +################################################################### {% endif %} {% if 'credentials_anydb_sapmaxdb' in sap_swpm_inifile_sections_list %} -###### -# credentials_anydb_sapmaxdb -# -# The password of user DBUser may only consist of alphanumeric characters and the special characters #, $, @ and _ -###### +################################################################### +# BEGIN section credentials_anydb_sapmaxdb # +# # +# Note: The password of user DBUser may only consist of alphanumeric characters and the special characters #, $, @ and _ nwUsers.ada.sqdsidPassword = {{ sap_swpm_sap_sidadm_password }} Sdb_DBUser.dbaPassword = {{ sap_swpm_db_system_password }} Sdb_DBUser.dbmPassword = {{ sap_swpm_db_system_password }} Sdb_Schema_Dialogs.dbSchemaPassword = {{ sap_swpm_db_schema_password }} +# # +# END section credentials_anydb_sapmaxdb # +################################################################### {% endif %} {% if 'credentials_nwas_ssfs' in sap_swpm_inifile_sections_list %} -###### -# credentials_nwas_ssfs -###### +################################################################### +# BEGIN section credentials_nwas_ssfs # +# # HDB_Userstore.useABAPSSFS = true # NW_ABAP_SSFS_CustomKey.ssfsKeyInputFile = +# # +# END section credentials_nwas_ssfs # +################################################################### {% endif %} {% if 'credentials_hdbuserstore' in sap_swpm_inifile_sections_list %} -###### -# credentials_hdbuserstore -###### +################################################################### +# BEGIN section credentials_hdbuserstore # +# # HDB_Userstore.useABAPSSFS = false # HDB_Userstore.doNotResolveHostnames = # HDB_Userstore.HDB_USE_IDENT = # HDB_Userstore.systemDBPort = # NW_HDB_DBClient.checkCreateUserstore = true # NW_HDB_DBClient.clientPathStrategy = LOCAL +# # +# END section credentials_hdbuserstore # +################################################################### {% endif %} {% if 'credentials_syscopy' in sap_swpm_inifile_sections_list %} -###### -# credentials_syscopy -###### +################################################################### +# BEGIN section credentials_syscopy # +# # # Are the passwords for the DDIC users different from the default value? NW_DDIC_Password.needDDICPasswords = true NW_DDIC_Password.ddic000Password = {{ sap_swpm_ddic_000_password }} #NW_DDIC_Password.ddic001Password = +# # +# END section credentials_syscopy # +################################################################### {% endif %} {% if 'db_config_hana' in sap_swpm_inifile_sections_list %} -###### -# db_config_hana -###### +################################################################### +# BEGIN section db_config_hana # +# # storageBasedCopy.hdb.instanceNumber = {{ sap_swpm_db_instance_nr }} HDB_Schema_Check_Dialogs.schemaName = {{ sap_swpm_db_schema }} +###################################################################### +# BEGIN subsection nw_config_additional_application_server_instance # +# # {% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_sections_list %} - HDB_Schema_Check_Dialogs.validateSchemaName = true {% else %} HDB_Schema_Check_Dialogs.validateSchemaName = false +# # +# END subsection nw_config_additional_application_server_instance # +###################################################################### {% endif %} - # HDB_Schema_Check_Dialogs.dropSchema = false # hdb.create.dbacockpit.user = false +# # +# END section db_config_hana # +################################################################### {% endif %} {% if 'db_config_anydb_all' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_all -###### +################################################################### +# BEGIN section db_config_anydb_all # +# # NW_ABAP_Import_Dialog.dbCodepage = 4103 +# # +# END section db_config_anydb_all # +################################################################### {% endif %} {% if 'db_config_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_ibmdb2 -###### +################################################################### +# BEGIN section db_config_anydb_ibmdb2 # +# # NW_ABAP_Import_Dialog.migmonJobNum = 3 NW_ABAP_Import_Dialog.migmonLoadArgs = -stop_on_error -loadprocedure fast LOAD:COMPRESS_ALL:DEF_CRT NW_getDBInfoGeneric.dbhost = {{ sap_swpm_db_host }} @@ -316,12 +403,15 @@ db6.usesLDAP = false storageBasedCopy.db6.CommunicationPortNumber = 5912 storageBasedCopy.db6.PortRangeEnd = 5917 storageBasedCopy.db6.PortRangeStart = 5914 +# # +# END section db_config_anydb_ibmdb2 # +################################################################### {% endif %} {% if 'db_config_anydb_oracledb' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_oracledb -###### +################################################################### +# BEGIN section db_config_anydb_oracledb # +# # NW_ABAP_Import_Dialog.migmonJobNum = 3 NW_ABAP_Import_Dialog.migmonLoadArgs = -stop_on_error -loadprocedure fast NW_getDBInfoGeneric.dbsid = {{ sap_swpm_db_sid }} @@ -344,42 +434,54 @@ ora.whatInstallation = isSingle ## PDB_ONLY: install PDB only in an existing CDB. ## CDB_ONLY: install CDB only. ora.multitenant.installMT = FALSE +# # +# END section db_config_anydb_oracledb # +################################################################### {% endif %} {% if 'db_config_anydb_oracledb_121' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_oracledb_121 +################################################################### +# BEGIN section db_config_anydb_oracledb_121 # +# # # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) -###### ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/121 storageBasedCopy.ora.clientVersion = 121 storageBasedCopy.ora.serverVersion = 121 +# # +# END section db_config_anydb_oracledb_121 # +################################################################### {% endif %} {% if 'db_config_anydb_oracledb_122' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_oracledb_122 +################################################################### +# BEGIN section db_config_anydb_oracledb_122 # +# # # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) -###### ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/122 storageBasedCopy.ora.clientVersion = 122 storageBasedCopy.ora.serverVersion = 122 +# # +# END section db_config_anydb_oracledb_122 # +################################################################### {% endif %} {% if 'db_config_anydb_oracledb_19' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_oracledb_19 +################################################################### +# BEGIN section db_config_anydb_oracledb_19 # +# # # Use path to Oracle Home - Runtime (i.e. $OHRDBMS env var) -###### ora.dbhome = /oracle/{{ sap_swpm_db_sid }}/19 storageBasedCopy.ora.clientVersion = 19 storageBasedCopy.ora.serverVersion = 19 +# # +# END section db_config_anydb_oracledb_19 # +################################################################### {% endif %} {% if 'db_config_anydb_sapase' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_sapase -###### +################################################################### +# BEGIN section db_config_anydb_sapase # +# # NW_ABAP_Import_Dialog.migmonJobNum = 3 NW_ABAP_Import_Dialog.migmonLoadArgs = -c 100000 -loadprocedure fast NW_SYB_DBPostload.numberParallelStatisticJobs = 0 @@ -411,12 +513,15 @@ SYB.NW_DB.portDatabaseServer = SYB.NW_DB.portBackupServer = SYB.NW_DB.portJobScheduler = SYB.NW_DB.portXPServer = +# # +# END section db_config_anydb_sapase # +################################################################### {% endif %} {% if 'db_config_anydb_sapmaxdb' in sap_swpm_inifile_sections_list %} -###### -# db_config_anydb_sapmaxdb -###### +################################################################### +# BEGIN section db_config_anydb_sapmaxdb # +# # NW_ABAP_Import_Dialog.migmonJobNum = 90 NW_ABAP_Import_Dialog.migmonLoadArgs = -para_cnt 90 NW_ADA_getDBInfo.dbsid = {{ sap_swpm_db_sid }} @@ -424,12 +529,15 @@ SdbInstanceDialogs.DB_sessions = 100 SdbInstanceDialogs.minlogsize = 4000 SdbInstanceDialogs.sapdataFolder = sapdata SdbInstanceDialogs.saplogFolder = saplog +# # +# END section db_config_anydb_sapmaxdb # +################################################################### {% endif %} {% if 'db_connection_nw_hana' in sap_swpm_inifile_sections_list %} -###### -# db_connection_nw_hana -###### +################################################################### +# BEGIN section db_connection_nw_hana # +# # NW_HDB_getDBInfo.dbhost = {{ sap_swpm_db_host }} NW_HDB_getDBInfo.dbsid = {{ sap_swpm_db_sid }} NW_HDB_getDBInfo.instanceNumber = {{ sap_swpm_db_instance_nr }} @@ -449,12 +557,15 @@ NW_Recovery_Install_HDB.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # NW_HDB_getDBInfo.tenantOsGroup = {{ sap_swpm_db_sid | lower }}grp # NW_HDB_getDBInfo.tenantOsUser = {{ sap_swpm_db_sid | lower }}usr # NW_HDB_getDBInfo.tenantPort = +# # +# END section db_connection_nw_hana # +################################################################### {% endif %} {% if 'db_connection_nw_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} -###### -# db_connection_nw_anydb_ibmdb2 -###### +################################################################### +# BEGIN section db_connection_nw_anydb_ibmdb2 # +# # # db6.UseDb2SSLClientServerComm = false nwUsers.db6.sapsidPassword = {{ sap_swpm_sapadm_password }} # nwUsers.db6.sapsidUid = @@ -467,27 +578,33 @@ NW_DB6_DB.db6.abap.connect.user = sap{{ sap_swpm_sid | lower }} NW_DB6_DB.db6.abap.schema = sap{{ sap_swpm_sid | lower }} # NW_DB6_DB.db6.java.connect.user = # NW_DB6_DB.db6.java.schema = +# # +# END section db_connection_nw_anydb_ibmdb2 # +################################################################### {% endif %} {% if 'db_connection_nw_anydb_oracledb' in sap_swpm_inifile_sections_list %} -###### -# db_connection_nw_anydb_oracledb -###### +################################################################### +# BEGIN secion db_connection_nw_anydb_oracledb # +# # storageBasedCopy.abapSchemaPassword = {{ sap_swpm_db_schema_abap_password }} storageBasedCopy.javaSchemaPassword = {{ sap_swpm_db_schema_java_password }} +# # +# END secion db_connection_nw_anydb_oracledb # +################################################################### {% endif %} {% if 'db_connection_nw_anydb_sapase' in sap_swpm_inifile_sections_list %} -###### +################################################################### # db_connection_nw_anydb_sapase -###### +################################################################### # NW_SYB_CIABAP.sapsaPassword = {% endif %} {% if 'db_restore_hana' in sap_swpm_inifile_sections_list %} -###### -# db_restore_hana -###### +################################################################### +# BEGIN section db_restore_hana # +# # NW_HDB_getDBInfo.systemPasswordBackup = {{ sap_swpm_backup_system_password }} HDB_Recovery_Dialogs.backupLocation = {{ sap_swpm_backup_location }} HDB_Recovery_Dialogs.backupName = {{ sap_swpm_backup_prefix }} @@ -505,21 +622,27 @@ HDB_Recovery_Dialogs.sidAdmPassword = {{ sap_swpm_db_sidadm_password }} # NW_Recovery_Install_HDB.loadOrMount = load # HDB_System_Check_Dialogs.initTopology = false # NW_CreateDBandLoad.movePVCforUsagePiAndDi = +# # +# END section db_restore_hana # +################################################################### {% endif %} {% if 'nw_config_anydb' in sap_swpm_inifile_sections_list %} -###### -# nw_config_anydb -###### +################################################################### +# BEGIN section nw_config_anydb # +# # # Distributed installation or system copy with any database and SAP Basis release 740 or higher: # Execute ABAP program 'RUTPOADAPT' for depooling. Set it to 'true' if declustering / depooling is selected for the distributed database instance installation option NW_CI_Instance_ABAP_Reports.executeReportsForDepooling = false +# # +# END section nw_config_anydb # +################################################################### {% endif %} {% if 'nw_config_other' in sap_swpm_inifile_sections_list %} -###### -# nw_config_other -###### +################################################################### +# BEGIN section nw_config_other # +# # # NW_Delete_Sapinst_Users.removeUsers = false NW_getFQDN.FQDN = {{ sap_swpm_fqdn }} NW_getFQDN.setFQDN = {{ sap_swpm_set_fqdn | lower }} @@ -536,53 +659,75 @@ NW_getLoadType.loadType = {{ sap_swpm_load_type }} # NW_Exit_Before_Systemstart.exit = false # NW_adaptProfile.skipSecurityProfileSettings = false # OS4.DestinationASP = +# # +# END section nw_config_other # +################################################################### {% endif %} {% if 'nw_config_central_services_abap' in sap_swpm_inifile_sections_list %} -###### -# nw_config_central_services_abap +################################################################### +# BEGIN section nw_config_central_services_abap # +# # # Central Services (ASCS) contains the Message server (MS) and Enqueue work processes (EN) for the ABAP Dispatcher. # Formerly the processes were contained in the Central Instance (CI). -###### +################################################################### NW_CI_Instance.ascsVirtualHostname = {{ sap_swpm_ascs_instance_hostname }} NW_CI_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.ascsVirtualHostname = {{ sap_swpm_ascs_instance_hostname }} NW_SCS_Instance.ascsInstanceNumber = {{ sap_swpm_ascs_instance_nr }} +# # +# END section nw_config_central_services_abap # +################################################################### {% endif %} {% if 'nw_config_central_services_java' in sap_swpm_inifile_sections_list %} -###### -# nw_config_central_services_java -# SAP Java Central Services Instance (SCS) contains the Java Message server (MS), Java Enqueue server (EN), Java Gateway (GW) and Java Internal Web Dispatcher (WD). -###### +################################################################### +# BEGIN section nw_config_central_services_java # +# # +# SAP Java Central Services Instance (SCS) contains: +# - Java Message server (MS), +# - Java Enqueue server (EN), +# - Java Gateway (GW) and +# - Java Internal Web Dispatcher (WD). +################################################################### NW_CI_Instance.scsVirtualHostname = {{ sap_swpm_java_scs_instance_hostname }} NW_CI_Instance.scsInstanceNumber = {{ sap_swpm_java_scs_instance_nr }} NW_SCS_Instance.scsVirtualHostname = {{ sap_swpm_java_scs_instance_hostname }} # NW_SCS_Instance.scsInstanceNumber = NW_SCS_Instance.instanceNumber = {{ sap_swpm_java_scs_instance_nr }} NW_JAVA_Export.keyPhrase = {{ sap_swpm_master_password }} +# # +# END section nw_config_central_services_java # +################################################################### {% endif %} {% if 'nw_config_primary_application_server_instance' in sap_swpm_inifile_sections_list %} -###### -# nw_config_primary_application_server_instance -# Primary Application Server (PAS) contains the Internet Communication Manager (ICM), Gateway (GW), and ABAP Dispatcher (DI/WP) work processes. +################################################################### +# BEGIN section nw_config_primary_application_server_instance # +# # +# Primary Application Server (PAS) contains: +# - Internet Communication Manager (ICM), +# - Gateway (GW) and +# - ABAP Dispatcher (DI/WP) work processes. # Formerly called the Central Instance (CI). -###### NW_CI_Instance.ciVirtualHostname = {{ sap_swpm_pas_instance_hostname }} NW_CI_Instance.ciInstanceNumber = {{ sap_swpm_pas_instance_nr }} # NW_CI_Instance.nodesNum = # NW_CI_Instance.nodesNumber = defNodes # NW_WPConfiguration.ciBtcWPNumber = 6 # NW_WPConfiguration.ciDialogWPNumber = 10 +# # +# END section nw_config_primary_application_server_instance # +################################################################### {% endif %} {% if 'nw_config_additional_application_server_instance' in sap_swpm_inifile_sections_list %} -###### -# nw_config_additional_application_server_instance -# Additional Application Server (AAS) contains ABAP Dispatcher (DI/WP) work processes. +################################################################### +# BEGIN section nw_config_additional_application_server_instance # +# # +# Additional Application Server (AAS) contains: +# - ABAP Dispatcher (DI/WP) work processes. # Formerly called the Dialog Instance (DI). -###### # Instance number of SAP NetWeaver Application Server. Leave empty for default. NW_AS.instanceNumber = {{ sap_swpm_aas_instance_nr }} @@ -594,12 +739,15 @@ NW_AS.instanceNumber = {{ sap_swpm_aas_instance_nr }} # Virtual host name of the SAP NetWeaver Application Server instance. Leave empty to use the existing host name NW_DI_Instance.virtualHostname = {{ sap_swpm_aas_instance_hostname }} +# # +# END section nw_config_additional_application_server_instance # +################################################################### {% endif %} {% if 'nw_config_ers' in sap_swpm_inifile_sections_list %} -###### -# nw_config_ers -###### +################################################################### +# BEGIN section nw_config_ers # +# # nw_instance_ers.ersVirtualHostname = {{ sap_swpm_ers_instance_hostname }} nw_instance_ers.ersInstanceNumber = {{ sap_swpm_ers_instance_nr }} @@ -607,12 +755,15 @@ nw_instance_ers.ersInstanceNumber = {{ sap_swpm_ers_instance_nr }} # otherwise by default SAP SWPM will use sapcontrol -queryuser -function Stop and will cause error # "User? Password? Stop. FAIL: Invalid Credentials" nw_instance_ers.restartSCS = false +# # +# END section nw_config_ers # +################################################################### {% endif %} {% if 'nw_config_ports' in sap_swpm_inifile_sections_list %} -###### -# nw_config_ports -###### +################################################################### +# BEGIN section nw_config_ports # +# # NW_CI_Instance.ciMSPort = 36{{ sap_swpm_ascs_instance_nr }} NW_checkMsgServer.abapMSPort = 36{{ sap_swpm_ascs_instance_nr }} # NW_CI_Instance.ciMSPortInternal = @@ -622,12 +773,15 @@ NW_checkMsgServer.abapMSPort = 36{{ sap_swpm_ascs_instance_nr }} # NW_SCS_Instance.scsMSPort = # NW_SCS_Instance.createGlobalProxyInfoFile = false # NW_SCS_Instance.createGlobalRegInfoFile = false +# # +# END section nw_config_ports # +################################################################### {% endif %} {% if 'nw_config_java_ume' in sap_swpm_inifile_sections_list %} -###### -# nw_config_java_ume -###### +################################################################### +# BEGIN section nw_config_java_ume # +# # UmeConfiguration.adminName = J2EE_ADM_{{ sap_swpm_sid }} UmeConfiguration.adminPassword = {{ sap_swpm_ume_j2ee_admin_password }} UmeConfiguration.guestName = J2EE_GST_{{ sap_swpm_sid }} @@ -637,12 +791,15 @@ UmeConfiguration.umeHost = {{ sap_swpm_pas_instance_hostname }} UmeConfiguration.umeInstance = {{ sap_swpm_ume_instance_nr }} UmeConfiguration.umeType = {{ sap_swpm_ume_type }} # UmeConfiguration.sapjsfName = SAPJSF +# # +# END section nw_config_java_ume # +################################################################### {% endif %} {% if 'nw_config_java_feature_template_ids' in sap_swpm_inifile_sections_list %} -###### -# nw_config_java_feature_template_ids -###### +################################################################### +# BEGIN section nw_config_java_feature_template_ids # +# # NW_internal.useProductVersionDescriptor = true nw_java_import.buildJEEusingExtraMileTool = {{ true if sap_swpm_java_import_method == 'extramile' else false }} @@ -657,12 +814,15 @@ Select_PPMS_Instances.ListOfSelectedInstances = {% set selected_ids = [] %}{%- f ## If use PV = false [LEGACY for before NWAS JAVA 7.40] ## Comma-separated value list containing which product instances (formerly known as usage types) are installed. Used for handling product instances in unattended mode. ## SAP_Software_Features_Select.selectedInstancesForInstallation = AS,AAS,BASIC,NW-MODEL,ESR,PI,PI-AF +# # +# END section nw_config_java_feature_template_ids # +################################################################### {%- endif %} {% if 'nw_config_webdisp_generic' in sap_swpm_inifile_sections_list %} -###### -# nw_config_webdisp_generic -###### +################################################################### +# BEGIN section nw_config_webdisp_generic # +# # NW_Webdispatcher_Instance.wdInstanceNumber = {{ sap_swpm_wd_instance_nr }} # NW_webdispatcher_Instance.encryptionMode = Always # NW_webdispatcher_Instance.useWdHTTPPort = false @@ -682,15 +842,18 @@ NW_webdispatcher_Instance.rfcInstance = {{ sap_swpm_wd_backend_rfc_instance_nr } NW_webdispatcher_Instance.rfcClient = {{ sap_swpm_wd_backend_rfc_client_nr }} NW_webdispatcher_Instance.rfcUser = {{ sap_swpm_wd_backend_rfc_user }} NW_webdispatcher_Instance.rfcPassword = {{ sap_swpm_wd_backend_rfc_user_password }} +# # +# END section nw_config_webdisp_generic # +################################################################### {% endif %} {% if 'nw_config_webdisp_gateway' in sap_swpm_inifile_sections_list %} -###### +################################################################### # nw_config_webdisp_gateway # # It is recommended to install gateway as part of ASCS # It is NOT recommended to install webdispatcher as part of ASCS. A separate Web Dispatcher instance should be installed (SAP Note 908097) -###### +################################################################### NW_CI_Instance.ascsInstallGateway = {{ sap_swpm_ascs_install_gateway | lower }} # NW_SCS_Instance.ascsInstallGateway = {{ sap_swpm_ascs_install_gateway | lower }} @@ -700,16 +863,19 @@ NW_CI_Instance.ascsInstallGateway = {{ sap_swpm_ascs_install_gateway | lower }} {% endif %} {% if 'nw_config_host_agent' in sap_swpm_inifile_sections_list %} -###### -# nw_config_host_agent -###### +################################################################### +# BEGIN section nw_config_host_agent # +# # NW_System.installSAPHostAgent = {{ sap_swpm_install_saphostagent | lower }} +# # +# END section nw_config_host_agent # +################################################################### {% endif %} {% if 'nw_config_post_load_abap_reports' in sap_swpm_inifile_sections_list %} -###### -# nw_config_post_load_abap_reports -###### +################################################################### +# BEGIN section nw_config_post_load_abap_reports # +# # # Activate ICF node '/SAP/BC/REST/SLPROTOCOL' NW_CI_Instance_ABAP_Reports.enableActivateICFService = true @@ -745,57 +911,72 @@ NW_CI_Instance_ABAP_Reports.enableActivateICFService = true # Specify new password of the SAP* user in client 001, different from Master Password # NW_CI_Instance_ABAP_Reports.sapStar001Password = +# # +# END section nw_config_post_load_abap_reports # +################################################################### {% endif %} {% if 'nw_config_livecache' in sap_swpm_inifile_sections_list %} -###### -# nw_config_livecache -###### +################################################################### +# BEGIN section nw_config_livecache # +# # NW_liveCache.controlUserPwd = NW_liveCache.liveCacheHost = NW_liveCache.liveCacheID = NW_liveCache.liveCacheUser = NW_liveCache.liveCacheUserPwd = NW_liveCache.useLiveCache = +# # +# END section nw_config_livecache # +################################################################### {% endif %} {% if 'nw_config_sld' in sap_swpm_inifile_sections_list %} -###### -# nw_config_sld -###### +################################################################### +# BEGIN section nw_config_sld # +# # NW_SLD_Configuration.configureSld = NW_SLD_Configuration.sldHost = NW_SLD_Configuration.sldPort = NW_SLD_Configuration.sldUseHttps = NW_SLD_Configuration.sldUser = NW_SLD_Configuration.sldUserPassword = +# # +# END section nw_config_sld # +################################################################### {% endif %} {% if 'nw_config_abap_language_packages' in sap_swpm_inifile_sections_list %} -###### -# nw_config_abap_language_packages -###### +################################################################### +# BEGIN section nw_config_abap_language_packages # +# # NW_Language_Inst_Dialogs.install = true # Path to language archive files (e.g. S4HANAOP***_LANG_EN.SAR) NW_Language_Inst_Dialogs.folders = /software # Selected languages comma-separated list (by default DE,EN are installed) NW_Language_Inst_Dialogs.languages = AR,BG,CA,CS,DA,EL,ES,ET,FI,FR,HE,HI,HR,HU,IT,JA,KK,KO,LT,LV,MS,NL,NO,PL,PT,RO,RU,SH,SK,SL,SV,TH,TR,UK,VI,ZF,ZH +# # +# END section nw_config_abap_language_packages # +################################################################### {% endif %} {% if 'sap_os_linux_user' in sap_swpm_inifile_sections_list %} -###### -# sap_os_linux_user -###### +################################################################### +# BEGIN section sap_os_linux_user # +# # nwUsers.sapadmUID = {{ sap_swpm_sapadm_uid }} nwUsers.sapsysGID = {{ sap_swpm_sapsys_gid }} nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} +# # +# END section sap_os_linux_user # +################################################################### {% endif %} {% if 'swpm_installation_media_download_service' in sap_swpm_inifile_sections_list %} -###### -# swpm_installation_media_download_service -# Not in use by sap_swpm Ansible Role -###### +################################################################### +# BEGIN section swpm_installation_media_download_service # +# Note: This section is not in use by sap_swpm Ansible Role # +# # # nwUsers.sapServiceSIDPassword = # download_service.directory = # DownloadService.EnableProxy = @@ -805,28 +986,37 @@ nwUsers.sidAdmUID = {{ sap_swpm_sidadm_uid }} # DownloadService.ProvideAuthentication = # DownloadService.Username = # DownloadService.planNumber = +# # +# END section swpm_installation_media_download_service # +################################################################### {% endif %} {% if 'nw_config_java_icm_credentials' in sap_swpm_inifile_sections_list %} -###### -# nw_config_java_icm_credentials -###### +################################################################### +# BEGIN section nw_config_java_icm_credentials # +# # NW_IcmAuth.webadmPassword = {{ sap_swpm_ume_j2ee_admin_password }} +# # +# END section nw_config_java_icm_credentials # +################################################################### {% endif %} {% if 'solman_abap_swpm1' in sap_swpm_inifile_sections_list %} -###### -# solman_abap_swpm1 -# Not in use by sap_swpm Ansible Role -###### +################################################################### +# BEGIN section solman_abap_swpm1 # +# Note: This section is not in use by sap_swpm Ansible Role # +# # InitDeclusteringForImport.decluster = false +# # +# END section solman_abap_swpm1 # +################################################################### {% endif %} {% if 'solman_daa_swpm1' in sap_swpm_inifile_sections_list %} -###### -# solman_daa_swpm1 -# Not in use by sap_swpm Ansible Role -###### +################################################################### +# BEGIN section solman_daa_swpm1 # +# Note: This section is not in use by sap_swpm Ansible Role # +# # # DiagnosticsAgent.dasidAdmPassword = {{ sap_swpm_diagnostics_agent_password }} # DiagnosticsAgent.installSAPHostAgent # DiagnosticsAgent.InstanceNumber @@ -847,13 +1037,16 @@ InitDeclusteringForImport.decluster = false # DiagnosticsAgent.SolMan.PortNumber # DiagnosticsAgent.SolMan.UserName # DiagnosticsAgent.SolMan.UseSSL +# # +# END section solman_daa_swpm1 # +################################################################### {% endif %} {% if 'syscopy_export_anydb' in sap_swpm_inifile_sections_list %} -###### -# syscopy_export_anydb -# Not in use by sap_swpm Ansible Role -###### +################################################################### +# BEGIN section syscopy_export_anydb # +# Note: This section is not in use by sap_swpm Ansible Role # +# # # InitDeclusteringForExport.decluster = # NW_ABAP_Export_Dialog.customPackageOrder = # NW_ABAP_Export_Dialog.customSortOrderFile = @@ -919,13 +1112,16 @@ NW_readProfileDir.profileDir = /sapmnt/{{ sap_swpm_sid | upper }}/profile NW_getLoadType.loadType = {{ sap_swpm_load_type }} NW_getLoadType.importManuallyExecuted = false +# # +# END section syscopy_export_anydb # +################################################################### {% endif %} {% if 'syscopy_import_anydb_ibmdb2' in sap_swpm_inifile_sections_list %} -###### -# syscopy_import_anydb_ibmdb2 -# Not in use by sap_swpm Ansible Role -###### +################################################################### +# BEGIN section syscopy_import_anydb_ibmdb2 # +# Note: This section is not in use by sap_swpm Ansible Role # +# # # db6.Additional_DbServer = # db6.cluster.HADRPort1 = # db6.cluster.HADRPort2 = @@ -956,4 +1152,7 @@ storageBasedCopy.db6.CommunicationPortNumber = 5912 storageBasedCopy.db6.PortRangeEnd = 5917 storageBasedCopy.db6.PortRangeStart = 5914 # storageBasedCopy.db6.db6updatedbpath = +# # +# END section syscopy_import_anydb_ibmdb2 # +################################################################### {% endif %} From 53fc46fe0f934a4915bc11cb3b902ff8fe5b7c93 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 5 Aug 2024 18:20:28 +0200 Subject: [PATCH 117/210] sap_swpm: Reorganize yml files, part 1 Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 2 +- .../detect_variables_from_inifile.yml} | 0 .../generate_inifile_params.yml} | 37 ++----------------- .../prepare_software.yml | 0 .../tasks/pre_install/set_password_facts.yml | 24 ++++++++++++ .../swpm_prepare.yml} | 16 +++++++- .../swpm_inifile_generate_inifile_reuse.yml | 13 ------- 7 files changed, 43 insertions(+), 49 deletions(-) rename roles/sap_swpm/tasks/{swpm/detect_variables.yml => pre_install/detect_variables_from_inifile.yml} (100%) rename roles/sap_swpm/tasks/{swpm/swpm_inifile_generate.yml => pre_install/generate_inifile_params.yml} (77%) rename roles/sap_swpm/tasks/{swpm => pre_install}/prepare_software.yml (100%) create mode 100644 roles/sap_swpm/tasks/pre_install/set_password_facts.yml rename roles/sap_swpm/tasks/{swpm/swpm_pre_install.yml => pre_install/swpm_prepare.yml} (83%) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 1f330fb3e..cf5b9ccb7 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -12,7 +12,7 @@ ################ - name: SAP SWPM Pre Install - Run Preinstallation Steps - ansible.builtin.include_tasks: swpm/swpm_pre_install.yml + ansible.builtin.include_tasks: pre_install/swpm_prepare.yml tags: - sap_swpm_generate_inifile - sap_swpm_sapinst_commandline diff --git a/roles/sap_swpm/tasks/swpm/detect_variables.yml b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml similarity index 100% rename from roles/sap_swpm/tasks/swpm/detect_variables.yml rename to roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml similarity index 77% rename from roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml rename to roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml index bb7b2ca0c..71a004d1b 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml @@ -1,34 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... -- name: SAP SWPM default mode - Determine Installation Type - ansible.builtin.include_tasks: - file: ../pre_install/install_type.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - # Password Facts -- name: SAP SWPM Pre Install - Set password facts when ABAP - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" - when: "'ABAP' in sap_swpm_product_catalog_id" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM Pre Install - Set password facts when Java - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" - when: "'Java' in sap_swpm_product_catalog_id" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM Pre Install - Set other user passwords using master password - ansible.builtin.set_fact: - sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" +- name: SAP SWPM Pre Install - Set password facts + ansible.builtin.include_tasks: "set_password_facts.yml" tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists @@ -132,7 +107,7 @@ - name: SAP SWPM Pre Install - Detect Variables ansible.builtin.include_tasks: - file: detect_variables.yml + file: detect_variables_from_inifile.yml apply: tags: sap_swpm_generate_inifile tags: sap_swpm_generate_inifile @@ -157,9 +132,3 @@ ansible.builtin.debug: msg: "The local inifile.params has been copied to: '{{ sap_swpm_tmpdir.path }}/inifile.params'" tags: sap_swpm_generate_inifile - -# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) -# Prepare Software -- name: SAP SWPM advanced mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml - when: sap_swpm_run_sapinst diff --git a/roles/sap_swpm/tasks/swpm/prepare_software.yml b/roles/sap_swpm/tasks/pre_install/prepare_software.yml similarity index 100% rename from roles/sap_swpm/tasks/swpm/prepare_software.yml rename to roles/sap_swpm/tasks/pre_install/prepare_software.yml diff --git a/roles/sap_swpm/tasks/pre_install/set_password_facts.yml b/roles/sap_swpm/tasks/pre_install/set_password_facts.yml new file mode 100644 index 000000000..96010efba --- /dev/null +++ b/roles/sap_swpm/tasks/pre_install/set_password_facts.yml @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# Password Facts +- name: SAP SWPM Pre Install - Set password facts when ABAP + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" + when: "'ABAP' in sap_swpm_product_catalog_id" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Set password facts when Java + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" + when: "'Java' in sap_swpm_product_catalog_id" + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Set other user passwords using master password + ansible.builtin.set_fact: + sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" + tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml similarity index 83% rename from roles/sap_swpm/tasks/swpm/swpm_pre_install.yml rename to roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index 8664f9dbd..a22dbbe29 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -40,13 +40,27 @@ when: sap_swpm_use_password_file == "y" tags: sap_swpm_generate_inifile +# Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... +- name: SAP SWPM default mode - Determine Installation Type + ansible.builtin.include_tasks: + file: install_type.yml + apply: + tags: sap_swpm_generate_inifile + tags: sap_swpm_generate_inifile + # Create the SWPM inifile ## Run SWPM inifile generation based on ansible role mode - name: SAP SWPM Pre Install - Generate the SWPM inifile - ansible.builtin.include_tasks: "swpm_inifile_generate.yml" + ansible.builtin.include_tasks: "generate_inifile_params.yml" # ansible.builtin.include_tasks: "swpm_inifile_generate_{{ sap_swpm_ansible_role_mode }}.yml" tags: sap_swpm_generate_inifile +# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) +# Prepare Software +- name: SAP SWPM advanced mode - Prepare Software + ansible.builtin.include_tasks: prepare_software.yml + when: sap_swpm_run_sapinst + #- name: SAP SWPM Pre Install - Display the location of file 'inifile.params' # ansible.builtin.debug: # msg: "/tmp/inifile.params" diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml index b22ef3481..f2257998f 100644 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml +++ b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml @@ -24,16 +24,3 @@ msg: "{{ sap_swpm_inifile_reuse_source }} is not reusable" when: sap_swpm_inifile_read_file.stdout != '0' tags: sap_swpm_generate_inifile - -# Detect variables from generated inifile -- name: SAP SWPM inifile_reuse mode - Detect Variables - ansible.builtin.include_tasks: - file: detect_variables.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - -# Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) -# Prepare Software -- name: SAP SWPM inifile_reuse mode - Prepare Software - ansible.builtin.include_tasks: prepare_software.yml From 4ef0900d28f03baa181c88340d92cda99a9d42d1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 6 Aug 2024 11:02:39 +0200 Subject: [PATCH 118/210] sap_swpm: Fix task name Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install/swpm_prepare.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index a22dbbe29..a5d56915f 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -57,7 +57,7 @@ # Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) # Prepare Software -- name: SAP SWPM advanced mode - Prepare Software +- name: SAP SWPM Pre Install - Prepare Software ansible.builtin.include_tasks: prepare_software.yml when: sap_swpm_run_sapinst From 73df28684e0d359103524cd95b8df371be3cb84f Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 6 Aug 2024 12:16:05 +0200 Subject: [PATCH 119/210] sap_swpm: Speed up inifile generation if tag is specified Signed-off-by: Bernd Finger --- ...nifile_params.yml => generate_inifile.yml} | 40 ++++++------------- .../tasks/pre_install/swpm_prepare.yml | 30 +++++++------- 2 files changed, 27 insertions(+), 43 deletions(-) rename roles/sap_swpm/tasks/pre_install/{generate_inifile_params.yml => generate_inifile.yml} (80%) diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml similarity index 80% rename from roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml rename to roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 71a004d1b..a635aa234 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile_params.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -6,6 +6,7 @@ ansible.builtin.include_tasks: "set_password_facts.yml" tags: sap_swpm_generate_inifile +# The following task is used for checking if an inifile exists on the managed node - name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists ansible.builtin.file: path: "{{ sap_swpm_inifile_directory }}" @@ -13,20 +14,20 @@ owner: 'root' group: 'root' mode: '0755' - tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Check if file '{{ sap_swpm_inifile_directory }}/inifile.params' exists ansible.builtin.stat: path: "{{ sap_swpm_inifile_directory }}/inifile.params" check_mode: no register: __sap_swpm_register_stat_sapinst_inifile - tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Notify about existing sapinst inifile ansible.builtin.debug: msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." when: __sap_swpm_register_stat_sapinst_inifile.stat.exists +# Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. +# So we are using 'slurp'+'copy' for this purpose. - name: SAP SWPM Pre Install - Slurp the remote 'inifile.params' for copying to managed node ansible.builtin.slurp: src: "{{ sap_swpm_inifile_directory }}/inifile.params" @@ -43,26 +44,11 @@ delegate_to: localhost when: __sap_swpm_register_stat_sapinst_inifile.stat.exists -# Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. -#- name: SAP SWPM Pre Install - Download existing sapinst inifile to '{{ sap_swpm_local_inifile_directory }}' -# ansible.builtin.fetch: -# src: "{{ sap_swpm_inifile_directory }}/inifile.params" -# dest: "{{ sap_swpm_tmpdir_local.path }}/" -## dest: "{{ sap_swpm_local_inifile_directory }}/" -# flat: true -# become: true -# when: __sap_swpm_register_stat_sapinst_inifile.stat.exists - -#- name: SAP SWPM Pre Install - Copy sapinst inifile to '{{ sap_swpm_tmpdir_local.path }}' -# ansible.builtin.copy: -# src: "{{ sap_swpm_local_inifile_directory }}/inifile.params" -# dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" -# delegate_to: localhost -# when: __sap_swpm_register_stat_sapinst_inifile.stat.exists - +# We are creating the inifile dynamically in one of the two cases: +# 1 - The tag sap_swpm_generate_inifile is specified +# 2 - There is no file 'inifile.params' available in 'sap_swpm_inifile_directory' - name: SAP SWPM Pre Install - Create the SWPM inifile 'inifile.params' dynamically - when: - - not __sap_swpm_register_stat_sapinst_inifile.stat.exists + when: "'sap_swpm_generate_inifile' in ansible_run_tags or (not __sap_swpm_register_stat_sapinst_inifile.stat.exists)" block: # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params @@ -108,16 +94,16 @@ - name: SAP SWPM Pre Install - Detect Variables ansible.builtin.include_tasks: file: detect_variables_from_inifile.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile +# apply: +# tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Slurp the local 'inifile.params' for copying to managed node ansible.builtin.slurp: src: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" register: sap_swpm_slurped_local_inifile delegate_to: localhost - tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Copy 'inifile.params' to the managed node ansible.builtin.copy: @@ -126,9 +112,9 @@ owner: 'root' group: 'root' mode: '0640' - tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Display the path of the remote 'inifile.params' ansible.builtin.debug: msg: "The local inifile.params has been copied to: '{{ sap_swpm_tmpdir.path }}/inifile.params'" - tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index a5d56915f..e34fd5029 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -11,24 +11,24 @@ - sap_swpm_generate_inifile - sap_swpm_sapinst_commandline -- name: SAP SWPM Pre Install - Make the temporary directory on control node world readable - ansible.builtin.file: - path: "{{ sap_swpm_tmpdir_local.path }}" - state: directory - mode: '0777' - delegate_to: localhost - tags: - - sap_swpm_generate_inifile - - sap_swpm_sapinst_commandline +#- name: SAP SWPM Pre Install - Make the temporary directory on control node world readable +# ansible.builtin.file: +# path: "{{ sap_swpm_tmpdir_local.path }}" +# state: directory +# mode: '0777' +# delegate_to: localhost +# tags: +# - sap_swpm_generate_inifile +# - sap_swpm_sapinst_commandline - name: SAP SWPM Pre Install - Create temporary directory on managed node ansible.builtin.tempfile: state: directory suffix: _swpm_config register: sap_swpm_tmpdir - tags: - - sap_swpm_generate_inifile - - sap_swpm_sapinst_commandline +# tags: +# - sap_swpm_generate_inifile +# - sap_swpm_sapinst_commandline # Copy password file to the same location as inifile.params - name: SAP SWPM Pre Install - Copy password file to the same location as inifile.params @@ -38,7 +38,7 @@ remote_src: yes mode: '0640' when: sap_swpm_use_password_file == "y" - tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile # Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... - name: SAP SWPM default mode - Determine Installation Type @@ -49,10 +49,8 @@ tags: sap_swpm_generate_inifile # Create the SWPM inifile -## Run SWPM inifile generation based on ansible role mode - name: SAP SWPM Pre Install - Generate the SWPM inifile - ansible.builtin.include_tasks: "generate_inifile_params.yml" -# ansible.builtin.include_tasks: "swpm_inifile_generate_{{ sap_swpm_ansible_role_mode }}.yml" + ansible.builtin.include_tasks: "generate_inifile.yml" tags: sap_swpm_generate_inifile # Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) From e065e9f99e2cc799b62449123666cd0b70616f16 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 6 Aug 2024 15:52:20 +0200 Subject: [PATCH 120/210] sap_swpm: Integrate the inifile_reuse mode Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 2 +- .../tasks/pre_install/generate_inifile.yml | 63 ++++++++++++------- .../tasks/pre_install/swpm_prepare.yml | 9 +-- .../swpm_inifile_generate_inifile_reuse.yml | 26 -------- 4 files changed, 42 insertions(+), 58 deletions(-) delete mode 100644 roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index cf5b9ccb7..bb2b63f03 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -23,7 +23,7 @@ # Firewall -- name: SAP SWPM Pre Install - Firewall Setup +- name: SAP SWPM Pre Install - Setup Firewall ansible.builtin.include_tasks: file: pre_install/firewall.yml apply: diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index a635aa234..2f026bbe1 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -7,7 +7,7 @@ tags: sap_swpm_generate_inifile # The following task is used for checking if an inifile exists on the managed node -- name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists +- name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists on the managed node ansible.builtin.file: path: "{{ sap_swpm_inifile_directory }}" state: directory @@ -15,44 +15,60 @@ group: 'root' mode: '0755' -- name: SAP SWPM Pre Install - Check if file '{{ sap_swpm_inifile_directory }}/inifile.params' exists +- name: SAP SWPM Pre Install - Check if file '{{ sap_swpm_inifile_directory }}/inifile.params' exists on the managed node ansible.builtin.stat: path: "{{ sap_swpm_inifile_directory }}/inifile.params" check_mode: no register: __sap_swpm_register_stat_sapinst_inifile -- name: SAP SWPM Pre Install - Notify about existing sapinst inifile - ansible.builtin.debug: - msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." +- name: SAP SWPM Pre Install - Try using existing SWPM inifile 'inifile.params' when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + block: + + - name: SAP SWPM Pre Install, use existing inifile - Notify about existing sapinst inifile on the managed node + ansible.builtin.debug: + msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." # Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. -# So we are using 'slurp'+'copy' for this purpose. -- name: SAP SWPM Pre Install - Slurp the remote 'inifile.params' for copying to managed node - ansible.builtin.slurp: - src: "{{ sap_swpm_inifile_directory }}/inifile.params" - register: sap_swpm_slurped_remote_inifile - when: __sap_swpm_register_stat_sapinst_inifile.stat.exists +# So we are using 'slurp' and 'copy' for this purpose. + - name: SAP SWPM Pre Install, use existing inifile - Slurp the remote 'inifile.params' for copying to control node + ansible.builtin.slurp: + src: "{{ sap_swpm_inifile_directory }}/inifile.params" + register: sap_swpm_slurped_remote_inifile -- name: SAP SWPM Pre Install - Copy 'inifile.params' to the control node - ansible.builtin.copy: - content: "{{ sap_swpm_slurped_remote_inifile['content'] | b64decode }}" - dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" - owner: 'root' - group: 'root' - mode: '0640' - delegate_to: localhost - when: __sap_swpm_register_stat_sapinst_inifile.stat.exists + - name: SAP SWPM Pre Install, existing inifile - Copy 'inifile.params' to the control node + ansible.builtin.copy: + content: "{{ sap_swpm_slurped_remote_inifile['content'] | b64decode }}" + dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + owner: 'root' + group: 'root' + mode: '0640' + delegate_to: localhost + +# Now we need to confirm that des25 is not in the inifile + - name: SAP SWPM Pre Install, use existing inifile - Search inifile for for des25 + ansible.builtin.shell: | + set -o pipefail && awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' {{ sap_swpm_tmpdir_local.path }}/inifile.params + delegate_to: localhost + register: sap_swpm_inifile_count_des25 + changed_when: false + + - name: SAP SWPM Pre Install, use existing inifile - Ensure that des25 is not present in inifile + ansible.builtin.fail: + msg: + - "Inifile '{{ sap_swpm_inifile_directory }}/inifile.params' cannot be reused because it contains des25 encrypted data." + - "See also SAP notes 2609804." + when: sap_swpm_inifile_count_des25.stdout != '0' # We are creating the inifile dynamically in one of the two cases: # 1 - The tag sap_swpm_generate_inifile is specified # 2 - There is no file 'inifile.params' available in 'sap_swpm_inifile_directory' -- name: SAP SWPM Pre Install - Create the SWPM inifile 'inifile.params' dynamically +- name: SAP SWPM Pre Install, create inifile - Create the SWPM inifile 'inifile.params' dynamically when: "'sap_swpm_generate_inifile' in ansible_run_tags or (not __sap_swpm_register_stat_sapinst_inifile.stat.exists)" block: # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params - - name: SAP SWPM Pre Install - Process SWPM inifile template for for creating 'inifile.params' + - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for for creating 'inifile.params' ansible.builtin.template: src: "{{ role_path }}/templates/inifile_params.j2" dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" @@ -66,7 +82,7 @@ tags: sap_swpm_generate_inifile # Generate inifile.params, step 2: Use any entries from sap_swpm_inifile_parameters_dict - - name: SAP SWPM Pre Install - Replace existing, or add missing, any inifile.params entries from sap_swpm_inifile_parameters_dict + - name: SAP SWPM Pre Install, create inifile - Use any 'inifile.params' entries from sap_swpm_inifile_parameters_dict ansible.builtin.lineinfile: path: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" create: true @@ -117,4 +133,3 @@ - name: SAP SWPM Pre Install - Display the path of the remote 'inifile.params' ansible.builtin.debug: msg: "The local inifile.params has been copied to: '{{ sap_swpm_tmpdir.path }}/inifile.params'" -# tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index e34fd5029..0dc5718f1 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -17,18 +17,14 @@ # state: directory # mode: '0777' # delegate_to: localhost -# tags: -# - sap_swpm_generate_inifile -# - sap_swpm_sapinst_commandline - name: SAP SWPM Pre Install - Create temporary directory on managed node ansible.builtin.tempfile: state: directory suffix: _swpm_config register: sap_swpm_tmpdir -# tags: -# - sap_swpm_generate_inifile -# - sap_swpm_sapinst_commandline + tags: + - sap_swpm_sapinst_commandline # Copy password file to the same location as inifile.params - name: SAP SWPM Pre Install - Copy password file to the same location as inifile.params @@ -38,7 +34,6 @@ remote_src: yes mode: '0640' when: sap_swpm_use_password_file == "y" -# tags: sap_swpm_generate_inifile # Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... - name: SAP SWPM default mode - Determine Installation Type diff --git a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml b/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml deleted file mode 100644 index f2257998f..000000000 --- a/roles/sap_swpm/tasks/swpm/swpm_inifile_generate_inifile_reuse.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Copy reused inifile -- name: SAP SWPM inifile_reuse mode - Copy reused inifile - ansible.builtin.copy: - src: "{{ sap_swpm_inifile_reuse_source }}" - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - mode: '0640' - tags: sap_swpm_generate_inifile - -# Check inifile for the presence of a line containing "des25(" -- name: SAP SWPM inifile_reuse mode - Check inifile for des25 - ansible.builtin.shell: | - set -o pipefail && cat "{{ sap_swpm_tmpdir.path }}/inifile.params" | - awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' - register: sap_swpm_inifile_read_file - changed_when: false - tags: sap_swpm_generate_inifile - -# Check if inifile is reusable - function des25 must not be present in inifile -- name: SAP SWPM inifile_reuse mode - Check if inifile is reusable, meaning function des25 is not present - ansible.builtin.fail: - msg: "{{ sap_swpm_inifile_reuse_source }} is not reusable" - when: sap_swpm_inifile_read_file.stdout != '0' - tags: sap_swpm_generate_inifile From 7eb407d8a12b340f4e98e683503eb5335f69722e Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 7 Aug 2024 23:06:46 +0200 Subject: [PATCH 121/210] sap_swpm: Reorganize yml files, part 2 Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 4 +- .../tasks/pre_install/generate_inifile.yml | 37 ++++++++++++++----- .../tasks/pre_install/set_password_facts.yml | 24 ------------ .../tasks/pre_install/swpm_prepare.yml | 22 ++++------- roles/sap_swpm/templates/inifile_params.j2 | 2 +- 5 files changed, 38 insertions(+), 51 deletions(-) delete mode 100644 roles/sap_swpm/tasks/pre_install/set_password_facts.yml diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index bb2b63f03..d008bd965 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -3,8 +3,8 @@ - name: SAP SWPM Pre Install - Rename variables ansible.builtin.set_fact: - sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list) }}" - sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary | d(sap_swpm_inifile_parameters_dict) }}" + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list | d([]) ) }}" + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary | d(sap_swpm_inifile_parameters_dict) | d({}) }}" tags: always ################ diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 2f026bbe1..1061e6914 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -1,11 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Password Facts -- name: SAP SWPM Pre Install - Set password facts - ansible.builtin.include_tasks: "set_password_facts.yml" - tags: sap_swpm_generate_inifile - # The following task is used for checking if an inifile exists on the managed node - name: SAP SWPM Pre Install - Ensure the sapinst inifile directory '{{ sap_swpm_inifile_directory }}' exists on the managed node ansible.builtin.file: @@ -63,10 +58,37 @@ # We are creating the inifile dynamically in one of the two cases: # 1 - The tag sap_swpm_generate_inifile is specified # 2 - There is no file 'inifile.params' available in 'sap_swpm_inifile_directory' +# Prerequisite: Role parameter 'sap_swpm_product_catalog_id' is defined - name: SAP SWPM Pre Install, create inifile - Create the SWPM inifile 'inifile.params' dynamically when: "'sap_swpm_generate_inifile' in ansible_run_tags or (not __sap_swpm_register_stat_sapinst_inifile.stat.exists)" block: + - name: SAP SWPM Pre Install - Ensure role parameter 'sap_swpm_product_catalog_id' is defined + ansible.builtin.fail: + msg: + - "Role parameter 'sap_swpm_product_catalog_id' is not defined, so certain inifile entries cannot be determined." + - "Remediation: Define the role parameter 'sap_swpm_product_catalog_id' in your playbook or inventory and re-run the playbook." + when: sap_swpm_product_catalog_id is not defined + +# 3 tasks for setting password Facts, required for the template: + - name: SAP SWPM Pre Install - Set password facts when ABAP + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" + when: "'ABAP' in sap_swpm_product_catalog_id" + + - name: SAP SWPM Pre Install - Set password facts when Java + ansible.builtin.set_fact: + sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" + sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" + when: "'Java' in sap_swpm_product_catalog_id" + + - name: SAP SWPM Pre Install - Set other user passwords using master password + ansible.builtin.set_fact: + sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" + sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" + # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for for creating 'inifile.params' ansible.builtin.template: @@ -110,16 +132,12 @@ - name: SAP SWPM Pre Install - Detect Variables ansible.builtin.include_tasks: file: detect_variables_from_inifile.yml -# apply: -# tags: sap_swpm_generate_inifile -# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Slurp the local 'inifile.params' for copying to managed node ansible.builtin.slurp: src: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" register: sap_swpm_slurped_local_inifile delegate_to: localhost -# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Copy 'inifile.params' to the managed node ansible.builtin.copy: @@ -128,7 +146,6 @@ owner: 'root' group: 'root' mode: '0640' -# tags: sap_swpm_generate_inifile - name: SAP SWPM Pre Install - Display the path of the remote 'inifile.params' ansible.builtin.debug: diff --git a/roles/sap_swpm/tasks/pre_install/set_password_facts.yml b/roles/sap_swpm/tasks/pre_install/set_password_facts.yml deleted file mode 100644 index 96010efba..000000000 --- a/roles/sap_swpm/tasks/pre_install/set_password_facts.yml +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Password Facts -- name: SAP SWPM Pre Install - Set password facts when ABAP - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_abap_password }}" - when: "'ABAP' in sap_swpm_product_catalog_id" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM Pre Install - Set password facts when Java - ansible.builtin.set_fact: - sap_swpm_db_schema: "{{ sap_swpm_db_schema_java }}" - sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" - when: "'Java' in sap_swpm_product_catalog_id" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM Pre Install - Set other user passwords using master password - ansible.builtin.set_fact: - sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" - tags: sap_swpm_generate_inifile diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index 0dc5718f1..aef72126c 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -35,31 +35,25 @@ mode: '0640' when: sap_swpm_use_password_file == "y" -# Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... -- name: SAP SWPM default mode - Determine Installation Type - ansible.builtin.include_tasks: - file: install_type.yml - apply: - tags: sap_swpm_generate_inifile - tags: sap_swpm_generate_inifile - # Create the SWPM inifile - name: SAP SWPM Pre Install - Generate the SWPM inifile ansible.builtin.include_tasks: "generate_inifile.yml" tags: sap_swpm_generate_inifile +# Determine Installation Type, e.g. System Copy, HA, Maintenance Planner, ... +- name: SAP SWPM default mode - Determine Installation Type + ansible.builtin.include_tasks: + file: install_type.yml +# apply: +# tags: sap_swpm_generate_inifile +# tags: sap_swpm_generate_inifile + # Requires variables - sap_swpm_software_path (e.g. /software/download_basket), sap_swpm_sapcar_path (e.g. /software/sapcar), sap_swpm_swpm_path (e.g. /software/swpm) # Prepare Software - name: SAP SWPM Pre Install - Prepare Software ansible.builtin.include_tasks: prepare_software.yml when: sap_swpm_run_sapinst -#- name: SAP SWPM Pre Install - Display the location of file 'inifile.params' -# ansible.builtin.debug: -# msg: "/tmp/inifile.params" -# msg: "{{ sap_swpm_tmpdir.path }}/inifile.params" -# tags: sap_swpm_generate_inifile - # Set fact for SWPM path - name: SAP SWPM Pre Install - Set fact for SWPM path when extract directory defined ansible.builtin.set_fact: diff --git a/roles/sap_swpm/templates/inifile_params.j2 b/roles/sap_swpm/templates/inifile_params.j2 index 576259d92..09dafcfa5 100644 --- a/roles/sap_swpm/templates/inifile_params.j2 +++ b/roles/sap_swpm/templates/inifile_params.j2 @@ -1,4 +1,4 @@ -### inifile.params generated for SWPM. Product Catalog ID is {{ sap_swpm_product_catalog_id }} . +### inifile.params generated for SWPM - Product Catalog ID is {{ sap_swpm_product_catalog_id }} {% if 'swpm_installation_media' in sap_swpm_inifile_sections_list %} ################################################################### From a9323cd2574d74b6b79013f5d932b60c22bc5f79 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 9 Aug 2024 11:58:42 +0200 Subject: [PATCH 122/210] sap_swpm: Improve variable detection Signed-off-by: Bernd Finger --- roles/sap_swpm/defaults/main.yml | 4 +- .../detect_variables_from_inifile.yml | 64 +++-------- .../tasks/pre_install/generate_inifile.yml | 105 ++++++++++++------ .../tasks/pre_install/swpm_prepare.yml | 7 -- roles/sap_swpm/templates/inifile_params.j2 | 2 +- 5 files changed, 92 insertions(+), 90 deletions(-) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index 9977972ec..8bb00e901 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -156,7 +156,7 @@ sap_swpm_software_extract_directory: # e.g. /software/sap_swpm_extracted sap_swpm_software_use_media: 'false' # Main path that this role will look for .SAR files -sap_swpm_software_path: /software/sapfiles +#sap_swpm_software_path: /software/sapfiles ## This directory path should include these files: ## - igs*sar ## - igshelper*sar @@ -166,7 +166,7 @@ sap_swpm_software_path: /software/sapfiles ## - SAPHOSTAGENT*SAR # Directory in which a sapinst inifile which is to be used by the role can be stored: -sap_swpm_inifile_directory: "{{ sap_swpm_software_path }}/inifiles" +sap_swpm_inifile_directory: '/software/sap_swpm/inifiles' #sap_swpm_local_inifile_directory: '/tmp/inifiles' # SWPM1 - paths that this role will look for CD Media software diff --git a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml index ce9dc4794..7d362714e 100644 --- a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml @@ -2,7 +2,7 @@ --- # Detect Product ID -- name: SAP SWPM - Detect Product ID +- name: SAP SWPM Pre Install - Detect Product ID from inifile ansible.builtin.command: | awk 'BEGIN{IGNORECASE=1;a=0} /Product ID/&&a==0{a=1; gsub ("#", ""); gsub ("\047", ""); product_id=$NF} @@ -10,75 +10,43 @@ delegate_to: localhost register: sap_swpm_inifile_product_id_detect changed_when: false - when: not sap_swpm_product_catalog_id is defined -# Set fact for product id -- name: SAP SWPM - Set SAP product ID +- name: SAP SWPM Pre Install - Set SAP product ID ansible.builtin.set_fact: sap_swpm_product_catalog_id: "{{ sap_swpm_inifile_product_id_detect.stdout }}" - when: not sap_swpm_product_catalog_id is defined -- name: SAP SWPM - Display SAP product ID - ansible.builtin.debug: - msg: - - "Product ID is {{ sap_swpm_product_catalog_id }}" - -# Detect Software Path -- name: SAP SWPM - Detect Software Path +# Detect and set Software Path +- name: SAP SWPM Pre Install - Detect Software Path from inifile ansible.builtin.command: | awk '!/^#/&&/archives.downloadBasket/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params delegate_to: localhost - register: sap_swpm_inifile_software_path + register: sap_swpm_inifile_software_path_detect changed_when: false - when: not sap_swpm_software_path is defined -# Set fact for software path -- name: SAP SWPM - Set Software Path +- name: SAP SWPM Pre Install - Set Software Path ansible.builtin.set_fact: - sap_swpm_software_path: "{{ sap_swpm_inifile_software_path.stdout }}" - when: not sap_swpm_software_path is defined - -- name: SAP SWPM - Display Software Path - ansible.builtin.debug: - msg: - - "Software path is {{ sap_swpm_software_path }}" + sap_swpm_software_path: "{{ sap_swpm_inifile_software_path_detect.stdout }}" -# Detect SID -- name: SAP SWPM - Detect SID +# Detect and set SID +- name: SAP SWPM Pre Install - Detect SID from inifile ansible.builtin.command: | awk '!/^#/&&/NW_GetSidNoProfiles.sid/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params delegate_to: localhost - register: sap_swpm_inifile_sid + register: sap_swpm_inifile_sid_detect changed_when: false - when: not sap_swpm_sid is defined -# Set fact for SID -- name: SAP SWPM - Set SID +- name: SAP SWPM Pre Install - Set SID from inifile ansible.builtin.set_fact: - sap_swpm_sid: "{{ sap_swpm_inifile_sid.stdout }}" - when: not sap_swpm_sid is defined - -- name: SAP SWPM - Display SAP SID - ansible.builtin.debug: - msg: - - "SAP SID {{ sap_swpm_sid }}" + sap_swpm_sid: "{{ sap_swpm_inifile_sid_detect.stdout }}" # Detect FQDN -- name: SAP SWPM - Detect FQDN +- name: SAP SWPM Pre Install - Detect FQDN from inifile ansible.builtin.command: | awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params delegate_to: localhost - register: sap_swpm_inifile_fqdn + register: sap_swpm_inifile_fqdn_detect changed_when: false - when: not sap_swpm_fqdn is defined -# Set fact for FQDN -- name: SAP SWPM - Set FQDN +- name: SAP SWPM Pre Install - Set FQDN ansible.builtin.set_fact: - sap_swpm_fqdn: "{{ sap_swpm_inifile_fqdn.stdout }}" - when: not sap_swpm_fqdn is defined - -- name: SAP SWPM - Display FQDN - ansible.builtin.debug: - msg: - - "SAP fqdn {{ sap_swpm_fqdn }}" + sap_swpm_fqdn: "{{ sap_swpm_inifile_fqdn_detect.stdout }}" diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 1061e6914..c8cdf1dd1 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -20,13 +20,13 @@ when: __sap_swpm_register_stat_sapinst_inifile.stat.exists block: - - name: SAP SWPM Pre Install, use existing inifile - Notify about existing sapinst inifile on the managed node + - name: SAP SWPM Pre Install, existing inifile - Notify about existing sapinst inifile on the managed node ansible.builtin.debug: msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." # Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. # So we are using 'slurp' and 'copy' for this purpose. - - name: SAP SWPM Pre Install, use existing inifile - Slurp the remote 'inifile.params' for copying to control node + - name: SAP SWPM Pre Install, existing inifile - Slurp the remote 'inifile.params' for copying to control node ansible.builtin.slurp: src: "{{ sap_swpm_inifile_directory }}/inifile.params" register: sap_swpm_slurped_remote_inifile @@ -41,36 +41,66 @@ delegate_to: localhost # Now we need to confirm that des25 is not in the inifile - - name: SAP SWPM Pre Install, use existing inifile - Search inifile for for des25 + - name: SAP SWPM Pre Install, existing inifile - Search inifile for for des25 ansible.builtin.shell: | set -o pipefail && awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' {{ sap_swpm_tmpdir_local.path }}/inifile.params delegate_to: localhost register: sap_swpm_inifile_count_des25 changed_when: false - - name: SAP SWPM Pre Install, use existing inifile - Ensure that des25 is not present in inifile + - name: SAP SWPM Pre Install, existing inifile - Ensure that des25 is not present in inifile ansible.builtin.fail: msg: - "Inifile '{{ sap_swpm_inifile_directory }}/inifile.params' cannot be reused because it contains des25 encrypted data." - "See also SAP notes 2609804." when: sap_swpm_inifile_count_des25.stdout != '0' + - name: SAP SWPM Pre Install - Detect Variables + ansible.builtin.import_tasks: + file: detect_variables_from_inifile.yml + +# At this point, the following variables need to be set: +# sap_swpm_product_catalog_id, sap_swpm_software_path, sap_swpm_sid, sap_swpm_fqdn +- name: SAP SWPM Pre Install - Assert that certain variables are set + ansible.builtin.assert: + that: "{{ __sap_swpm_vars_line_item }} is defined and {{ __sap_swpm_vars_line_item }}" + fail_msg: "FAIL: '{{ __sap_swpm_vars_line_item }}' is either undefined or empty!" + success_msg: "PASS: '{{ __sap_swpm_vars_line_item }}' is set.<" + loop: + - sap_swpm_product_catalog_id + - sap_swpm_software_path + - sap_swpm_sid + - sap_swpm_fqdn + loop_control: + loop_var: __sap_swpm_vars_line_item + label: __sap_swpm_vars_line_item + tags: sap_swpm_generate_inifile + +- name: SAP SWPM Pre Install - Display these variables + ansible.builtin.debug: + msg: + - "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<" + - "sap_swpm_software_path: >{{ sap_swpm_software_path }}<" + - "sap_swpm_sid: >{{ sap_swpm_sid }}<" + - "sap_swpm_fqdn: >{{ sap_swpm_fqdn }}<" + # We are creating the inifile dynamically in one of the two cases: # 1 - The tag sap_swpm_generate_inifile is specified # 2 - There is no file 'inifile.params' available in 'sap_swpm_inifile_directory' # Prerequisite: Role parameter 'sap_swpm_product_catalog_id' is defined - name: SAP SWPM Pre Install, create inifile - Create the SWPM inifile 'inifile.params' dynamically when: "'sap_swpm_generate_inifile' in ansible_run_tags or (not __sap_swpm_register_stat_sapinst_inifile.stat.exists)" + tags: sap_swpm_generate_inifile block: - - name: SAP SWPM Pre Install - Ensure role parameter 'sap_swpm_product_catalog_id' is defined - ansible.builtin.fail: - msg: - - "Role parameter 'sap_swpm_product_catalog_id' is not defined, so certain inifile entries cannot be determined." - - "Remediation: Define the role parameter 'sap_swpm_product_catalog_id' in your playbook or inventory and re-run the playbook." - when: sap_swpm_product_catalog_id is not defined +# - name: SAP SWPM Pre Install - Ensure role parameter 'sap_swpm_product_catalog_id' is defined +# ansible.builtin.fail: +# msg: +# - "Role parameter 'sap_swpm_product_catalog_id' is empty or not defined, so certain inifile entries cannot be determined." +# - "Remediation: Define the role parameter 'sap_swpm_product_catalog_id' in your playbook or inventory and re-run the playbook." +# when: sap_swpm_product_catalog_id is not defined or not sap_swpm_product_catalog_id -# 3 tasks for setting password Facts, required for the template: +# 3 tasks for setting password Facts, required by the template: - name: SAP SWPM Pre Install - Set password facts when ABAP ansible.builtin.set_fact: sap_swpm_db_schema: "{{ sap_swpm_db_schema_abap }}" @@ -101,38 +131,49 @@ when: - sap_swpm_inifile_sections_list is defined - sap_swpm_inifile_sections_list | length > 0 - tags: sap_swpm_generate_inifile # Generate inifile.params, step 2: Use any entries from sap_swpm_inifile_parameters_dict - - name: SAP SWPM Pre Install, create inifile - Use any 'inifile.params' entries from sap_swpm_inifile_parameters_dict - ansible.builtin.lineinfile: - path: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" - create: true - state: present - line: "{{ sap_swpm_line_item.key }} = {{ sap_swpm_line_item.value }}" - regexp: "^{{ sap_swpm_line_item.key }}[\\s]*=[\\s]*.*" - owner: 'root' - group: 'root' - mode: '0640' - loop: "{{ sap_swpm_inifile_parameters_dict | dict2items }}" - loop_control: - loop_var: sap_swpm_line_item - register: replace_result - delegate_to: localhost + - name: SAP SWPM Pre Install, create inifile - Use any 'inifile.params' entries from 'sap_swpm_inifile_parameters_dict' when: - sap_swpm_inifile_parameters_dict is defined - sap_swpm_inifile_parameters_dict | length > 0 - tags: sap_swpm_generate_inifile + block: + + - name: SAP SWPM Pre Install, create inifile - Configure entries in 'inifile.params' from 'sap_swpm_inifile_parameters_dict' + ansible.builtin.lineinfile: + path: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + create: true + state: present + line: "{{ sap_swpm_line_item.key }} = {{ sap_swpm_line_item.value }}" + regexp: "^{{ sap_swpm_line_item.key }}[\\s]*=[\\s]*.*" + owner: 'root' + group: 'root' + mode: '0640' + loop: "{{ sap_swpm_inifile_parameters_dict | dict2items }}" + loop_control: + loop_var: sap_swpm_line_item + register: replace_result + delegate_to: localhost + + - name: SAP SWPM Pre Install, create inifile - Detect variables again if 'sap_swpm_inifile_parameters_dict' had been used + ansible.builtin.import_tasks: + file: detect_variables_from_inifile.yml + delegate_to: localhost + + - name: SAP SWPM Pre Install, create inifile - Display these variables again if 'sap_swpm_inifile_parameters_dict' had been used + ansible.builtin.debug: + msg: + - "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<" + - "sap_swpm_software_path: >{{ sap_swpm_software_path }}<" + - "sap_swpm_sid: >{{ sap_swpm_sid }}<" + - "sap_swpm_fqdn: >{{ sap_swpm_fqdn }}<" + delegate_to: localhost - name: SAP SWPM Pre Install - Display the path of the local 'inifile.params' ansible.builtin.debug: msg: "The local inifile.params is: '{{ sap_swpm_tmpdir_local.path }}/inifile.params'" tags: sap_swpm_generate_inifile -- name: SAP SWPM Pre Install - Detect Variables - ansible.builtin.include_tasks: - file: detect_variables_from_inifile.yml - - name: SAP SWPM Pre Install - Slurp the local 'inifile.params' for copying to managed node ansible.builtin.slurp: src: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index aef72126c..bbb21945a 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -11,13 +11,6 @@ - sap_swpm_generate_inifile - sap_swpm_sapinst_commandline -#- name: SAP SWPM Pre Install - Make the temporary directory on control node world readable -# ansible.builtin.file: -# path: "{{ sap_swpm_tmpdir_local.path }}" -# state: directory -# mode: '0777' -# delegate_to: localhost - - name: SAP SWPM Pre Install - Create temporary directory on managed node ansible.builtin.tempfile: state: directory diff --git a/roles/sap_swpm/templates/inifile_params.j2 b/roles/sap_swpm/templates/inifile_params.j2 index 09dafcfa5..341be8d38 100644 --- a/roles/sap_swpm/templates/inifile_params.j2 +++ b/roles/sap_swpm/templates/inifile_params.j2 @@ -1,4 +1,4 @@ -### inifile.params generated for SWPM - Product Catalog ID is {{ sap_swpm_product_catalog_id }} +### inifile.params generated for SWPM - Product ID is {{ sap_swpm_product_catalog_id }} {% if 'swpm_installation_media' in sap_swpm_inifile_sections_list %} ################################################################### From f3b238183c6fb1b2a5ab8bf03c8d94568cea4717 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 12 Aug 2024 11:46:36 +0200 Subject: [PATCH 123/210] sap_swpm: Fix typo in README.md Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index f9e03a94b..ae850ff2d 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -182,7 +182,7 @@ sap_swpm_inifile_parameters_dict: It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: Just define both of the related parameters, `sap_swpm_inifile_sections_list` and `sap_swpm_inifile_parameters_dict`. -- The file inifile.params is then transferred to a temporary directory on the control node, to be used by the sapinst process. +- The file inifile.params is then transferred to a temporary directory on the managed node, to be used by the sapinst process. ### SAP SWPM From c72bbf122259538344ca997f43f12c899462448e Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Mon, 12 Aug 2024 11:48:00 +0200 Subject: [PATCH 124/210] feat: totem platform dictionary --- .../vars/platform_cloud_aws_ec2_vs.yml | 36 +++++++++++++++++-- .../vars/platform_cloud_gcp_ce_vm.yml | 33 ++++++++++++----- .../vars/platform_cloud_ibmcloud_powervs.yml | 11 ++++++ .../vars/platform_cloud_ibmcloud_vs.yml | 11 ++++++ .../vars/platform_cloud_msazure_vm.yml | 18 ++++++++-- .../vars/platform_hyp_ibmpower_vm.yml | 11 ++++++ 6 files changed, 107 insertions(+), 13 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index aa040891c..b00659f1c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -181,9 +181,41 @@ __sap_ha_pacemaker_cluster_stonith_default: # Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +# Documentation sources: +# HANA: +# SLES: https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration.html#sap-hana-on-aws-create-the-corosync-configuration-file +# https://documentation.suse.com/sbp/sap-15/html/SLES4SAP-hana-sr-guide-perfopt-15-aws/index.html#id-example-for-etccorosynccorosync-conf +# RHEL: https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-cluster-configuration-1.html#sap-hana-on-aws-corosync-increase +# NWAS: +# SLES: https://docs.aws.amazon.com/sap/latest/sap-netweaver/sap-netweaver-ha-setup.html#associations +# RHEL: https://docs.aws.amazon.com/sap/latest/sap-netweaver/rhel-sap-netweaver-ha-setup.html#associations +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + redhat_hana: + options: + token: 30000 + + redhat_nwas: + options: + token: 30000 + + suse_hana: + options: + token: 30000 + consensus: 36000 + token_retransmits_before_loss_const: 6 + clear_node_high_bit: 'yes' + + suse_nwas: + options: + token: 30000 + consensus: 36000 + clear_node_high_bit: 'yes' + __sap_ha_pacemaker_cluster_corosync_totem_platform: - options: - token: 30000 + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict[ansible_os_family | lower ~ '_hana'] + if sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 + else __sap_ha_pacemaker_cluster_corosync_totem_platform_dict[ansible_os_family | lower ~ '_nwas'] }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 9fb4c18f3..cb38f9e5d 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -66,6 +66,30 @@ __sap_ha_pacemaker_cluster_stonith_default: "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" +# Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +# Documentation sources: +# HANA: +# SLES: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_the_corosync_configuration_files +# RHEL: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-rhel#edit_the_corosyncconf_default_settings +# NWAS: +# SLES: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-sles#create_the_corosync_configuration_files +# RHEL: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-rhel#update_the_corosync_configuration_files +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + redhat: + options: + token: 20000 + token_retransmits_before_loss_const: 10 + join: 60 + max_messages: 20 + suse: + options: + token: 20000 + +__sap_ha_pacemaker_cluster_corosync_totem_platform: + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict[ansible_os_family | lower] }}" + + # GCP needs haproxy and ports defined sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- @@ -78,15 +102,6 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" -# Default corosync options - Platform specific -__sap_ha_pacemaker_cluster_corosync_totem_platform: - options: - token: 20000 - token_retransmits_before_loss_const: 10 - join: 60 - max_messages: 20 - - # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: gcp_nlb_reserved_ip_haproxy # gcp_vpc_move_route sap_ha_pacemaker_cluster_vip_group_prefix: group_ diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index ce9fdb30d..a1314928a 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -62,6 +62,17 @@ __sap_ha_pacemaker_cluster_stonith_default: "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" +# Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + generic: + options: + token: 30000 + +__sap_ha_pacemaker_cluster_corosync_totem_platform: + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict.generic }}" + + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: ipaddr_custom diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index 33f604170..c058300a9 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -38,6 +38,17 @@ __sap_ha_pacemaker_cluster_stonith_default: "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" +# Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + generic: + options: + token: 30000 + +__sap_ha_pacemaker_cluster_corosync_totem_platform: + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict.generic }}" + + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: ibmcloud_alb_haproxy diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index 8a17d6621..875dbd721 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -99,9 +99,23 @@ __sap_ha_pacemaker_cluster_stonith_default: # Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +# Documentation sources: +# SLES: https://learn.microsoft.com/en-us/azure/sap/workloads/high-availability-guide-suse-pacemaker?tabs=msi#install-the-cluster 15.A +# RHEL: https://learn.microsoft.com/en-us/azure/sap/workloads/high-availability-guide-suse-pacemaker?tabs=msi#install-the-cluster +# NOTE: Azure does not differentiate between HANA and ASCS pacemaker setup. +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + redhat: + options: + token: 30000 + suse: + options: + token: 30000 + consensus: 36000 + __sap_ha_pacemaker_cluster_corosync_totem_platform: - options: - token: 30000 + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict[ansible_os_family | lower] }}" + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: azure_lb diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index 5574bcc26..8410754ec 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -58,6 +58,17 @@ __sap_ha_pacemaker_cluster_stonith_default: "{{ __sap_ha_pacemaker_cluster_stonith_default_dict.generic }}" +# Default corosync options - Platform specific +# These options combined with __sap_ha_pacemaker_cluster_corosync_totem_default (Same options are overwritten). +__sap_ha_pacemaker_cluster_corosync_totem_platform_dict: + generic: + options: + token: 30000 + +__sap_ha_pacemaker_cluster_corosync_totem_platform: + "{{ __sap_ha_pacemaker_cluster_corosync_totem_platform_dict.generic }}" + + # Platform specific VIP handling sap_ha_pacemaker_cluster_vip_method: ipaddr From ead9d1c6de14ef45e0f2e16175712486ffbb7075 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 15 Aug 2024 15:13:23 +0200 Subject: [PATCH 125/210] added assert mode --- playbooks/sap_hana_preconfigure.yml | 71 +++++++++++++++++------------ 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 36c135810..becf0922d 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -12,6 +12,7 @@ # - name: Playbook Usage hosts: localhost + gather_facts: false tasks: - name: Playbook Usage ansible.builtin.debug: @@ -28,44 +29,54 @@ * sap_hana_preconfigure_exec.yml instead with a properly prepared variable * * file. (See README for more details) * ***************************************************************************** + "" - name: Collecting Variables hosts: localhost vars_prompt: - name: "sap_systems" - prompt: "Enter comma separated list of systems, you want to prepare for SAP HANA" + prompt: "Enter comma separated list of systems that you want to prepare for SAP HANA" private: false - default: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" + default: "{{ (groups['all'] == []) | ternary ('localhost', 'all') }}" + # default: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" - name: "sap_domain" - prompt: "Enter DNS Domainname of your SAP systems (leave empty for using system default: " + prompt: "Enter DNS Domainname of your SAP systems (leave empty for using system defaul): " private: false default: "{{ sap_domain | d('') }}" - - name: "sap_update_hosts" - prompt: "Do you want the system to update /etc/hosts for SAP (y/n)" - private: false - default: "y" - - - name: "sap_update" - prompt: "Do you want to update the system? (y/n)" - private: false - default: "n" - - - name: "sap_fail_if_reboot_required" - prompt: "Do you want to stop with an error if the system needs a reboot? (y/n)" - private: false - default: "n" - - - name: "sap_reboot" - prompt: "Do you want to reboot the system if required? (y/n)" + - name: "assert" + prompt: "Do you want to check the current setup only (assert mode)? (y/n)" private: false default: "n" tasks: + - name: Input addtional parameters if no assert mode is defined + when: assert != "y" + block: + - ansible.builtin.pause: # noqa name[missing] - role default true + prompt: "Do you want the system to update /etc/hosts for SAP? (y/n) [y]" + echo: true + register: _sap_update_hosts + - ansible.builtin.pause: # noqa name[missing] - role default false + prompt: "Do you want to update the system? (y/n) [n]" + echo: true + register: _sap_update + - ansible.builtin.pause: # noqa name[missing] - role default false + prompt: "Do you want to reboot the system if required? (y/n) [n]" + echo: true + register: _sap_reboot + - ansible.builtin.pause: # noqa name[missing] - role default true + prompt: "Do you want to stop with an error if the system needs a reboot? (y/n) [y]" + echo: true + register: _sap_fail_if_reboot_required + when: _sap_reboot.user_input != 'y' + - name: Prepare inventory - when: sap_systems != 'localhost' + when: + - sap_systems != 'localhost' + - sap_systems != 'all' ansible.builtin.add_host: groups: sap_hana_prepare_hosts name: '{{ item }}' @@ -75,25 +86,29 @@ ansible.builtin.set_fact: sap_domain: '{{ sap_domain }}' ### redhat.sap_install.sap_general_preconfigure - sap_general_preconfigure_modify_etc_hosts: '{{ (sap_update_hosts == "y") | ternary(true, false) }}' - sap_general_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' - sap_general_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' + sap_general_preconfigure_modify_etc_hosts: '{{ (_sap_update_hosts.user_input is defined) and (_sap_update_hosts.user_input == "n") | ternary(false, true) }}' # default true + sap_general_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false + sap_general_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true + sap_general_preconfigure_assert: '{{ (assert=="y") | ternary(true,false) }}' # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' ### redhat.sap_install.sap_hana_preconfigure - sap_hana_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' - sap_hana_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' - sap_hana_preconfigure_reboot_ok: '{{ (sap_reboot == "n") | ternary(false, true) }}' + sap_hana_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false + sap_hana_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true + sap_hana_preconfigure_reboot_ok: '{{ (_sap_reboot.user_input is defined) and (_sap_reboot.user_input == "y") | ternary(true, false) }}' # default false + sap_hana_preconfigure_assert: '{{ (assert=="y") | ternary(true,false) }}' # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - name: Run sap_hana_prepare_exec playbook ansible.builtin.import_playbook: sap_hana_preconfigure_exec.yml vars: sap_playbook_parameter_confirm: true - sap_hana_group: "{{ ( groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts','localhost') }}" + sap_hana_group: "{{ ( groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts',omit) }}" sap_domain: "{{ hostvars['localhost']['sap_domain'] }}" sap_general_preconfigure_modify_etc_hosts: "{{ hostvars['localhost']['sap_general_preconfigure_modify_etc_hosts'] }}" sap_general_preconfigure_update: "{{ hostvars['localhost']['sap_general_preconfigure_update'] }}" sap_general_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_general_preconfigure_fail_if_reboot_required'] }}" + sap_general_preconfigure_assert: "{{ hostvars['localhost']['sap_general_preconfigure_assert'] }}" sap_hana_preconfigure_update: "{{ hostvars['localhost']['sap_hana_preconfigure_update'] }}" sap_hana_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_hana_preconfigure_fail_if_reboot_required'] }}" sap_hana_preconfigure_reboot_ok: "{{ hostvars['localhost']['sap_hana_preconfigure_reboot_ok'] }}" + sap_hana_preconfigure_assert: "{{ hostvars['localhost']['sap_hana_preconfigure_assert'] }}" From 5cb5088d50329c6bac9090ef65165f7c1ddf598e Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 15 Aug 2024 15:25:57 +0200 Subject: [PATCH 126/210] changed assert behaviour --- playbooks/sap_hana_preconfigure.yml | 2 ++ playbooks/sap_hana_preconfigure_exec.yml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index becf0922d..b67681e25 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -108,7 +108,9 @@ sap_general_preconfigure_update: "{{ hostvars['localhost']['sap_general_preconfigure_update'] }}" sap_general_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_general_preconfigure_fail_if_reboot_required'] }}" sap_general_preconfigure_assert: "{{ hostvars['localhost']['sap_general_preconfigure_assert'] }}" + sap_general_preconfigure_assert_ignore_errors: true sap_hana_preconfigure_update: "{{ hostvars['localhost']['sap_hana_preconfigure_update'] }}" sap_hana_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_hana_preconfigure_fail_if_reboot_required'] }}" sap_hana_preconfigure_reboot_ok: "{{ hostvars['localhost']['sap_hana_preconfigure_reboot_ok'] }}" sap_hana_preconfigure_assert: "{{ hostvars['localhost']['sap_hana_preconfigure_assert'] }}" + sap_hana_preconfigure_assert_ignore_errors: true diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index f4e6eb7e8..7f10ae6ea 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -40,7 +40,6 @@ - name: Pause Playbook to verify parameters when: sap_playbook_parameter_confirm | d(false) ansible.builtin.pause: - prompt: Press enter to continue - name: Perform the general SAP configuration ansible.builtin.include_role: From 8ff11bf1a9f6fcd0b7655759f891e73f6edf4cb6 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 15 Aug 2024 15:32:50 +0200 Subject: [PATCH 127/210] Better Description --- playbooks/sap_hana_preconfigure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index b67681e25..3d28e7bbc 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -36,7 +36,7 @@ vars_prompt: - name: "sap_systems" - prompt: "Enter comma separated list of systems that you want to prepare for SAP HANA" + prompt: "Enter comma separated list of systems that you want to check or prepare for SAP HANA" private: false default: "{{ (groups['all'] == []) | ternary ('localhost', 'all') }}" # default: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" From 18a74466b1a6bde7d908744ff4070e2f2f4e2ebd Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 15 Aug 2024 16:13:01 +0200 Subject: [PATCH 128/210] sap_swpm: Add certain parameter consistency checks Signed-off-by: Bernd Finger --- .../detect_variables_from_inifile.yml | 34 +++++++++++++++++-- .../tasks/pre_install/generate_inifile.yml | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml index 7d362714e..541378960 100644 --- a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Detect Product ID +# Detect and set Product ID - name: SAP SWPM Pre Install - Detect Product ID from inifile ansible.builtin.command: | awk 'BEGIN{IGNORECASE=1;a=0} @@ -11,6 +11,13 @@ register: sap_swpm_inifile_product_id_detect changed_when: false +- name: SAP SWPM Pre Install - Report if 'sap_swpm_product_catalog_id' has been defined differently + ansible.builtin.debug: + msg: "NOTE: The Product ID in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_inifile_product_id_detect'." + when: + - sap_swpm_product_catalog_id + - sap_swpm_inifile_product_id_detect.stdout != sap_swpm_product_catalog_id + - name: SAP SWPM Pre Install - Set SAP product ID ansible.builtin.set_fact: sap_swpm_product_catalog_id: "{{ sap_swpm_inifile_product_id_detect.stdout }}" @@ -23,6 +30,13 @@ register: sap_swpm_inifile_software_path_detect changed_when: false +- name: SAP SWPM Pre Install - Report if 'sap_swpm_software_path' has been defined differently + ansible.builtin.debug: + msg: "NOTE: The Software Path in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_software_path'." + when: + - sap_swpm_software_path + - sap_swpm_inifile_software_path_detect.stdout != sap_swpm_software_path + - name: SAP SWPM Pre Install - Set Software Path ansible.builtin.set_fact: sap_swpm_software_path: "{{ sap_swpm_inifile_software_path_detect.stdout }}" @@ -35,11 +49,18 @@ register: sap_swpm_inifile_sid_detect changed_when: false -- name: SAP SWPM Pre Install - Set SID from inifile +- name: SAP SWPM Pre Install - Report if 'sap_swpm_sid' has been defined differently + ansible.builtin.debug: + msg: "NOTE: The SID in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_sid'." + when: + - sap_swpm_sid + - sap_swpm_inifile_sid_detect.stdout != sap_swpm_sid + +- name: SAP SWPM Pre Install - Set SID ansible.builtin.set_fact: sap_swpm_sid: "{{ sap_swpm_inifile_sid_detect.stdout }}" -# Detect FQDN +# Detect and set FQDN - name: SAP SWPM Pre Install - Detect FQDN from inifile ansible.builtin.command: | awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params @@ -47,6 +68,13 @@ register: sap_swpm_inifile_fqdn_detect changed_when: false +- name: SAP SWPM Pre Install - Report if 'sap_swpm_fqdn' has been defined differently + ansible.builtin.debug: + msg: "NOTE: The FQDN in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_fqdn'." + when: + - sap_swpm_fqdn + - sap_swpm_inifile_sid_detect.stdout != sap_swpm_fqdn + - name: SAP SWPM Pre Install - Set FQDN ansible.builtin.set_fact: sap_swpm_fqdn: "{{ sap_swpm_inifile_fqdn_detect.stdout }}" diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index c8cdf1dd1..53f4809ff 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -65,7 +65,7 @@ ansible.builtin.assert: that: "{{ __sap_swpm_vars_line_item }} is defined and {{ __sap_swpm_vars_line_item }}" fail_msg: "FAIL: '{{ __sap_swpm_vars_line_item }}' is either undefined or empty!" - success_msg: "PASS: '{{ __sap_swpm_vars_line_item }}' is set.<" + success_msg: "PASS: '{{ __sap_swpm_vars_line_item }}' is set." loop: - sap_swpm_product_catalog_id - sap_swpm_software_path From 495fe9c98dcd08ed654b7d13a5559d222d57ade7 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 15 Aug 2024 16:14:57 +0200 Subject: [PATCH 129/210] feat: new azure fence agent package for suse --- roles/sap_ha_pacemaker_cluster/vars/suse.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index d7c010280..c72abff6b 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -36,7 +36,11 @@ __sap_ha_pacemaker_cluster_fence_agent_packages_minimal: # Dictionary with fence packages for each platform # fence-agents are defined in __sap_ha_pacemaker_cluster_fence_agent_packages_minimal already. -# __sap_ha_pacemaker_cluster_fence_agent_packages_dict: +__sap_ha_pacemaker_cluster_fence_agent_packages_dict: + # Separate agent because of https://www.suse.com/support/kb/doc/?id=000021504 + # This package is present in SLES4SAP 15 SP4 and higher + cloud_msazure_vm: + - fence-agents-azure-arm # Dictionary with extra platform specific packages __sap_ha_pacemaker_cluster_platform_extra_packages_dict: From a678388ea459366853272efd3e820269a8c491d9 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Wed, 21 Aug 2024 11:45:06 +0200 Subject: [PATCH 130/210] fix: add exact size disk check on top of approximate --- .../map_single_disks_to_filesystems.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml b/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml index 004c9b85f..1fea460ed 100644 --- a/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml +++ b/roles/sap_storage_setup/tasks/generic_tasks/map_single_disks_to_filesystems.yml @@ -50,6 +50,8 @@ # defined already that is to be enhanced with single disk definitions, if # applicable. +# First pass assigns disks based on exact size. +# Second pass assigns disks based on approximate size -8GB and +8GB - name: SAP Storage Setup - Set fact for target filesystem device mapping ansible.builtin.set_fact: filesystem_device_map: "{{ filesystem_device_map | default([]) + __single_disk_to_fs_device_map }}" @@ -68,7 +70,21 @@ -%} {%- for dev in av_dev -%} + {%- if dev.value.size | regex_search('.*TB$') -%} + {% set disk_size_gb = (((( dev.value.size | replace(' TB','') | float * 1024) /8) | round(0,'ceil') * 8) | int) -%} + {%- else -%} + {% set disk_size_gb = (dev.value.size | regex_replace('(\.\d+\s*)', '') | replace('GB','') | int) -%} + {%- endif -%} + {%- if disk_size_gb == fs.disk_size + and dev.key not in assigned_dev + and dev.value.holders | length == 0 + and matching_dev | length < (fs.lvm_lv_stripes | d('1') | int) -%} + {%- set assigned = assigned_dev.append(dev.key) -%} + {%- set add = matching_dev.append('/dev/' + dev.key) -%} + {%- endif -%} + {%- endfor -%} + {%- for dev in av_dev -%} {%- if dev.value.size | regex_search('.*TB$') -%} {% set disk_size_gb = (((( dev.value.size | replace(' TB','') | float * 1024) /8) | round(0,'ceil') * 8) | int) -%} {%- else -%} @@ -82,7 +98,6 @@ {%- set assigned = assigned_dev.append(dev.key) -%} {%- set add = matching_dev.append('/dev/' + dev.key) -%} {%- endif -%} - {%- endfor -%} {%- if matching_dev | length > 0 -%} From 61f1b7d50b86ab0fe7d159169ac017d7cd84f673 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 22 Aug 2024 14:05:30 +0200 Subject: [PATCH 131/210] sap_swpm: Adapt README.md Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 69 ++++++++-------------------------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index ae850ff2d..410e4f4b8 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -63,59 +63,17 @@ This role has been tested and working for the following SAP products ### Input Parameters The inputs are critical for running this role - - Determines the installation type - - Incomplete parameters will result to failure - - Wrong parameters will result to failure + - Incomplete parameters will result in failure + - Wrong parameters will result in failure Create an input file which contains all relevant installation information. Sample input files are stored in the [inputs](/playbooks/vars) folder of this Ansible collection. Use the samples as guide for your desired installation ### Default Parameters -### Default Parameters - Please check the default parameters file for more information on other parameters that can be used as an input: - [**sap_swpm** default parameters](defaults/main.yml) -Sample Playbooks and sample parameters are shown in the Ansible Collection `/playbooks` directory. - -The Ansible Collection `/playbooks` directory includes sample playbooks for using the `sap_swpm` Ansible Role in the following 'modes': -- Default -- Default Templates -- Advanced -- Advanced Templates -- Inifile Reuse - -The Ansible Collection `/playbooks/vars` directory includes sample variable files for: -- `sap_swpm` 'Default mode' to generate inifile.params of... - - SAP BW/4HANA OneHost - - SAP S/4HANA Distributed - ASCS, DBCI, ERS, PAS - - SAP S/4HANA OneHost - - SAP S/4HANA System Copy OneHost - - SAP Solution Manager (ABAP) - - SAP Solution Manager (JAVA) - - SAP Web Dispatcher - - SAP System Rename -- `sap_swpm` 'Default Templates mode' to generate inifile.params of... - - SAP S/4HANA OneHost - - SAP S/4HANA System Copy OneHost - - SAP System Rename -- `sap_swpm` 'Advanced mode' to generate inifile.params of... - - SAP S/4HANA OneHost -- `sap_swpm` 'Advanced Templates mode' to generate inifile.params of... - - SAP BW/4HANA OneHost - - SAP S/4HANA Distributed - ASCS, DBCI, ERS, PAS - - SAP S/4HANA OneHost - - SAP S/4HANA System Copy OneHost - - SAP Solution Manager (ABAP) - - SAP Solution Manager (JAVA) - - SAP Web Dispatcher - - SAP System Rename -- `sap_swpm` 'Inifile Reuse mode' inifile.params file for... - - SAP S/4HANA OneHost - -NOTE: these are only sample files, they are meant to be edited by the user before execution and do not cover all scenarios possible (the Ansible Role can execute ant SAP SWPM installation) - ## Execution Sample Ansible Playbook Execution @@ -133,7 +91,7 @@ Sample Ansible Playbook Execution - hosts: all become: true roles: - - { role: sap_swpm } + - sap_swpm ``` ## Execution Flow @@ -153,22 +111,22 @@ Sample Ansible Playbook Execution - Get all .SAR filenames from `sap_swpm_software_path` -- Update `/etc/hosts` (optional - yes by default) +- Update `/etc/hosts` (optional - `false` by default) -- Apply firewall rules for SAP HANA (optional - no by default) +- Apply firewall rules for SAP HANA (optional - `false` by default) -- At this stage, a sapinst inifile is created by the role on the control node if not already present. +- At this stage, the role is searching for a sapinst inifile on the managed node, or it will create one: - If a file `inifile.params` is located on the managed node in the directory specified in `sap_swpm_inifile_directory`, the role will not create a new one but rather download this file to the control node. - - If such a file does not exist, the role will create an SAP SWPM `inifile.params` file by one of the following methods: + - If such a file does *not* exist, the role will create an SAP SWPM `inifile.params` file by one of the following methods: Method 1: Predefined sections of the file inifile_params.j2 will be used to create the file `inifile.params`. - The variable `sap_swpm_inifile_sections_list` determines which sections will be used. All other sections will be ignored. - The inifile parameters themselves will be set according to other role parameters. + The variable `sap_swpm_inifile_sections_list` contains a list of sections which will part of the file `inifile.params`. + All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. Example: The inifile parameter `archives.downloadBasket` will be set to the content of the role parameter - `sap_swpm_software_path` + `sap_swpm_software_path`. Method 2: The file `inifile.params` will be configured from the content of the dictionary `sap_swpm_inifile_parameters_dict`. This dictionary is defined like in the following example: @@ -182,7 +140,7 @@ sap_swpm_inifile_parameters_dict: It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: Just define both of the related parameters, `sap_swpm_inifile_sections_list` and `sap_swpm_inifile_parameters_dict`. -- The file inifile.params is then transferred to a temporary directory on the managed node, to be used by the sapinst process. +- The file `inifile.params` is then transferred to a temporary directory on the managed node, to be used by the sapinst process. ### SAP SWPM @@ -192,12 +150,13 @@ sap_swpm_inifile_parameters_dict: - Set expiry of Unix created users to 'never' -- Apply firewall rules for SAP NW (optional - no by default) +- Apply firewall rules for SAP NW (optional - false by default) ## Tags With the following tags, the role can be called to perform certain activities only: -- tag `sap_swpm_generate_inifile`: Only create the sapinst inifile. This can be useful for checking if the inifile is created as desired. +- tag `sap_swpm_generate_inifile`: Only create the sapinst inifile, without running most of the preinstall steps. + This can be useful for checking if the inifile is created as desired. - tag `sap_swpm_sapinst_commandline`: Only show the sapinst command line. - tag `sap_swpm_pre_install`: Perform all preinstallation steps, then exit. - tag `sap_swpm_setup_firewall`: Only perform the firewall preinstallation settings (but only if variable `sap_swpm_setup_firewall` is set to `true`). From f7e5ef733fa6813ca43bd079b6d952259486dc73 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 22 Aug 2024 15:51:19 +0200 Subject: [PATCH 132/210] sap_swpm: Explain how to migrate playbooks Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 52 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 410e4f4b8..bd5b0d255 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -67,13 +67,63 @@ The inputs are critical for running this role - Wrong parameters will result in failure Create an input file which contains all relevant installation information. -Sample input files are stored in the [inputs](/playbooks/vars) folder of this Ansible collection. Use the samples as guide for your desired installation +Sample input files are stored in the [inputs](/playbooks/vars) folder of this Ansible collection. Use the samples as guide for your desired installation. ### Default Parameters Please check the default parameters file for more information on other parameters that can be used as an input: - [**sap_swpm** default parameters](defaults/main.yml) +### Migrating playbooks from previous versions of sap_swpm +The following role parameter is no longer used because there are no role `modes` any more: +#### sap_swpm_ansible_role_mode + +The following two role parameters have been renamed, without automatic conversion between old and new name: + +#### sap_swpm_inifile_list -> sap_swpm_inifile_sections_list +Previous name: sap_swpm_inifile_list +New name: sap_swpm_inifile_sections_list +Reason: This variable contains sections of the sapinst input file, `inifile.params`. +The new variable name is reflecting this purpose. + +#### sap_swpm_inifile_custom_values_dictionary -> sap_swpm_inifile_parameters_dict +Previous name: sap_swpm_inifile_custom_values_dictionary +New name: sap_swpm_inifile_parameters_dict +Reason: This variable contains parameter names and values of the sapinst input file, `inifile.params`. +The new variable name is reflecting this purpose. + +#### Migration from the `*_templates` modes of the previous version of sap_swpm +The role `sap_swpm` does no longer use the dictionary `sap_swpm_templates_install_dictionary`. +This dictionary was used in the previous role modes `default_templates` and `advanced_templates. + +Because of this, required low level members of `sap_swpm_templates_install_dictionary` have to be redefined to top level variables. +Creating top level variables from low level members of a dict can be done: + +- in a separate task using ansible.builtin.set_fact before calling sap_swpm, or + +- in the task calling sap_swpm with a vars: section of the task calling sap_swpm. + +Be aware of the following limitation: You cannot define a variable in the same task in which you use this variable to access a member +of another variable. Any variable which is used to access low level dict members has to be defined before, in a separate task. + +Example: +For defining `sap_swpm_product_catalog_id` from a low level member of `sap_swpm_templates_install_dictionary`, use the following code: + +``` +# Step 1: Define level 2 dict member for accessing level 3 dict member in the following task +- name: Define variable sap_swpm_templates_product_input + ansible.builtin.set_fact: + sap_swpm_templates_product_input: "{{ sap_swpm_templates_product_input_prefix }}_nwas_ascs_ha" + +# Step 2: Define top level variable from level 3 dict member +- name: Define variables sap_swpm_product_catalog_id and sap_swpm_inifile_sections_list + ansible.builtin.set_fact: + sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" + sap_swpm_inifile_sections_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input][sap_swpm_inifile_sections_list] }}" + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] }}" + +``` + ## Execution Sample Ansible Playbook Execution From 16fd86fa3c83ee888066d9b7eb180f03b0a9ce0d Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 22 Aug 2024 16:21:01 +0200 Subject: [PATCH 133/210] sap_swpm: Fix two typos in inifile_params.j2 Signed-off-by: Bernd Finger --- roles/sap_swpm/templates/inifile_params.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_swpm/templates/inifile_params.j2 b/roles/sap_swpm/templates/inifile_params.j2 index 341be8d38..56da03da8 100644 --- a/roles/sap_swpm/templates/inifile_params.j2 +++ b/roles/sap_swpm/templates/inifile_params.j2 @@ -585,12 +585,12 @@ NW_DB6_DB.db6.abap.schema = sap{{ sap_swpm_sid | lower }} {% if 'db_connection_nw_anydb_oracledb' in sap_swpm_inifile_sections_list %} ################################################################### -# BEGIN secion db_connection_nw_anydb_oracledb # +# BEGIN section db_connection_nw_anydb_oracledb # # # storageBasedCopy.abapSchemaPassword = {{ sap_swpm_db_schema_abap_password }} storageBasedCopy.javaSchemaPassword = {{ sap_swpm_db_schema_java_password }} # # -# END secion db_connection_nw_anydb_oracledb # +# END section db_connection_nw_anydb_oracledb # ################################################################### {% endif %} {% if 'db_connection_nw_anydb_sapase' in sap_swpm_inifile_sections_list %} From ea61830c784e3457e506e0b835ef4b8d7e164b92 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Mon, 26 Aug 2024 18:25:03 +0200 Subject: [PATCH 134/210] sap_ha_pacemaker_cluster: fix(RHEL): packages on AWS --- roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 93e2d40a6..5c144d236 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -84,7 +84,8 @@ __sap_ha_pacemaker_cluster_fence_agent_packages_dict: # Dictionary with extra platform specific packages __sap_ha_pacemaker_cluster_platform_extra_packages_dict: cloud_aws_ec2_vs: - - awscli + - "{{ 'resource-agents-cloud' if ansible_distribution_major_version is version('9', '>=') else 'awscli' }}" + - "{{ 'awscli2' if ansible_distribution_version is version('9.5', '>=') else '' }}" cloud_gcp_ce_vm: - resource-agents-gcp cloud_msazure_vm: From 4b03ec9783f9da6e2680b41dc287273ce6516395 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 28 Aug 2024 10:22:07 +0200 Subject: [PATCH 135/210] changes made to run completely with pause instead of vars_prompt. Based on user request --- playbooks/sap_hana_install.yml | 122 ---------------------------- playbooks/sap_hana_preconfigure.yml | 59 ++++++++------ 2 files changed, 35 insertions(+), 146 deletions(-) delete mode 100644 playbooks/sap_hana_install.yml diff --git a/playbooks/sap_hana_install.yml b/playbooks/sap_hana_install.yml deleted file mode 100644 index 46fd63043..000000000 --- a/playbooks/sap_hana_install.yml +++ /dev/null @@ -1,122 +0,0 @@ ---- -## -# Call this playbook interactively with -# ansible-playbook community.sap_install.sap_hana_preconfigure -# -# or alternatively unattended with -# ansible-playbook community.sap_install.sap_hana_preconfigure -e @myvars.yml -# -# The file myvars. yaml needs to contain the following variables -# -- name: Disclaimer - ansible.builtin.import_playbook: disclaimer.yml # TODO: check if FQDN is required/optional - when: sap_playbook_disclaimer | d('true') - -- name: Collecting Variables - hosts: localhost - - vars_prompt: - - name: "sap_domain" - prompt: "Enter Domainname of your SAP systems (leave empty for using system default: " - private: false - default: "{{ sap_domain | d('') }}" - - - name: "sap_update_hosts" - prompt: "Do you want the system to update /etc/hosts for SAP (y/n)" - private: false - default: "y" - - - name: "sap_update" - prompt: "Do you want to update the system? (y/n)" - private: false - default: "n" - - - name: "sap_fail_if_reboot_required" - prompt: "Do you want to stop with an error if the system needs a reboot? (y/n)" - private: false - default: "n" - - - name: "sap_reboot" - prompt: "Do you want to reboot the system if required? (y/n)" - private: false - default: "n" - - - name: "sap_path" - prompt: "Enter path to SAP HANA install files" - private: false - default: /sap-install - - - name: "sap_hana_sid" - prompt: "SAP HANA SID" - private: false - default: "HDB" - - - name: "sap_hana_instance_number" - prompt: "SAP HANA instance number" - private: false - default: "90" - - - name: "sap_pass" - prompt: "SAP HANA password" - private: true - unsafe: true - - tasks: - - name: Configure Role Variables - ansible.builtin.set_fact: - sap_domain: '{{ sap_domain }}' - ### redhat.sap_install.sap_general_preconfigure - sap_general_preconfigure_modify_etc_hosts: '{{ (sap_update_hosts == "y") | ternary(true, false) }}' - sap_general_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' - sap_general_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' - # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - ### redhat.sap_install.sap_hana_preconfigure - sap_hana_preconfigure_update: '{{ (sap_update == "y") | ternary(true, false) }}' - sap_hana_preconfigure_fail_if_reboot_required: '{{ (sap_fail_if_reboot_required == "n") | ternary(false, true) }}' - sap_hana_preconfigure_reboot_ok: '{{ (sap_reboot == "n") | ternary(false, true) }}' - # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - ## BEGIN sap_hana_install parameters - sap_hana_install_software_directory: '{{ sap_path }}' - sap_hana_install_software_extract_directory: /tmp/sap-hana-inst - sap_hana_install_master_password: '{{ sap_pass }}' - sap_hana_sid: '{{ sap_hana_sid }}' - sap_hana_instance_number: '{{ sap_hana_instance_number }}' - # sap_hana_install_restrict_max_mem: 'y' - # sap_hana_install_max_mem: 38912 - # sap_hana_install_system_roles_collection: 'redhat.rhel_system_roles' -## END sap_hana_install parameters - -- name: Prepare system for SAP HANA Installation - hosts: "{{ target_group | d('localhost') }}" - become: true - - tasks: - - name: Ansible Role Configuration - ansible.builtin.debug: - msg: |- - The Hana setup runs with the following configuration - - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' - - 'Domain : {{ (sap_domain | length > 0) | ternary(sap_domain, ansible_domain) }}' - - 'Modify hosts: {{ sap_general_preconfigure_modify_etc_hosts }}' - - 'Update OS : {{ sap_hana_preconfigure_update }}' - - 'Auto Reboot : {{ sap_hana_preconfigure_reboot_ok }}' - - 'Fail if reboot is needed: {{ sap_hana_preconfigure_fail_if_reboot_required }}' - - 'Ansible Collection: {{ ansible_collection_name | d('undefined') }}' - - - name: Pause playbook execution to verify parameters - when: sap_playbook_disclaimer | d('true') - ansible.builtin.pause: - prompt: Press enter to continue - - - name: Prepare general preconfiguration - ansible.builtin.include_role: - name: community.sap_install.sap_general_preconfigure - - - name: Prepare system for HANA installation - ansible.builtin.include_role: - name: community.sap_install.sap_hana_preconfigure - - - name: Install SAP HANA - ansible.builtin.include_role: - name: community.sap_install.sap_hana_install diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 3d28e7bbc..5c8338f8d 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -31,29 +31,40 @@ ***************************************************************************** "" -- name: Collecting Variables +- name: Collecting Parameters for OS preparation or check to install SAP HANA hosts: localhost + gather_facts: false + + vars: + - sap_systems: "{{ (groups['all'] == []) | ternary ('localhost', 'all') }}" + # sap_systems: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" - vars_prompt: - - name: "sap_systems" - prompt: "Enter comma separated list of systems that you want to check or prepare for SAP HANA" - private: false - default: "{{ (groups['all'] == []) | ternary ('localhost', 'all') }}" - # default: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" + tasks: + - name: Get minimal facts + ansible.builtin.setup: + gather_subset: + - '!all' - - name: "sap_domain" - prompt: "Enter DNS Domainname of your SAP systems (leave empty for using system defaul): " - private: false - default: "{{ sap_domain | d('') }}" + - name: Target systems for hana installation + ansible.builtin.pause: + prompt: "Enter comma separated list of systems that you want to check or prepare for SAP HANA: [{{ sap_systems }}]" + echo: true + register: _sap_systems - - name: "assert" - prompt: "Do you want to check the current setup only (assert mode)? (y/n)" - private: false - default: "n" + - name: SAP server DNS domain must not be empty + ansible.builtin.pause: + prompt: "Enter DNS Domainname of your SAP systems: [{{ sap_domain | d(ansible_domain) }}]" + echo: true + register: _sap_domain + + - name: Run mode + ansible.builtin.pause: + prompt: "Do you want to check the current setup only (assert mode)? (y/n) [n]" + echo: true + register: _assert_mode - tasks: - name: Input addtional parameters if no assert mode is defined - when: assert != "y" + when: _assert_mode.user_input != "y" block: - ansible.builtin.pause: # noqa name[missing] - role default true prompt: "Do you want the system to update /etc/hosts for SAP? (y/n) [y]" @@ -75,34 +86,34 @@ - name: Prepare inventory when: - - sap_systems != 'localhost' - - sap_systems != 'all' + - _sap_systems.user_input is defined + - _sap_systems.user_input| trim != '' ansible.builtin.add_host: groups: sap_hana_prepare_hosts name: '{{ item }}' - loop: '{{ sap_systems | split(",") | list }}' + loop: '{{ _sap_systems.user_input | split(",") | list }}' - name: Configure Role Variables ansible.builtin.set_fact: - sap_domain: '{{ sap_domain }}' + sap_domain: '{{ ((_sap_domain.user_input | trim) != "") | ternary(_sap_domain.user_input, sap_domain | d(ansible_domain)) }}' ### redhat.sap_install.sap_general_preconfigure sap_general_preconfigure_modify_etc_hosts: '{{ (_sap_update_hosts.user_input is defined) and (_sap_update_hosts.user_input == "n") | ternary(false, true) }}' # default true sap_general_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false sap_general_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true - sap_general_preconfigure_assert: '{{ (assert=="y") | ternary(true,false) }}' + sap_general_preconfigure_assert: '{{ (_assert_mode.user_input == "y") | ternary(true, false) }}' # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' ### redhat.sap_install.sap_hana_preconfigure sap_hana_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false sap_hana_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true sap_hana_preconfigure_reboot_ok: '{{ (_sap_reboot.user_input is defined) and (_sap_reboot.user_input == "y") | ternary(true, false) }}' # default false - sap_hana_preconfigure_assert: '{{ (assert=="y") | ternary(true,false) }}' + sap_hana_preconfigure_assert: '{{ (_assert_mode.user_input == "y") | ternary(true, false) }}' # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - name: Run sap_hana_prepare_exec playbook ansible.builtin.import_playbook: sap_hana_preconfigure_exec.yml vars: sap_playbook_parameter_confirm: true - sap_hana_group: "{{ ( groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts',omit) }}" + sap_hana_group: "{{ (groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts',sap_systems) }}" sap_domain: "{{ hostvars['localhost']['sap_domain'] }}" sap_general_preconfigure_modify_etc_hosts: "{{ hostvars['localhost']['sap_general_preconfigure_modify_etc_hosts'] }}" sap_general_preconfigure_update: "{{ hostvars['localhost']['sap_general_preconfigure_update'] }}" From 063ab102ed3676322db494714fe5ef1a5f706f66 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 28 Aug 2024 10:25:44 +0200 Subject: [PATCH 136/210] Updates to readme --- playbooks/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 41425ae0f..7ffef9f50 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -17,8 +17,8 @@ ansible-playbook community.sap_install.sap_hana_preconfigure.yml ``` This playbook runs against localhost and/or remote hosts. -Remote hosts can be defined in an inventory in a file, or with -i on the commandline e.g. `-i inventoryfile` or `-i host1,host2,host3,` and execution can be of course limited with -l. -Nonetheless you need to confirm the hosts in the interactive dialog. +Remote hosts can be defined in an inventory file, or with -i on the commandline e.g. `-i inventoryfile` or `-i host1,host2,host3,` and execution can be limited with -l. +You need to confirm the hosts in the interactive dialog. When you call this playbook against a remote host make sure the user can connect and assume root without a password or pass the following parameters if necessary ```[bash] @@ -38,7 +38,7 @@ hana2 ``` Prepare a variable config file with the following parameters (adapt to your needs): -Create a parameter file `my_vars` with similar content: +Create a parameter file `my_vars.yml` with similar content: ```[yaml] # sap_playbook_parameter_confirm: false From 45391cb367ee936775fcf44553ac5ab4d1408f64 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 28 Aug 2024 10:42:37 +0200 Subject: [PATCH 137/210] output beautification --- playbooks/sap_hana_preconfigure.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 5c8338f8d..84d3d94e3 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -14,9 +14,9 @@ hosts: localhost gather_facts: false tasks: - - name: Playbook Usage + - name: Playbook Usage # noqa trailing-spaces ansible.builtin.debug: - msg: |- + msg: |+ ***************************************************************************** * sap_hana_preconfigure * * * @@ -29,7 +29,6 @@ * sap_hana_preconfigure_exec.yml instead with a properly prepared variable * * file. (See README for more details) * ***************************************************************************** - "" - name: Collecting Parameters for OS preparation or check to install SAP HANA hosts: localhost From fbc4bbc6441a1fb6bc78cd7e6a0611daf96fe8e6 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 28 Aug 2024 10:54:13 +0200 Subject: [PATCH 138/210] codespell corrections --- playbooks/README.md | 2 +- playbooks/sap_hana_preconfigure.yml | 4 ++-- playbooks/sap_hana_preconfigure_exec.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 7ffef9f50..7ebccf8f8 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -24,7 +24,7 @@ When you call this playbook against a remote host make sure the user can connect ```[bash] -u : User that establishes the ssh connection -k: asks for password or passphrase of the connection user, if required for ssh - -K: asks for the privilige escalation password of the connection user to become root on the target host + -K: asks for the privilege escalation password of the connection user to become root on the target host ``` If you want to embed this playbook or run a non-interactive version, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml index 84d3d94e3..159acf890 100644 --- a/playbooks/sap_hana_preconfigure.yml +++ b/playbooks/sap_hana_preconfigure.yml @@ -21,7 +21,7 @@ * sap_hana_preconfigure * * * * This playbook is used to prepare an SAP HANA system. * - * The minimum viable parameters to succussfully prepare your system for an * + * The minimum viable parameters to successfully prepare your system for an * * SAP HANA installation will be asked. * * Useful defaults will be set, so that it is save to just press enter * * * @@ -62,7 +62,7 @@ echo: true register: _assert_mode - - name: Input addtional parameters if no assert mode is defined + - name: Input additional parameters if no assert mode is defined when: _assert_mode.user_input != "y" block: - ansible.builtin.pause: # noqa name[missing] - role default true diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 7f10ae6ea..b70cf2a39 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -30,7 +30,7 @@ msg: |- The Hana setup runs with the following configuration - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - - 'IP Adress : {{ sap_ip | d(ansible_default_ipv4.address) }}' + - 'IP Address : {{ sap_ip | d(ansible_default_ipv4.address) }}' - 'Domain : {{ (sap_domain | d('') | length > 0) | ternary(sap_domain, ansible_domain) }}' - 'Modify hosts : {{ sap_general_preconfigure_modify_etc_hosts | d('false') }}' - 'Update OS : {{ sap_hana_preconfigure_update | d('false') }}' From 3490ef2c33f86b37cd87d7615af899587aebbffd Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 30 Aug 2024 17:55:49 +0200 Subject: [PATCH 139/210] sap_hana_install: Implement an SAP HANA installation check only feature Fixes #844. Signed-off-by: Bernd Finger --- roles/sap_hana_install/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index a695c9494..b9efc6398 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -10,6 +10,7 @@ sap_hana_install_restrict_max_mem: "{{ sap_hana_install_mem_restrict | d(sap_hana_install_restrict_max_mem) }}" tags: - sap_hana_install_check_hana_exists + - sap_hana_install_check_installation - sap_hana_install_preinstall - sap_hana_install_set_log_mode - sap_hana_install_configure_firewall From d21ff6ff30cf5da6700503c1d67d4eba2225e7a8 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Fri, 30 Aug 2024 20:38:09 +0100 Subject: [PATCH 140/210] sap_swpm: fix issue #792 - error when observer user defined, but empty and observe mode is on --- roles/sap_swpm/tasks/pre_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index cdafb3b0f..17a0c2211 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -18,7 +18,7 @@ - name: SAP SWPM Pre Install - Set sapinst command vars: sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('',true) | length > 0 else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" From e9d443b30add81ec2e61f4025d7cc9042391bcf3 Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Fri, 30 Aug 2024 20:41:55 +0100 Subject: [PATCH 141/210] sap_swpm: fix issue #792 - error when observer user defined, but empty and observer mode is on --- roles/sap_swpm/tasks/pre_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 17a0c2211..c18035678 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -18,7 +18,7 @@ - name: SAP SWPM Pre Install - Set sapinst command vars: sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('',true) | length > 0 else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('',true) | length > 0 else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" From 9762aa0d5267f34d3f0dc578d0f8b59638223f1d Mon Sep 17 00:00:00 2001 From: Rob Dobozy Date: Mon, 2 Sep 2024 19:31:22 +0100 Subject: [PATCH 142/210] sap_swpm: fix issue #792 - error when observer user defined, but empty and observer mode is on (lint fixes) --- roles/sap_swpm/tasks/pre_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index c18035678..9907a412a 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -18,7 +18,7 @@ - name: SAP SWPM Pre Install - Set sapinst command vars: sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('',true) | length > 0 else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('', true) | length > 0 else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" From e1a2dd18f113615aeb2f15ab6f24294e1e203bff Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 4 Sep 2024 16:01:42 +0200 Subject: [PATCH 143/210] sap_install_media_detect: Allow disabling RAR handling Fixes #855. Signed-off-by: Bernd Finger --- roles/sap_install_media_detect/defaults/main.yml | 4 ++++ roles/sap_install_media_detect/tasks/main.yml | 2 ++ .../tasks/prepare/create_file_list_phase_2.yml | 12 +++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/roles/sap_install_media_detect/defaults/main.yml b/roles/sap_install_media_detect/defaults/main.yml index d832612ed..29277a7c0 100644 --- a/roles/sap_install_media_detect/defaults/main.yml +++ b/roles/sap_install_media_detect/defaults/main.yml @@ -1,6 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 --- +# Set this parameter to `false` for skipping the handling of RAR files. In this case, also no unar or other RAR handling software +# will be installed. +sap_install_media_detect_rar_handling: true + # Set this parameter to use either the unar package from EPEL or another software package for handling RAR files. # Based on this setting, the commands for listing and extracting RAR files are being set in tasks/prepare/enable_rar_handling.yml sap_install_media_detect_rar_package: 'EPEL' diff --git a/roles/sap_install_media_detect/tasks/main.yml b/roles/sap_install_media_detect/tasks/main.yml index d98e06d35..2e46b9ac5 100644 --- a/roles/sap_install_media_detect/tasks/main.yml +++ b/roles/sap_install_media_detect/tasks/main.yml @@ -25,6 +25,7 @@ file: prepare/enable_rar_handling.yml apply: tags: sap_install_media_detect_rar_handling + when: sap_install_media_detect_rar_handling tags: sap_install_media_detect_rar_handling - name: SAP Install Media Detect - Prepare - Check directories @@ -95,6 +96,7 @@ tags: sap_install_media_detect_rar_handling tags: sap_install_media_detect_rar_handling when: + - sap_install_media_detect_rar_handling - sap_install_media_detect_rar_package == 'EPEL' - ansible_os_family == 'RedHat' - __sap_install_media_detect_register_rpm_q_epel.stdout != 'epel-release' diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index 73948383e..a2391d390 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -25,13 +25,23 @@ loop_control: label: "{{ item.path }}" -- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type +- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, including command for handling RAR files ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --lsar_file={{ __sap_install_media_detect_rar_list.split(' ')[0] }} --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" register: __sap_install_media_detect_register_files_phase_2 loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}" loop_control: loop_var: line_item changed_when: false + when: sap_install_media_detect_rar_handling + +- name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, without command for handling RAR files + ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" + register: __sap_install_media_detect_register_files_phase_2 + loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}" + loop_control: + loop_var: line_item + changed_when: false + when: not sap_install_media_detect_rar_handling - name: SAP Install Media Detect - Prepare - Set fact with the results of the sapfile command ansible.builtin.set_fact: From 03f372bc5b553ee9b3dfa6f494785d9163ee2acb Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 5 Sep 2024 10:07:33 +0200 Subject: [PATCH 144/210] sap_swpm: Add missing single reverse quote Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index bd5b0d255..6fec3a0c5 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -94,7 +94,7 @@ The new variable name is reflecting this purpose. #### Migration from the `*_templates` modes of the previous version of sap_swpm The role `sap_swpm` does no longer use the dictionary `sap_swpm_templates_install_dictionary`. -This dictionary was used in the previous role modes `default_templates` and `advanced_templates. +This dictionary was used in the previous role modes `default_templates` and `advanced_templates`. Because of this, required low level members of `sap_swpm_templates_install_dictionary` have to be redefined to top level variables. Creating top level variables from low level members of a dict can be done: From f039b145dddb0e902aa132e1f6c49bc1a4844389 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 5 Sep 2024 10:21:56 +0200 Subject: [PATCH 145/210] sap_swpm: Repeat PR #850 and solve ansible-lint error Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index d008bd965..89195d1c5 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -3,7 +3,7 @@ - name: SAP SWPM Pre Install - Rename variables ansible.builtin.set_fact: - sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list | d([]) ) }}" + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list | d([])) }}" sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary | d(sap_swpm_inifile_parameters_dict) | d({}) }}" tags: always @@ -82,7 +82,7 @@ - name: SAP SWPM Pre Install - Set the sapinst command parameters vars: sap_swpm_swpm_command_guiserver: "{{ 'SAPINST_START_GUISERVER=false' if not sap_swpm_swpm_observer_mode else '' }}" - sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '' }}" + sap_swpm_swpm_command_observer: "{{ 'SAPINST_REMOTE_ACCESS_USER=' + sap_swpm_swpm_remote_access_user + ' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user | d('', true) | length > 0 else '' }}" ansible.builtin.set_fact: sap_swpm_swpm_command_inifile: "SAPINST_INPUT_PARAMETERS_URL={{ sap_swpm_tmpdir.path }}/inifile.params" sap_swpm_swpm_command_product_id: "SAPINST_EXECUTE_PRODUCT_ID={{ sap_swpm_product_catalog_id }}" From 8ce28cf523c078297a24b86ed4a7d45eff257c18 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 5 Sep 2024 10:40:16 +0200 Subject: [PATCH 146/210] sap_swpm: Further changes to README.md ... for better readability Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 41 +++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 6fec3a0c5..3cdd25d93 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -75,36 +75,43 @@ Please check the default parameters file for more information on other parameter - [**sap_swpm** default parameters](defaults/main.yml) ### Migrating playbooks from previous versions of sap_swpm + The following role parameter is no longer used because there are no role `modes` any more: + #### sap_swpm_ansible_role_mode -The following two role parameters have been renamed, without automatic conversion between old and new name: +The following two role parameters have been renamed. If the new variables are not defined, the old ones are converted to the new ones. #### sap_swpm_inifile_list -> sap_swpm_inifile_sections_list -Previous name: sap_swpm_inifile_list -New name: sap_swpm_inifile_sections_list -Reason: This variable contains sections of the sapinst input file, `inifile.params`. + +**Previous name**: sap_swpm_inifile_list\ +**New name**: sap_swpm_inifile_sections_list\ +**Reason**: This variable contains sections of the sapinst input file, `inifile.params`. The new variable name is reflecting this purpose. #### sap_swpm_inifile_custom_values_dictionary -> sap_swpm_inifile_parameters_dict -Previous name: sap_swpm_inifile_custom_values_dictionary -New name: sap_swpm_inifile_parameters_dict -Reason: This variable contains parameter names and values of the sapinst input file, `inifile.params`. -The new variable name is reflecting this purpose. -#### Migration from the `*_templates` modes of the previous version of sap_swpm +**Previous name**: sap_swpm_inifile_custom_values_dictionary\ +**New name**: sap_swpm_inifile_parameters_dict\ +**Reason**: This variable contains parameter names and values of the +sapinst input file, `inifile.params`. The new variable name is reflecting this purpose. + +#### Migration from the `*_templates` modes of the previous version of `sap_swpm` + The role `sap_swpm` does no longer use the dictionary `sap_swpm_templates_install_dictionary`. This dictionary was used in the previous role modes `default_templates` and `advanced_templates`. -Because of this, required low level members of `sap_swpm_templates_install_dictionary` have to be redefined to top level variables. -Creating top level variables from low level members of a dict can be done: +Because of this change, required low level members of `sap_swpm_templates_install_dictionary` have to be +redefined to top level variables. Creating top level variables from low level members +of a dict can be done: -- in a separate task using ansible.builtin.set_fact before calling sap_swpm, or +- in a separate task using `ansible.builtin.set_fact` before calling `sap_swpm`, or -- in the task calling sap_swpm with a vars: section of the task calling sap_swpm. +- in the task calling `sap_swpm` with a `vars`: section of the task calling `sap_swpm`. -Be aware of the following limitation: You cannot define a variable in the same task in which you use this variable to access a member -of another variable. Any variable which is used to access low level dict members has to be defined before, in a separate task. +Be aware of the following limitation: You cannot define a variable in the same task in +which you use this variable to access a member of another variable. Any variable which +is used to access low level dict members has to be defined before, in a *separate task*. Example: For defining `sap_swpm_product_catalog_id` from a low level member of `sap_swpm_templates_install_dictionary`, use the following code: @@ -172,9 +179,9 @@ Sample Ansible Playbook Execution - If such a file does *not* exist, the role will create an SAP SWPM `inifile.params` file by one of the following methods: - Method 1: Predefined sections of the file inifile_params.j2 will be used to create the file `inifile.params`. + Method 1: Predefined sections of the file `inifile_params.j2` will be used to create the file `inifile.params`. The variable `sap_swpm_inifile_sections_list` contains a list of sections which will part of the file `inifile.params`. - All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. + All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. Example: The inifile parameter `archives.downloadBasket` will be set to the content of the role parameter `sap_swpm_software_path`. From da32e3bf1e885c24ad3d755592e5435574380198 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 5 Sep 2024 15:13:42 +0200 Subject: [PATCH 147/210] sap_install_media_detect: Fix issue #859 Signed-off-by: Bernd Finger --- .../tasks/prepare/create_file_list_phase_2.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index a2391d390..03cbfa5dd 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -27,22 +27,32 @@ - name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, including command for handling RAR files ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --lsar_file={{ __sap_install_media_detect_rar_list.split(' ')[0] }} --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" - register: __sap_install_media_detect_register_files_phase_2 + register: __sap_install_media_detect_register_files_phase_2_rar loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}" loop_control: loop_var: line_item changed_when: false when: sap_install_media_detect_rar_handling +- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, including RAR handling + ansible.builtin.set_fact: + __sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_rar }}" + when: sap_install_media_detect_rar_handling + - name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, without command for handling RAR files ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" - register: __sap_install_media_detect_register_files_phase_2 + register: __sap_install_media_detect_register_files_phase_2_norar loop: "{{ __sap_install_media_detect_fact_find_result_phase_2 }}" loop_control: loop_var: line_item changed_when: false when: not sap_install_media_detect_rar_handling +- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, without RAR handling + ansible.builtin.set_fact: + __sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_norar }}" + when: not sap_install_media_detect_rar_handling + - name: SAP Install Media Detect - Prepare - Set fact with the results of the sapfile command ansible.builtin.set_fact: __sap_install_media_detect_fact_files_sapfile_results: "{{ __sap_install_media_detect_fact_files_sapfile_results + [__new_dict] }}" From 2a2e1859b81c8d548bb59527e9c01fbd64881e70 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 5 Sep 2024 15:57:50 +0200 Subject: [PATCH 148/210] sap_install_media_detect: Use Jinja2 for conditionally setting the variable Signed-off-by: Bernd Finger --- .../tasks/prepare/create_file_list_phase_2.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml index 03cbfa5dd..e6b6d2497 100644 --- a/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml +++ b/roles/sap_install_media_detect/tasks/prepare/create_file_list_phase_2.yml @@ -34,11 +34,6 @@ changed_when: false when: sap_install_media_detect_rar_handling -- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, including RAR handling - ansible.builtin.set_fact: - __sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_rar }}" - when: sap_install_media_detect_rar_handling - - name: SAP Install Media Detect - Prepare - Iterate over files and determine file type, without command for handling RAR files ansible.builtin.command: "{{ __sap_install_media_detect_sapfile_path }} -e --sapcar_file={{ __sap_install_media_detect_fact_sapcar_path }} {{ line_item }}" register: __sap_install_media_detect_register_files_phase_2_norar @@ -48,10 +43,11 @@ changed_when: false when: not sap_install_media_detect_rar_handling -- name: SAP Install Media Detect - Prepare - Set fact from determining the file type, without RAR handling +- name: SAP Install Media Detect - Prepare - Set fact from determining the file type ansible.builtin.set_fact: - __sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_norar }}" - when: not sap_install_media_detect_rar_handling + __sap_install_media_detect_register_files_phase_2: "{{ __sap_install_media_detect_register_files_phase_2_rar + if sap_install_media_detect_rar_handling + else __sap_install_media_detect_register_files_phase_2_norar }}" - name: SAP Install Media Detect - Prepare - Set fact with the results of the sapfile command ansible.builtin.set_fact: From a7875d79206f743c8f28ee7056405c1e8fa126b4 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 6 Sep 2024 10:31:34 +0200 Subject: [PATCH 149/210] sap_swpm: Only mention the `vars:` section for redefining variables Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 3cdd25d93..ac6b8caac 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -109,26 +109,17 @@ of a dict can be done: - in the task calling `sap_swpm` with a `vars`: section of the task calling `sap_swpm`. -Be aware of the following limitation: You cannot define a variable in the same task in -which you use this variable to access a member of another variable. Any variable which -is used to access low level dict members has to be defined before, in a *separate task*. - Example: -For defining `sap_swpm_product_catalog_id` from a low level member of `sap_swpm_templates_install_dictionary`, use the following code: ``` -# Step 1: Define level 2 dict member for accessing level 3 dict member in the following task -- name: Define variable sap_swpm_templates_product_input - ansible.builtin.set_fact: - sap_swpm_templates_product_input: "{{ sap_swpm_templates_product_input_prefix }}_nwas_ascs_ha" - -# Step 2: Define top level variable from level 3 dict member -- name: Define variables sap_swpm_product_catalog_id and sap_swpm_inifile_sections_list - ansible.builtin.set_fact: - sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" - sap_swpm_inifile_sections_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input][sap_swpm_inifile_sections_list] }}" - sap_swpm_inifile_parameters_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] }}" +- name: Execute the role sap_swpm + ansible.builtin.include_role: + name: community.sap_install.sap_swpm + vars: + sap_swpm_templates_product_input: "sap_s4hana_2023_distributed_nwas_ascs_ha" + sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" + sap_swpm_inifile_sections_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] }}" ``` ## Execution From 06c17393771851856d3bdb86d364e72e0f994e27 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 9 Sep 2024 20:19:39 +0200 Subject: [PATCH 150/210] sap_swpm: Recognize sap_swpm_templates_install_dictionary Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 74 ++++++++-------- roles/sap_swpm/tasks/pre_install.yml | 125 ++++++++++++++++++++++++++- 2 files changed, 162 insertions(+), 37 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index ac6b8caac..6d033fb42 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -80,47 +80,59 @@ The following role parameter is no longer used because there are no role `modes` #### sap_swpm_ansible_role_mode -The following two role parameters have been renamed. If the new variables are not defined, the old ones are converted to the new ones. +The following two role parameters have been renamed. If the new variables are undefined and the old ones are defined, +the old ones are converted to the new ones. #### sap_swpm_inifile_list -> sap_swpm_inifile_sections_list -**Previous name**: sap_swpm_inifile_list\ -**New name**: sap_swpm_inifile_sections_list\ +**Previous name**: `sap_swpm_inifile_list`\ +**New name**: `sap_swpm_inifile_sections_list`\ **Reason**: This variable contains sections of the sapinst input file, `inifile.params`. The new variable name is reflecting this purpose. #### sap_swpm_inifile_custom_values_dictionary -> sap_swpm_inifile_parameters_dict -**Previous name**: sap_swpm_inifile_custom_values_dictionary\ -**New name**: sap_swpm_inifile_parameters_dict\ +**Previous name**: `sap_swpm_inifile_custom_values_dictionary`\ +**New name**: `sap_swpm_inifile_parameters_dict`\ **Reason**: This variable contains parameter names and values of the sapinst input file, `inifile.params`. The new variable name is reflecting this purpose. -#### Migration from the `*_templates` modes of the previous version of `sap_swpm` +#### sap_swpm_inifile_dictionary -> sap_swpm_role_parameters_dict -The role `sap_swpm` does no longer use the dictionary `sap_swpm_templates_install_dictionary`. -This dictionary was used in the previous role modes `default_templates` and `advanced_templates`. +**Previous name**: `sap_swpm_inifile_dictionary`\ +**New name**: `sap_swpm_role_parameters_dict`\ +**Reason**: This dictionary contains parameter names and values of the role `sap_swpm`. +The new variable name is reflecting this purpose.\ +**Note**: This variable was only used as a member of `sap_swpm_templates_install_dictionary`, in the +previous `default_templates` mode. -Because of this change, required low level members of `sap_swpm_templates_install_dictionary` have to be -redefined to top level variables. Creating top level variables from low level members -of a dict can be done: +#### Using sap_swpm_templates_install_dictionary -- in a separate task using `ansible.builtin.set_fact` before calling `sap_swpm`, or +The dictionary named `sap_swpm_templates_install_dictionary` can hold all necessary variables +needed by the role `sap_swpm` for different SAP products. See the `Ansible Playbooks for SAP` for examples. -- in the task calling `sap_swpm` with a `vars`: section of the task calling `sap_swpm`. +The role `sap_swpm` redefines low level members of this dictionary to top level +variables. The dictionary may contain either the definitions for the previous +version of the role (used in the previous role modes `default_templates` and `advanced_templates`), +or an updated definition of the dictionary containing the new variable names. +The role will fail if both old and new variable names are defined in the dictionary. +Variables on the top level take precedences over those members of `sap_swpm_templates_install_dictionary` with the same name. -Example: +Following is the complete list of conversions of members of the dictionary `sap_swpm_templates_install_dictionary`, where `sap_prod` is an +example entry for `sap_swpm_templates_product_input`: +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_product_catalog_id']` -> `sap_swpm_product_catalog_id` +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_sections_list']` -> `sap_swpm_inifile_sections_list` +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_parameters_dict']` -> `sap_swpm_inifile_parameters_dict` +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_role_parameters_dict']` -> `sap_swpm_role_parameters_dict` -> top level role variables\ + Example: `sap_swpm_install_saphostagent: 'true'` -``` -- name: Execute the role sap_swpm - ansible.builtin.include_role: - name: community.sap_install.sap_swpm - vars: - sap_swpm_templates_product_input: "sap_s4hana_2023_distributed_nwas_ascs_ha" - - sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" - sap_swpm_inifile_sections_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] }}" -``` +Former `default_templates` mode: +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_list']` -> `sap_swpm_inifile_sections_list` +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_dictionary']` -> top level role variables\ + Example: `sap_swpm_install_saphostagent: 'true'` + +Former `advanced_templates` mode: +- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_custom_values_dictionary']` -> `sap_swpm_inifile_parameters_dict` ## Execution @@ -170,23 +182,17 @@ Sample Ansible Playbook Execution - If such a file does *not* exist, the role will create an SAP SWPM `inifile.params` file by one of the following methods: - Method 1: Predefined sections of the file `inifile_params.j2` will be used to create the file `inifile.params`. - The variable `sap_swpm_inifile_sections_list` contains a list of sections which will part of the file `inifile.params`. - All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. - Example: The inifile parameter `archives.downloadBasket` will be set to the content of the role parameter - `sap_swpm_software_path`. + Method 1: Predefined sections of the file `inifile_params.j2` will be used to create the file `inifile.params`. The variable `sap_swpm_inifile_sections_list` contains a list of sections which will part of the file `inifile.params`. All other sections will be ignored. The inifile parameters themselves will be set according to other role parameters. Example: The inifile parameter `archives.downloadBasket` will be set to the content of the role parameter `sap_swpm_software_path`. - Method 2: The file `inifile.params` will be configured from the content of the dictionary `sap_swpm_inifile_parameters_dict`. - This dictionary is defined like in the following example: + Method 2: The file `inifile.params` will be configured from the content of the dictionary `sap_swpm_inifile_parameters_dict`. This dictionary is defined like in the following example: ``` sap_swpm_inifile_parameters_dict: archives.downloadBasket: /software/download_basket - NW_getFQDN.FQDN: poc.cloud + NW_getFQDN.FQDN: example.com ``` - It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: - Just define both of the related parameters, `sap_swpm_inifile_sections_list` and `sap_swpm_inifile_parameters_dict`. +It is also possible to use method 1 for creating the inifile and then replace or set additional variables using method 2: Define both of the related parameters, `sap_swpm_inifile_sections_list` and `sap_swpm_inifile_parameters_dict`. - The file `inifile.params` is then transferred to a temporary directory on the managed node, to be used by the sapinst process. diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 89195d1c5..93d962a86 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -1,10 +1,129 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: SAP SWPM Pre Install - Rename variables +- name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_sections_list' from 'sap_swpm_inifile_list' if necessary ansible.builtin.set_fact: - sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list | d(sap_swpm_inifile_sections_list | d([])) }}" - sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary | d(sap_swpm_inifile_parameters_dict) | d({}) }}" + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_list }}" + when: + - sap_swpm_inifile_sections_list is undefined + - sap_swpm_inifile_list is defined + tags: always + +- name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_parameters_dict' from 'sap_swpm_inifile_custom_values_dictionary' if necessary + ansible.builtin.set_fact: + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_custom_values_dictionary }}" + when: + - sap_swpm_inifile_parameters_dict is undefined + - sap_swpm_inifile_custom_values_dictionary is defined + tags: always + +- name: SAP SWPM Pre Install - Define variables from 'sap_swpm_templates_install_dictionary' if present + when: sap_swpm_templates_install_dictionary is defined + tags: always + block: + + - name: SAP SWPM Pre Install - Display 'sap_swpm_templates_product_input' + ansible.builtin.debug: + msg: + - "sap_swpm_templates_product_input: >{{ sap_swpm_templates_product_input }}<" + + - name: SAP SWPM Pre Install - Ensure that only one of 'sap_swpm_inifile_sections_list' and 'sap_swpm_inifile_list' is defined in the dict + ansible.builtin.fail: + msg: + - "FAIL: In 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]', both" + - "'sap_swpm_inifile_sections_list' and 'sap_swpm_inifile_list' are defined!" + - "Only one of these variables may be defined in 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]'." + when: + - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list'] is defined + - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] is defined + + - name: SAP SWPM Pre Install - Ensure that only one of 'sap_swpm_inifile_parameters_dict' or 'sap_swpm_inifile_custom_values_dictionary' is defined in the dict + ansible.builtin.fail: + msg: + - "FAIL: In 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]', both" + - "'sap_swpm_inifile_parameters_dict', and 'sap_swpm_inifile_custom_values_dictionary', are defined!" + - "Only one of these variables may be defined in 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]'." + when: + - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] is defined + - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] is defined + +# Define sap_swpm_product_catalog_id from low level member, or use top level variable if defined. Top level variable has precedence. + - name: SAP SWPM Pre Install - Define 'sap_swpm_product_catalog_id' from low level member with the same name + ansible.builtin.set_fact: + sap_swpm_product_catalog_id: "{{ sap_swpm_product_catalog_id | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id']) }}" + when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] is defined + + - name: SAP SWPM Pre Install - Display sap_swpm_product_catalog_id + ansible.builtin.debug: + msg: "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<" + +# Define sap_swpm_inifile_sections_list from low level member, or use top level variable if defined. Top level variable has precedence. + - name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_sections_list' from low level member + ansible.builtin.set_fact: + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_sections_list | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list']) | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list']) }}" + when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] is defined or + sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list'] is defined + +# Define sap_swpm_role_parameters_dict from low level member. Top level variable does not exist. + - name: SAP SWPM Pre Install - Define 'sap_swpm_role_parameters_dict' from low level member + ansible.builtin.set_fact: + sap_swpm_role_parameters_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_dictionary'] | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict']) }}" + when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_dictionary'] is defined or + sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict'] is defined + +# Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict': +# Reason for noqa: We are setting variables from the content of a dict, and the variable names are in the dict keys. + - name: SAP SWPM Pre Install - Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict' # noqa var-naming[no-jinja] + ansible.builtin.set_fact: + "{{ line_item.key }}": "{{ lookup('vars', line_item.key, default=line_item.value) }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop_control: + loop_var: line_item + when: sap_swpm_role_parameters_dict is defined + + - name: SAP SWPM Pre Install - Display all vars of 'sap_swpm_role_parameters_dict' + ansible.builtin.debug: + msg: "{{ line_item.key }}: {{ lookup('vars', line_item.key) }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop_control: + loop_var: line_item + + - name: SAP SWPM Pre Install - Looking for any differences... + ansible.builtin.set_fact: + different_values_sap_swpm_role_parameters_dict: + "{{ different_values_sap_swpm_role_parameters_dict | d({}) | combine({line_item.key: line_item.value}) }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop_control: + loop_var: line_item + when: + - line_item.value != lookup('vars', line_item.key) + ignore_errors: true + + - name: SAP SWPM Pre Install - Display any differences + ansible.builtin.debug: + msg: + - "Note: The following values from" + - "sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict']" + - "are ignored because they have already been defined on the top level, as follows:" + - "{{ different_values_sap_swpm_role_parameters_dict }}" + +# Define sap_swpm_inifile_parameters_dict from low level member, or use top level variable if defined. Top level variable has precedence. + - name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_parameters_dict' from low level member + ansible.builtin.set_fact: + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_parameters_dict | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary']) | + d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict']) }}" + when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] is defined or + sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] is defined + +- name: SAP SWPM Pre Install - Define the main inifile creation parameters as empty if necessary + ansible.builtin.set_fact: + sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_sections_list | d([]) }}" + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_parameters_dict | d({}) }}" tags: always ################ From f0b8339acb974b0d5d9bef0cea08705b6f849899 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 10 Sep 2024 10:45:22 +0200 Subject: [PATCH 151/210] sap_swpm: No longer define sap_swpm_product_catalog_id... ... in defaults/main.yml Signed-off-by: Bernd Finger --- roles/sap_swpm/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index 8bb00e901..fd24c156a 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -139,7 +139,8 @@ sap_swpm_inifile_sections_list: ######################################## # SAP product that will be installed and passed as argument to the sapinst installer, example 'NW_ABAP_OneHost:S4HANA2020.CORE.HDB.ABAP' -sap_swpm_product_catalog_id: +# Needs to be defined in the playbook or inventory or can be determined from an existing inifile.params file. +#sap_swpm_product_catalog_id: # SAPCAR path and file name, only path is mandatory. The script will automatically get file_name sap_swpm_sapcar_path: From 95ef236872232a20321a92c26d16c43d8b62ec2c Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 10 Sep 2024 13:34:08 +0200 Subject: [PATCH 152/210] sap_swpm: Allow undefined or empty sap_swpm_role_parameters_dict Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 93d962a86..304a49874 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -80,26 +80,28 @@ - name: SAP SWPM Pre Install - Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict' # noqa var-naming[no-jinja] ansible.builtin.set_fact: "{{ line_item.key }}": "{{ lookup('vars', line_item.key, default=line_item.value) }}" - loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" loop_control: loop_var: line_item - when: sap_swpm_role_parameters_dict is defined + when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - name: SAP SWPM Pre Install - Display all vars of 'sap_swpm_role_parameters_dict' ansible.builtin.debug: msg: "{{ line_item.key }}: {{ lookup('vars', line_item.key) }}" - loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" loop_control: loop_var: line_item + when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - name: SAP SWPM Pre Install - Looking for any differences... ansible.builtin.set_fact: different_values_sap_swpm_role_parameters_dict: "{{ different_values_sap_swpm_role_parameters_dict | d({}) | combine({line_item.key: line_item.value}) }}" - loop: "{{ sap_swpm_role_parameters_dict | dict2items }}" + loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" loop_control: loop_var: line_item when: + - sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - line_item.value != lookup('vars', line_item.key) ignore_errors: true @@ -110,6 +112,7 @@ - "sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict']" - "are ignored because they have already been defined on the top level, as follows:" - "{{ different_values_sap_swpm_role_parameters_dict }}" + when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict # Define sap_swpm_inifile_parameters_dict from low level member, or use top level variable if defined. Top level variable has precedence. - name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_parameters_dict' from low level member From c81d58fdd5730e94e2d96e28248942ddca41155b Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Wed, 11 Sep 2024 10:44:43 +0200 Subject: [PATCH 153/210] feat: VIP dictionary and GCP haproxy --- .../platform/preconfigure_cloud_gcp_ce_vm.yml | 309 +++++++++--------- .../vars/platform_cloud_aws_ec2_vs.yml | 2 +- .../vars/platform_cloud_gcp_ce_vm.yml | 10 +- .../vars/platform_cloud_ibmcloud_powervs.yml | 2 +- .../vars/platform_cloud_ibmcloud_vs.yml | 2 +- .../vars/platform_cloud_msazure_vm.yml | 2 +- .../vars/platform_hyp_ibmpower_vm.yml | 2 +- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 3 + roles/sap_ha_pacemaker_cluster/vars/suse.yml | 4 + 9 files changed, 177 insertions(+), 159 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index d148454b7..242c42a98 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -1,155 +1,158 @@ # SPDX-License-Identifier: Apache-2.0 --- - -- name: "SAP HA Install Pacemaker - GCP CE VM - Install haproxy" - ansible.builtin.package: - name: haproxy - state: present - -- name: "SAP HA Install Pacemaker - GCP CE VM - Check if haproxy service template exists" - ansible.builtin.stat: - path: /etc/systemd/system/haproxy@.service - register: __sap_ha_pacemaker_cluster_register_haproxy_template - -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy service template" - ansible.builtin.copy: - dest: /etc/systemd/system/haproxy@.service - remote_src: true - src: /usr/lib/systemd/system/haproxy.service - mode: '0644' - when: - - not __sap_ha_pacemaker_cluster_register_haproxy_template.stat.exists - -- name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template description" - ansible.builtin.lineinfile: - backup: true - path: /etc/systemd/system/haproxy@.service - regexp: '^Description=' - line: 'Description=HAProxy Load Balancer %i' - state: present - insertafter: '^[Unit]$' - notify: "systemd daemon-reload" - -- name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true - path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' - notify: "systemd daemon-reload" - -- name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for HANA" - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_healthcheck_list_hana: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_port }}" - # If no custom port is defined, calculate the port for the secondary - # by adding 10, to avoid a conflict with the port for the primary hc port. - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" - port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port }} - {%- else %}0{%- endif %} - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 - -- name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for NW ASCS/ERS" - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_healthcheck_list_ascs: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port }}" - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port }}" - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 - - -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" - ansible.builtin.blockinfile: - backup: false - create: true - path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" - mode: "0644" - owner: root - group: root - marker: "# {mark} Created by Ansible role sap_ha_pacemaker_cluster" - block: | - global - chroot /var/lib/haproxy - pidfile /var/run/haproxy-%i.pid - user haproxy - group haproxy - daemon - - defaults - mode tcp - log global - option dontlognull - option redispatch - retries 3 - timeout queue 1m - timeout connect 10s - timeout client 1m - timeout server 1m - timeout check 10s - maxconn 3000 - - # Listener for SAP healthcheck - listen healthcheck - bind *:{{ haproxy_item.port }} - loop: "{{ __sap_ha_pacemaker_cluster_healthcheck_list_hana }}" - loop_control: - loop_var: haproxy_item - label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 - - haproxy_item.port | length > 4 - - -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for NWAS ASCS/ERS instances" - ansible.builtin.blockinfile: - create: true - path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" - mode: "0644" - owner: root - group: root - marker: "# {mark} Created by Ansible role sap_ha_pacemaker_cluster" - block: | - global - chroot /var/lib/haproxy - pidfile /var/run/haproxy-%i.pid - user haproxy - group haproxy - daemon - - defaults - mode tcp - log global - option dontlognull - option redispatch - retries 3 - timeout queue 1m - timeout connect 10s - timeout client 1m - timeout server 1m - timeout check 10s - maxconn 3000 - - # Listener for SAP healthcheck - listen healthcheck - bind *:{{ haproxy_item.port }} - loop: "{{ __sap_ha_pacemaker_cluster_healthcheck_list_ascs }}" - loop_control: - loop_var: haproxy_item - label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 - - -- name: "SAP HA Install Pacemaker - GCP CE VM - Ensure that haproxy service is running" - ansible.builtin.service: - name: haproxy - enabled: false - state: started +- name: "SAP HA Install Pacemaker - GCP CE VM - haproxy block" + when: sap_ha_pacemaker_cluster_vip_method == 'gcp_nlb_reserved_ip_haproxy' + block: + + - name: "SAP HA Install Pacemaker - GCP CE VM - Install haproxy" + ansible.builtin.package: + name: haproxy + state: present + + - name: "SAP HA Install Pacemaker - GCP CE VM - Check if haproxy service template exists" + ansible.builtin.stat: + path: /etc/systemd/system/haproxy@.service + register: __sap_ha_pacemaker_cluster_register_haproxy_template + + - name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy service template" + ansible.builtin.copy: + dest: /etc/systemd/system/haproxy@.service + remote_src: true + src: /usr/lib/systemd/system/haproxy.service + mode: '0644' + when: + - not __sap_ha_pacemaker_cluster_register_haproxy_template.stat.exists + + - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template description" + ansible.builtin.lineinfile: + backup: true + path: /etc/systemd/system/haproxy@.service + regexp: '^Description=' + line: 'Description=HAProxy Load Balancer %i' + state: present + insertafter: '^[Unit]$' + notify: "systemd daemon-reload" + + - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template environment" + ansible.builtin.lineinfile: + backup: true + path: /etc/systemd/system/haproxy@.service + regexp: '^Environment=' + line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' + state: present + insertafter: '^[Service]$' + notify: "systemd daemon-reload" + + - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for HANA" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_healthcheck_list_hana: + - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_port }}" + # If no custom port is defined, calculate the port for the secondary + # by adding 10, to avoid a conflict with the port for the primary hc port. + - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" + port: >- + {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port }} + {%- else %}0{%- endif %} + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 + + - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for NW ASCS/ERS" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_healthcheck_list_ascs: + - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port }}" + - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port }}" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + + + - name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" + ansible.builtin.blockinfile: + backup: false + create: true + path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" + mode: "0644" + owner: root + group: root + marker: "# {mark} Created by Ansible role sap_ha_pacemaker_cluster" + block: | + global + chroot /var/lib/haproxy + pidfile /var/run/haproxy-%i.pid + user haproxy + group haproxy + daemon + + defaults + mode tcp + log global + option dontlognull + option redispatch + retries 3 + timeout queue 1m + timeout connect 10s + timeout client 1m + timeout server 1m + timeout check 10s + maxconn 3000 + + # Listener for SAP healthcheck + listen healthcheck + bind *:{{ haproxy_item.port }} + loop: "{{ __sap_ha_pacemaker_cluster_healthcheck_list_hana }}" + loop_control: + loop_var: haproxy_item + label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 + - haproxy_item.port | length > 4 + + + - name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for NWAS ASCS/ERS instances" + ansible.builtin.blockinfile: + create: true + path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" + mode: "0644" + owner: root + group: root + marker: "# {mark} Created by Ansible role sap_ha_pacemaker_cluster" + block: | + global + chroot /var/lib/haproxy + pidfile /var/run/haproxy-%i.pid + user haproxy + group haproxy + daemon + + defaults + mode tcp + log global + option dontlognull + option redispatch + retries 3 + timeout queue 1m + timeout connect 10s + timeout client 1m + timeout server 1m + timeout check 10s + maxconn 3000 + + # Listener for SAP healthcheck + listen healthcheck + bind *:{{ haproxy_item.port }} + loop: "{{ __sap_ha_pacemaker_cluster_healthcheck_list_ascs }}" + loop_control: + loop_var: haproxy_item + label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + + + - name: "SAP HA Install Pacemaker - GCP CE VM - Ensure that haproxy service is running" + ansible.builtin.service: + name: haproxy + enabled: false + state: started diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index b00659f1c..de28edbf1 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -219,7 +219,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: aws_vpc_move_ip +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_aws_ec2_vs | default('aws_vpc_move_ip') }}" sap_ha_pacemaker_cluster_vip_group_prefix: '' # the default supported VIP agent is a single resource only __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index cb38f9e5d..2b79bcc9f 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -103,7 +103,15 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: gcp_nlb_reserved_ip_haproxy # gcp_vpc_move_route +# Google documentation differs for each OS: +# SUSE - VIP: IPaddr2, Healthcheck: No pacemaker resources, but directly as part of NLB healthcheck +# HANA: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_a_local_cluster_ip_resource_for_the_vip_address +# NWAS: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-sles#create_the_vip_resources +# RHEL - VIP: IPaddr2, Healthcheck: haproxy +# HANA: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-rhel#create_a_virtual_ip_address_resource +# NWAS: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-rhel#create_a_virtual_ip_address_resource +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_gcp_ce_vm | default('gcp_nlb_reserved_ip_haproxy') }}" + sap_ha_pacemaker_cluster_vip_group_prefix: group_ __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index a1314928a..8c1c5237f 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -74,7 +74,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: ipaddr_custom +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_powervs | default('ipaddr_custom') }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index c058300a9..5663889b5 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -50,7 +50,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: ibmcloud_alb_haproxy +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_vs | default('ibmcloud_alb_haproxy') }}" # For HAPROXY an non-empty port default is required to enter the resource creation flow. # TODO: task logic that configures actual haproxy listening ports, diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index 875dbd721..e34e3975d 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -118,7 +118,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: azure_lb +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_msazure_vm | default('azure_lb') }}" # The VIP layer consists of 2 components - the VIP and the health check resource sap_ha_pacemaker_cluster_vip_group_prefix: group_ diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index 8410754ec..af4b1e665 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -70,7 +70,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: ipaddr +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.hyp_ibmpower_vm | default('ipaddr') }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 5c144d236..de2b19c86 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -100,6 +100,9 @@ __sap_ha_pacemaker_cluster_sap_extra_packages_dict: nwas: - resource-agents-sap +# Dictionary with preferred platform specific VIP method that differs from default +# __sap_ha_pacemaker_cluster_vip_method_dict: + # Resource agents - fully qualified names __sap_ha_pacemaker_cluster_resource_agents: saphanatopology: "ocf:heartbeat:SAPHanaTopology" diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index c72abff6b..664f041ea 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -64,6 +64,10 @@ __sap_ha_pacemaker_cluster_sap_extra_packages_dict: - sap-suse-cluster-connector - sapstartsrv-resource-agents +# Dictionary with preferred platform specific VIP method that differs from default +__sap_ha_pacemaker_cluster_vip_method_dict: + cloud_gcp_ce_vm: ipaddr + # Resource agents - fully qualified names __sap_ha_pacemaker_cluster_resource_agents: saphanatopology: "ocf:suse:SAPHanaTopology" From a865c66f7fd0bf5f9ff4e95be5f88406952eb060 Mon Sep 17 00:00:00 2001 From: rhmk Date: Wed, 11 Sep 2024 12:16:59 +0200 Subject: [PATCH 154/210] removed interactive version on request from @seanfreeman --- playbooks/sap_hana_preconfigure.yml | 126 ---------------------------- 1 file changed, 126 deletions(-) delete mode 100644 playbooks/sap_hana_preconfigure.yml diff --git a/playbooks/sap_hana_preconfigure.yml b/playbooks/sap_hana_preconfigure.yml deleted file mode 100644 index 159acf890..000000000 --- a/playbooks/sap_hana_preconfigure.yml +++ /dev/null @@ -1,126 +0,0 @@ ---- -## -# Call this playbook interactively with -# ansible-playbook community.sap_install.sap_hana_preconfigure -# -# or alternatively unattended with -# ansible-playbook community.sap_install.sap_hana_preconfigure -e @myvars.yml -# -# The file myvars.yaml needs to contain the following variables -# -# please read README.md in playbooks folder for details -# -- name: Playbook Usage - hosts: localhost - gather_facts: false - tasks: - - name: Playbook Usage # noqa trailing-spaces - ansible.builtin.debug: - msg: |+ - ***************************************************************************** - * sap_hana_preconfigure * - * * - * This playbook is used to prepare an SAP HANA system. * - * The minimum viable parameters to successfully prepare your system for an * - * SAP HANA installation will be asked. * - * Useful defaults will be set, so that it is save to just press enter * - * * - * If you want to run these steps unattended, please use the playbook * - * sap_hana_preconfigure_exec.yml instead with a properly prepared variable * - * file. (See README for more details) * - ***************************************************************************** - -- name: Collecting Parameters for OS preparation or check to install SAP HANA - hosts: localhost - gather_facts: false - - vars: - - sap_systems: "{{ (groups['all'] == []) | ternary ('localhost', 'all') }}" - # sap_systems: "{{ (groups['all'] == []) | ternary ('localhost', groups['all'] | join(',')) }}" - - tasks: - - name: Get minimal facts - ansible.builtin.setup: - gather_subset: - - '!all' - - - name: Target systems for hana installation - ansible.builtin.pause: - prompt: "Enter comma separated list of systems that you want to check or prepare for SAP HANA: [{{ sap_systems }}]" - echo: true - register: _sap_systems - - - name: SAP server DNS domain must not be empty - ansible.builtin.pause: - prompt: "Enter DNS Domainname of your SAP systems: [{{ sap_domain | d(ansible_domain) }}]" - echo: true - register: _sap_domain - - - name: Run mode - ansible.builtin.pause: - prompt: "Do you want to check the current setup only (assert mode)? (y/n) [n]" - echo: true - register: _assert_mode - - - name: Input additional parameters if no assert mode is defined - when: _assert_mode.user_input != "y" - block: - - ansible.builtin.pause: # noqa name[missing] - role default true - prompt: "Do you want the system to update /etc/hosts for SAP? (y/n) [y]" - echo: true - register: _sap_update_hosts - - ansible.builtin.pause: # noqa name[missing] - role default false - prompt: "Do you want to update the system? (y/n) [n]" - echo: true - register: _sap_update - - ansible.builtin.pause: # noqa name[missing] - role default false - prompt: "Do you want to reboot the system if required? (y/n) [n]" - echo: true - register: _sap_reboot - - ansible.builtin.pause: # noqa name[missing] - role default true - prompt: "Do you want to stop with an error if the system needs a reboot? (y/n) [y]" - echo: true - register: _sap_fail_if_reboot_required - when: _sap_reboot.user_input != 'y' - - - name: Prepare inventory - when: - - _sap_systems.user_input is defined - - _sap_systems.user_input| trim != '' - ansible.builtin.add_host: - groups: sap_hana_prepare_hosts - name: '{{ item }}' - loop: '{{ _sap_systems.user_input | split(",") | list }}' - - - name: Configure Role Variables - ansible.builtin.set_fact: - sap_domain: '{{ ((_sap_domain.user_input | trim) != "") | ternary(_sap_domain.user_input, sap_domain | d(ansible_domain)) }}' - ### redhat.sap_install.sap_general_preconfigure - sap_general_preconfigure_modify_etc_hosts: '{{ (_sap_update_hosts.user_input is defined) and (_sap_update_hosts.user_input == "n") | ternary(false, true) }}' # default true - sap_general_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false - sap_general_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true - sap_general_preconfigure_assert: '{{ (_assert_mode.user_input == "y") | ternary(true, false) }}' - # sap_general_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - ### redhat.sap_install.sap_hana_preconfigure - sap_hana_preconfigure_update: '{{ (_sap_update.user_input is defined) and (_sap_update.user_input == "y") | ternary(true, false) }}' # default false - sap_hana_preconfigure_fail_if_reboot_required: '{{ (_sap_fail_if_reboot_required.user_input is defined) and (_sap_fail_if_reboot_required.user_input == "n") | ternary(false, true) }}' # default true - sap_hana_preconfigure_reboot_ok: '{{ (_sap_reboot.user_input is defined) and (_sap_reboot.user_input == "y") | ternary(true, false) }}' # default false - sap_hana_preconfigure_assert: '{{ (_assert_mode.user_input == "y") | ternary(true, false) }}' - # sap_hana_preconfigure_system_roles_collection: 'redhat.rhel_system_roles' - -- name: Run sap_hana_prepare_exec playbook - ansible.builtin.import_playbook: sap_hana_preconfigure_exec.yml - vars: - sap_playbook_parameter_confirm: true - sap_hana_group: "{{ (groups['sap_hana_prepare_hosts'] is defined) | ternary ('sap_hana_prepare_hosts',sap_systems) }}" - sap_domain: "{{ hostvars['localhost']['sap_domain'] }}" - sap_general_preconfigure_modify_etc_hosts: "{{ hostvars['localhost']['sap_general_preconfigure_modify_etc_hosts'] }}" - sap_general_preconfigure_update: "{{ hostvars['localhost']['sap_general_preconfigure_update'] }}" - sap_general_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_general_preconfigure_fail_if_reboot_required'] }}" - sap_general_preconfigure_assert: "{{ hostvars['localhost']['sap_general_preconfigure_assert'] }}" - sap_general_preconfigure_assert_ignore_errors: true - sap_hana_preconfigure_update: "{{ hostvars['localhost']['sap_hana_preconfigure_update'] }}" - sap_hana_preconfigure_fail_if_reboot_required: "{{ hostvars['localhost']['sap_hana_preconfigure_fail_if_reboot_required'] }}" - sap_hana_preconfigure_reboot_ok: "{{ hostvars['localhost']['sap_hana_preconfigure_reboot_ok'] }}" - sap_hana_preconfigure_assert: "{{ hostvars['localhost']['sap_hana_preconfigure_assert'] }}" - sap_hana_preconfigure_assert_ignore_errors: true From f6800171941687538ba49bea30efdb0eb16e9cb2 Mon Sep 17 00:00:00 2001 From: rhmk Date: Wed, 11 Sep 2024 14:13:10 +0200 Subject: [PATCH 155/210] Updated README file, how to use the playbooks --- playbooks/README.md | 71 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/playbooks/README.md b/playbooks/README.md index 7ebccf8f8..09fc946dd 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -1,48 +1,26 @@ # Ansible Collection Playbooks -The playbooks in this directory can be used as templates for your own playbooks -(starting with sample-) and some can be called directly with interactive variable collection -or included in your own playbooks or workflows. +The playbooks starting with `sample-` in this directory can be used as examples for your own playbooksi and cannot be called directly from the commandline. +The other playbooks can be called directly with a prepared variable file or imported in your own playbooks or workflows. +The playbooks can run agianst localhost, all hosts or defined group. ## Usage of playbooks -### Prepare System for SAP HANA installation (sap_hana_prepare.yml/sap_hana_prepare_exec.yml) - -This playbook collects information for preparing an SAP system for an SAP HANA installation. -Run the following command: - -```[bash] -ansible-playbook community.sap_install.sap_hana_preconfigure.yml -``` +### Prepare System for SAP HANA installation: `sap_hana_prepare_exec.yml` This playbook runs against localhost and/or remote hosts. -Remote hosts can be defined in an inventory file, or with -i on the commandline e.g. `-i inventoryfile` or `-i host1,host2,host3,` and execution can be limited with -l. -You need to confirm the hosts in the interactive dialog. -When you call this playbook against a remote host make sure the user can connect and assume root without a password or pass the following parameters if necessary +You need to define the variable `sap_hana_group`to run this playbook against a particular group of hosts which is defined in your inventory. +If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. -```[bash] - -u : User that establishes the ssh connection - -k: asks for password or passphrase of the connection user, if required for ssh - -K: asks for the privilege escalation password of the connection user to become root on the target host -``` +To run this playbook you need to prepare a variable file with a minimum viable set of variables. -If you want to embed this playbook or run a non-interactive version, you need to prepare an ansible inventory that contains a group for the hosts you want to install, e.g. my_hanas (see also ). +#### Example: -Create the file `my_inventory` similar to: - -```[yaml] -[my_hanas] -hana1 -hana2 -``` - -Prepare a variable config file with the following parameters (adapt to your needs): Create a parameter file `my_vars.yml` with similar content: ```[yaml] - # sap_playbook_parameter_confirm: false - sap_hana_group: 'my_hanas' + # sap_playbook_parameter_confirm: false # Set to true if you want to list parameters and confirm execution sap_domain: my.sap.domain sap_general_preconfigure_modify_etc_hosts: true sap_general_preconfigure_update: true @@ -52,10 +30,35 @@ Create a parameter file `my_vars.yml` with similar content: sap_hana_preconfigure_reboot_ok: true ``` -Now you can run the playbook non-interactively with +Create the file `my_inventory` similar to: + +```[yaml] +[my_hanas] +hana1 +hana2 +``` + +Now you can run the playbook with ```[bash] -ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml +ansible-playbook community.sap_install.sap_hana_preconfigure_exec.yml -i my_inventory -e @my_vars.yml -e sap_hana_group=my_hanas +``` + +When you call this playbook against a remote host make sure the user can connect and assume root without a password or pass the following parameters if necessary + +```[bash] + -u : User that establishes the ssh connection + -k: asks for password or passphrase of the connection user, if required for ssh + -K: asks for the privilege escalation password of the connection user to become root on the target host +``` + +You can also call the playbook inside another playbook with: + +``` +- name: Include HANA preparation from collection for group my_hanas + ansible.builtin.import_playbook: community.sap_install.sap_hana_prepare_exec.yml + vars: + sap_hana_group: my_hanas + # add other vars here, or define somewhere else ``` -NOTE: If you do not define the parameter `sap_hana_group` the playbook will run against all hosts in the inventory unless limited with `-l hostname' or localhost if no inventory is defined. From 6f0b681b6b2c70835dc8885941fe5624ef75837b Mon Sep 17 00:00:00 2001 From: rhmk Date: Wed, 11 Sep 2024 14:15:58 +0200 Subject: [PATCH 156/210] codespell fix --- playbooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/README.md b/playbooks/README.md index 09fc946dd..02987c363 100644 --- a/playbooks/README.md +++ b/playbooks/README.md @@ -3,7 +3,7 @@ The playbooks starting with `sample-` in this directory can be used as examples for your own playbooksi and cannot be called directly from the commandline. The other playbooks can be called directly with a prepared variable file or imported in your own playbooks or workflows. -The playbooks can run agianst localhost, all hosts or defined group. +The playbooks can run against localhost, all hosts or defined group. ## Usage of playbooks From 5b34c18d617c1a123117d0b6e50d45de3c4cafb0 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 12 Sep 2024 13:43:39 +0200 Subject: [PATCH 157/210] feat: GCP VIP rework SUSE socat resource added IPaddr2 resource fixed Additional resource cleanup for ASCS/ERS Updated names for health check resources --- .../defaults/main.yml | 16 ++++++++++ .../Suse/post_steps_nwas_abap_ascs_ers.yml | 10 ------- ...nfigure_nwas_ascs_ers_postinstallation.yml | 20 ++++++++----- ...uct_vars_vip_resources_cloud_gcp_ce_vm.yml | 29 ++++++++++++++++++- roles/sap_ha_pacemaker_cluster/vars/main.yml | 8 ----- .../vars/platform_cloud_gcp_ce_vm.yml | 8 ++++- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 1 + roles/sap_ha_pacemaker_cluster/vars/suse.yml | 5 +++- 8 files changed, 69 insertions(+), 28 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 959800add..457abf5fb 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -157,9 +157,14 @@ sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name: >- sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: '' sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary +sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary + sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: '' sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly +sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly sap_ha_pacemaker_cluster_healthcheck_hana_primary_id: "{{ sap_ha_pacemaker_cluster_hana_sid + 'prim' }}" sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id: "{{ sap_ha_pacemaker_cluster_hana_sid + 'ro' }}" @@ -224,15 +229,26 @@ sap_ha_pacemaker_cluster_resource_filesystem_force_unmount: safe sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address: '' sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} + sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address: '' sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} + sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: '' sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_PAS{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }} +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_PAS{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }} + sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: '' sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: >- rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_AAS{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }} +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: >- + rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_AAS{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }} # SAP NetWeaver common - Resource IDs (names) as convenience parameters diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml index cf78e8a84..06d95406a 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml @@ -51,16 +51,6 @@ changed_when: false run_once: true # noqa: run_once[task] - # # Workaround situation when ASCS and ERS mounts are not present on both nodes. - # - name: "SAP HA Install Pacemaker - SAPStartSrv crm resource cleanup" - # ansible.builtin.command: - # cmd: crm resource cleanup {{ item }} - # loop: - # - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name }}" - # - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name }}" - # when: sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - # changed_when: true - - name: "SAP HA Install Pacemaker - Fetch CIB configuration" ansible.builtin.command: cmd: cibadmin --query diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml index 24e25f586..9993ebf9f 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml @@ -244,17 +244,17 @@ and 'FALSE' in __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout) or (__sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout is defined and 'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout)" + vars: + __rsc_ascs: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + else sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" + __rsc_ers: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + else sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}" block: - name: "SAP HA Pacemaker - (SAP HA Interface) Restart ASCS ERS resources" ansible.builtin.shell: | {{ __sap_ha_pacemaker_cluster_command.resource_restart }} {{ restart_item }} - vars: - __rsc_ascs: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" - __rsc_ers: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}" loop: - "{{ __rsc_ascs }}" - "{{ __rsc_ers }}" @@ -282,6 +282,12 @@ changed_when: false failed_when: false + # Ensure there are no errors after resources were restarted + - name: "SAP HA Install Pacemaker - Cluster resource cleanup after restart" + ansible.builtin.shell: | + {{ __sap_ha_pacemaker_cluster_command.resource_cleanup }} + changed_when: true + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HACheckConfig for ASCS" when: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml index 8ef851629..4877e7cdc 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml @@ -15,7 +15,7 @@ vars: __resource_vip: id: "{{ vip_list_item.key }}" - agent: "{{ __sap_ha_pacemaker_cluster_available_vip_agents[sap_ha_pacemaker_cluster_vip_method].agent }}" + agent: "{{ __sap_ha_pacemaker_cluster_available_vip_agents['ipaddr'].agent | d('ocf:heartbeat:IPaddr2') }}" instance_attrs: - attrs: - name: ip @@ -74,3 +74,30 @@ - sap_ha_pacemaker_cluster_vip_method == 'gcp_nlb_reserved_ip_haproxy' - vip_list_item.key in __sap_ha_pacemaker_cluster_healthcheck_resource_list - __haproxy_id | length > 0 + + +- name: "SAP HA Prepare Pacemaker - GCP CE - Add resource: Socat resource for Health Checks (socat)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__health_check] }}" + vars: + __health_check: + id: "{{ vip_list_item.key }}" + agent: "{{ __sap_ha_pacemaker_cluster_available_vip_agents[sap_ha_pacemaker_cluster_vip_method].agent }}" + instance_attrs: + - attrs: + - name: binfile + value: "/usr/bin/socat" + - name: cmdline_options + value: "-U TCP-LISTEN:{{ vip_list_item.value }},backlog=10,fork,reuseaddr /dev/null" + operations: + - action: monitor + attrs: + - name: interval + value: 10 + - name: timeout + value: 20 + + when: + - vip_list_item.key not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + - sap_ha_pacemaker_cluster_vip_method == 'gcp_anything_socat' + - vip_list_item.key in __sap_ha_pacemaker_cluster_healthcheck_resource_list diff --git a/roles/sap_ha_pacemaker_cluster/vars/main.yml b/roles/sap_ha_pacemaker_cluster/vars/main.yml index 16f9feb04..2e682ca4d 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/main.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/main.yml @@ -41,14 +41,6 @@ __sap_ha_pacemaker_cluster_available_vip_agents: ipaddr: agent: "ocf:heartbeat:IPaddr2" -# Health check helper variable for platforms that require it -sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" -sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: "hc_{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" - # For convenience to distinguish between VIP and HC resources: __sap_ha_pacemaker_cluster_vip_resource_list: - "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 2b79bcc9f..e5edfac7c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -104,7 +104,7 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker # Platform specific VIP handling # Google documentation differs for each OS: -# SUSE - VIP: IPaddr2, Healthcheck: No pacemaker resources, but directly as part of NLB healthcheck +# SUSE - VIP: IPaddr2, Healthcheck: anything using socat # HANA: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-sles#create_a_local_cluster_ip_resource_for_the_vip_address # NWAS: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-sles#create_the_vip_resources # RHEL - VIP: IPaddr2, Healthcheck: haproxy @@ -159,3 +159,9 @@ __sap_ha_pacemaker_cluster_available_vip_agents: gcp_vpc_move_route: agent: "ocf:heartbeat:gcp-vpc-move-route" with: ipaddr + + # This is dummy resource to run socat process for Health checks on SUSE + # https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-sles#create_the_health_check_resources + gcp_anything_socat: + agent: "anything" + with: ipaddr diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index de2b19c86..65a47cb23 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -56,6 +56,7 @@ __sap_ha_pacemaker_cluster_command: resource_defaults_show: "pcs resource defaults config" resource_defaults_update: "pcs resource defaults update" resource_restart: "pcs resource restart" + resource_cleanup: "pcs resource cleanup" # Default corosync options - OS specific __sap_ha_pacemaker_cluster_corosync_totem_default: diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index 664f041ea..658cb64f9 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -19,6 +19,7 @@ __sap_ha_pacemaker_cluster_command: resource_defaults_show: "crm configure show type:rsc_defaults" resource_defaults_update: "crm configure rsc_defaults" resource_restart: "crm resource restart" + resource_cleanup: "crm resource cleanup" # Default corosync options - OS specific __sap_ha_pacemaker_cluster_corosync_totem_default: @@ -46,6 +47,8 @@ __sap_ha_pacemaker_cluster_fence_agent_packages_dict: __sap_ha_pacemaker_cluster_platform_extra_packages_dict: cloud_aws_ec2_vs: - awscli + cloud_gcp_ce_vm: + - socat cloud_msazure_vm: - socat @@ -66,7 +69,7 @@ __sap_ha_pacemaker_cluster_sap_extra_packages_dict: # Dictionary with preferred platform specific VIP method that differs from default __sap_ha_pacemaker_cluster_vip_method_dict: - cloud_gcp_ce_vm: ipaddr + cloud_gcp_ce_vm: gcp_anything_socat # Resource agents - fully qualified names __sap_ha_pacemaker_cluster_resource_agents: From 5297f364821d7615f0450adf785ca0854947bd99 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Mon, 16 Sep 2024 18:27:56 +0200 Subject: [PATCH 158/210] sap_ha_install_hana_hsr: fixes to work for multiple secondaries --- .../tasks/configure_hsr.yml | 2 ++ roles/sap_ha_install_hana_hsr/tasks/main.yml | 23 ++++++++++--------- .../tasks/pki_files.yml | 9 +++++--- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml b/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml index 958ae00ba..1411ec505 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/configure_hsr.yml @@ -32,6 +32,7 @@ # looping through cluster definition to run on secondary node # and apply the respective 'site' value +# - 'throttle' to avoid simultaneous run for multiple secondaries as this confuses the primary - name: "SAP HSR - Register secondary node to HANA System Replication" ansible.builtin.shell: | source /usr/sap/{{ sap_ha_install_hana_hsr_sid }}/home/.sapenv.sh && \ @@ -51,6 +52,7 @@ loop_control: label: "{{ item.node_name }}" changed_when: true + throttle: 1 - name: "SAP HSR - Start HANA instance on secondary" ansible.builtin.shell: | diff --git a/roles/sap_ha_install_hana_hsr/tasks/main.yml b/roles/sap_ha_install_hana_hsr/tasks/main.yml index 15f3ec5a9..dbfb48614 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/main.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/main.yml @@ -20,13 +20,20 @@ node_ip: "{{ item.node_ip }}" node_role: "{{ item.node_role | default('secondary') }}" hana_site: "{{ item.hana_site }}" - loop: "{{ sap_ha_install_hana_hsr_cluster_nodes }}" + loop: "{{ sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_name', 'contains', ansible_hostname) }}" loop_control: label: "{{ item.node_name }}" when: - item.node_ip in ansible_all_ipv4_addresses tags: always +- name: SAP HSR - Verify provided node roles + ansible.builtin.assert: + that: + - sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'primary') | length == 1 + - sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'secondary') | length >= 1 + fail_msg: "Node roles not valid. There must be 1 primary and at least 1 node defined with the secondary role." + - name: SAP HSR - Check that hsr interface is configured on host ansible.builtin.assert: that: @@ -38,16 +45,10 @@ - name: "SAP HSR - Pick up primary node name from definition" ansible.builtin.set_fact: - __sap_ha_install_hana_hsr_primary_node: "{{ item.node_name }}" - __sap_ha_install_hana_hsr_primary_node_name: "{{ item.node_name.split('.')[0] }}" - __sap_ha_install_hana_hsr_primary_node_domain: "{{ item.node_name.split('.')[1:] | join('.') }}" - __sap_ha_install_hana_hsr_primary_node_ip: "{{ item.node_ip }}" - when: - - item.node_role is defined - - item.node_role == 'primary' - loop: "{{ sap_ha_install_hana_hsr_cluster_nodes }}" - loop_control: - label: "{{ item.node_name }}" + __sap_ha_install_hana_hsr_primary_node: "{{ (sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'primary'))[0].node_name }}" + __sap_ha_install_hana_hsr_primary_node_name: "{{ (sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'primary'))[0].node_name.split('.')[0] }}" + __sap_ha_install_hana_hsr_primary_node_domain: "{{ (sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'primary'))[0].node_name.split('.')[1:] | join('.') }}" + __sap_ha_install_hana_hsr_primary_node_ip: "{{ (sap_ha_install_hana_hsr_cluster_nodes | selectattr('node_role', '==', 'primary'))[0].node_ip }}" tags: always - name: "SAP HSR - Verify that Ansible can connect to the defined primary node by name" diff --git a/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml b/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml index b0bbbd080..d3cb9ef80 100644 --- a/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml +++ b/roles/sap_ha_install_hana_hsr/tasks/pki_files.yml @@ -23,10 +23,8 @@ cat ~/.ssh/hsr_temp.pub || \ (ssh-keygen -t rsa -f ~/.ssh/hsr_temp -N "" -q && \ cat ~/.ssh/hsr_temp.pub) - args: - creates: ~/.ssh/hsr_temp.pub register: __sap_ha_install_hana_hsr_pubkey - failed_when: false + changed_when: true - name: "SAP HSR - Create .ssh on primary node if missing" ansible.builtin.file: @@ -35,6 +33,7 @@ mode: "0700" register: __sap_ha_install_hana_hsr_create_ssh_prim delegate_to: "{{ __sap_ha_install_hana_hsr_primary_node }}" + run_once: true - name: "SAP HSR - Authorize pub key on primary node" ansible.builtin.lineinfile: @@ -45,6 +44,7 @@ path: ~/.ssh/authorized_keys register: __sap_ha_install_hana_hsr_addauth delegate_to: "{{ __sap_ha_install_hana_hsr_primary_node }}" + throttle: 1 # ansible-lint: # The synchronize module is not part of ansible-core collections. @@ -106,6 +106,7 @@ when: - __sap_ha_install_hana_hsr_addauth.backup is defined - __sap_ha_install_hana_hsr_addauth.backup|length == 0 + throttle: 1 - name: "SAP HSR - Primary: Restore authorized_keys from backup" ansible.builtin.copy: @@ -117,6 +118,7 @@ when: - __sap_ha_install_hana_hsr_addauth.backup is defined - __sap_ha_install_hana_hsr_addauth.backup|length > 0 + run_once: true - name: "SAP HSR - Primary: Remove .ssh if it was created" ansible.builtin.file: @@ -126,3 +128,4 @@ - __sap_ha_install_hana_hsr_create_ssh_prim.changed is defined - __sap_ha_install_hana_hsr_create_ssh_prim.changed delegate_to: "{{ __sap_ha_install_hana_hsr_primary_node }}" + run_once: true From c0126806309d4d78d973c9a11061d55be03ea829 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 19 Sep 2024 16:02:32 +0200 Subject: [PATCH 159/210] sap_swpm: Prioritize sap_swpm_templates_install_dictionary members Due to the use of global variables in sap_swpm, there appears to be no simple way of giving priority to top level vars over the same variables defined in sap_swpm_templates_install_dictionary. We can also assume that if using sap_swpm_templates_install_dictionary, this is done on purpose and with the intention to use its members with priority over top level variables. Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 8 ++-- roles/sap_swpm/tasks/pre_install.yml | 66 ++++++++++++---------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 6d033fb42..69acdc4da 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -111,12 +111,12 @@ previous `default_templates` mode. The dictionary named `sap_swpm_templates_install_dictionary` can hold all necessary variables needed by the role `sap_swpm` for different SAP products. See the `Ansible Playbooks for SAP` for examples. -The role `sap_swpm` redefines low level members of this dictionary to top level -variables. The dictionary may contain either the definitions for the previous -version of the role (used in the previous role modes `default_templates` and `advanced_templates`), +The role `sap_swpm` defines top level variables from low level members of this dictionary. +The dictionary may contain either the definitions for the previous version of the role +(used in the previous role modes `default_templates` and `advanced_templates`), or an updated definition of the dictionary containing the new variable names. The role will fail if both old and new variable names are defined in the dictionary. -Variables on the top level take precedences over those members of `sap_swpm_templates_install_dictionary` with the same name. +Variables on the top level will be overridden by members of `sap_swpm_templates_install_dictionary` with the same name. Following is the complete list of conversions of members of the dictionary `sap_swpm_templates_install_dictionary`, where `sap_prod` is an example entry for `sap_swpm_templates_product_input`: diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 304a49874..3e8436560 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -17,6 +17,7 @@ - sap_swpm_inifile_custom_values_dictionary is defined tags: always +# Note: Variable definitions in sap_swpm_templates_install_dictionary will overwrite existing top level definitions. - name: SAP SWPM Pre Install - Define variables from 'sap_swpm_templates_install_dictionary' if present when: sap_swpm_templates_install_dictionary is defined tags: always @@ -26,8 +27,9 @@ ansible.builtin.debug: msg: - "sap_swpm_templates_product_input: >{{ sap_swpm_templates_product_input }}<" + ignore_errors: true - - name: SAP SWPM Pre Install - Ensure that only one of 'sap_swpm_inifile_sections_list' and 'sap_swpm_inifile_list' is defined in the dict + - name: SAP SWPM Pre Install - Fail if 'sap_swpm_inifile_sections_list' and 'sap_swpm_inifile_list' are both defined in the dict ansible.builtin.fail: msg: - "FAIL: In 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]', both" @@ -37,7 +39,7 @@ - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list'] is defined - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] is defined - - name: SAP SWPM Pre Install - Ensure that only one of 'sap_swpm_inifile_parameters_dict' or 'sap_swpm_inifile_custom_values_dictionary' is defined in the dict + - name: SAP SWPM Pre Install - Fail if 'sap_swpm_inifile_parameters_dict' and 'sap_swpm_inifile_custom_values_dictionary' are both defined in the dict ansible.builtin.fail: msg: - "FAIL: In 'sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]', both" @@ -47,27 +49,27 @@ - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] is defined - sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] is defined -# Define sap_swpm_product_catalog_id from low level member, or use top level variable if defined. Top level variable has precedence. +# Unconditionally define sap_swpm_product_catalog_id from low level member. - name: SAP SWPM Pre Install - Define 'sap_swpm_product_catalog_id' from low level member with the same name ansible.builtin.set_fact: - sap_swpm_product_catalog_id: "{{ sap_swpm_product_catalog_id | - d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id']) }}" +# sap_swpm_product_catalog_id: "{{ sap_swpm_product_catalog_id | +# d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id']) }}" + sap_swpm_product_catalog_id: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] }}" when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_product_catalog_id'] is defined - - name: SAP SWPM Pre Install - Display sap_swpm_product_catalog_id + - name: SAP SWPM Pre Install - Display 'sap_swpm_product_catalog_id' ansible.builtin.debug: msg: "sap_swpm_product_catalog_id: >{{ sap_swpm_product_catalog_id }}<" -# Define sap_swpm_inifile_sections_list from low level member, or use top level variable if defined. Top level variable has precedence. +# Unconditionally define sap_swpm_inifile_sections_list from low level member. - name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_sections_list' from low level member ansible.builtin.set_fact: - sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_sections_list | - d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list']) | + sap_swpm_inifile_sections_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] | d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list']) }}" when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_list'] is defined or sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_sections_list'] is defined -# Define sap_swpm_role_parameters_dict from low level member. Top level variable does not exist. +# Define sap_swpm_role_parameters_dict from low level member. - name: SAP SWPM Pre Install - Define 'sap_swpm_role_parameters_dict' from low level member ansible.builtin.set_fact: sap_swpm_role_parameters_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_dictionary'] | @@ -75,54 +77,42 @@ when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_dictionary'] is defined or sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict'] is defined -# Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict': + - name: SAP SWPM Pre Install - Display 'sap_swpm_role_parameters_dict' + ansible.builtin.debug: + msg: "sap_swpm_role_parameters_dict: >{{ sap_swpm_role_parameters_dict }}<" + when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict + ignore_errors: true + +# Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict'. # Reason for noqa: We are setting variables from the content of a dict, and the variable names are in the dict keys. - name: SAP SWPM Pre Install - Define role variables from low level member, looping over 'sap_swpm_role_parameters_dict' # noqa var-naming[no-jinja] ansible.builtin.set_fact: - "{{ line_item.key }}": "{{ lookup('vars', line_item.key, default=line_item.value) }}" + "{{ line_item.key }}": "{{ line_item.value }}" loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" loop_control: loop_var: line_item - when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict + when: + - sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - - name: SAP SWPM Pre Install - Display all vars of 'sap_swpm_role_parameters_dict' + - name: SAP SWPM Pre Install - Display all vars and values of 'sap_swpm_role_parameters_dict' ansible.builtin.debug: - msg: "{{ line_item.key }}: {{ lookup('vars', line_item.key) }}" + msg: "{{ line_item.key }}: >{{ lookup('vars', line_item.key) }}<" loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" loop_control: loop_var: line_item when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - - - name: SAP SWPM Pre Install - Looking for any differences... - ansible.builtin.set_fact: - different_values_sap_swpm_role_parameters_dict: - "{{ different_values_sap_swpm_role_parameters_dict | d({}) | combine({line_item.key: line_item.value}) }}" - loop: "{{ sap_swpm_role_parameters_dict | dict2items if sap_swpm_role_parameters_dict is mapping else [] }}" - loop_control: - loop_var: line_item - when: - - sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - - line_item.value != lookup('vars', line_item.key) ignore_errors: true - - name: SAP SWPM Pre Install - Display any differences - ansible.builtin.debug: - msg: - - "Note: The following values from" - - "sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_role_parameters_dict']" - - "are ignored because they have already been defined on the top level, as follows:" - - "{{ different_values_sap_swpm_role_parameters_dict }}" - when: sap_swpm_role_parameters_dict is defined and sap_swpm_role_parameters_dict - -# Define sap_swpm_inifile_parameters_dict from low level member, or use top level variable if defined. Top level variable has precedence. +# Define sap_swpm_inifile_parameters_dict from low level member, or use top level variable if defined. Low level definition has precedence. - name: SAP SWPM Pre Install - Define 'sap_swpm_inifile_parameters_dict' from low level member ansible.builtin.set_fact: - sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_parameters_dict | - d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary']) | + sap_swpm_inifile_parameters_dict: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] | d(sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict']) }}" when: sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_custom_values_dictionary'] is defined or sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]['sap_swpm_inifile_parameters_dict'] is defined +# The following task ensures that the two main inifile creation parameters are defined. +# This is necessary when creating the file 'inifile.params'. - name: SAP SWPM Pre Install - Define the main inifile creation parameters as empty if necessary ansible.builtin.set_fact: sap_swpm_inifile_sections_list: "{{ sap_swpm_inifile_sections_list | d([]) }}" From 0ff33728de4016e84173a28c94b2a2c6bdb37e45 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 19 Sep 2024 16:12:42 +0200 Subject: [PATCH 160/210] sap_hana_preconfigure: Add RHEL 8.10 Solves issue #867. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/vars/RedHat_8.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_preconfigure/vars/RedHat_8.yml b/roles/sap_hana_preconfigure/vars/RedHat_8.yml index 432848f1a..d21a720d7 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_8.yml @@ -9,6 +9,7 @@ __sap_hana_preconfigure_supported_rhel_minor_releases: - "8.4" - "8.6" - "8.8" + - "8.10" # required repos for RHEL 8: __sap_hana_preconfigure_req_repos_redhat_8_0_x86_64: @@ -123,13 +124,13 @@ __sap_hana_preconfigure_req_repos_redhat_8_10_ppc64le: # required SAP notes for RHEL 8: __sap_hana_preconfigure_sapnotes_versions_x86_64: - - { number: '2777782', version: '40' } + - { number: '2777782', version: '49' } - { number: '2382421', version: '40' } - { number: '3024346', version: '10' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '87' } - - { number: '2777782', version: '40' } + - { number: '2777782', version: '49' } - { number: '2382421', version: '40' } - { number: '3024346', version: '10' } @@ -188,6 +189,16 @@ __sap_hana_preconfigure_min_packages_8_8_x86_64: __sap_hana_preconfigure_min_packages_8_8_ppc64le: - [ 'kernel', '4.18.0-477.13.1.el8_8' ] +__sap_hana_preconfigure_min_packages_8_9_x86_64: + +__sap_hana_preconfigure_min_packages_8_9_ppc64le: + +__sap_hana_preconfigure_min_packages_8_10_x86_64: + - [ 'kernel', '4.18.0-553.16.1.el8_10' ] + +__sap_hana_preconfigure_min_packages_8_10_ppc64le: + - [ 'kernel', '4.18.0-553.16.1.el8_10' ] + __sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" __sap_hana_preconfigure_packages: From 4eb81e3bcae2f0f968bcab1653c999fcf58ff512 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 23 Sep 2024 16:47:51 +0200 Subject: [PATCH 161/210] collection/sample playbooks: Some modifications for sap_hana_preconfigure_exec.yml Solves isse #870. Signed-off-by: Bernd Finger --- playbooks/sap_hana_preconfigure_exec.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index b70cf2a39..14ce9962f 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -7,17 +7,17 @@ # sap_hana_group: name of group in inventory - defaults to localhost if not set # sap_domain: SAP domain - defaults to ansible_domain if not set, but must not be empty # -# for redhat.sap_install.sap_general_preconfigure +# For sap_general_preconfigure: # sap_general_preconfigure_modify_etc_hosts: defaults to true # sap_general_preconfigure_update: defaults to false # sap_general_preconfigure_fail_if_reboot_required: defaults to true # -# for redhat.sap_install.sap_hana_preconfigure +# For sap_hana_preconfigure: # sap_hana_preconfigure_update: defaults to false # sap_hana_preconfigure_fail_if_reboot_required: defaults to true # sap_hana_preconfigure_reboot_ok: defaults to false # -# Please note: if the variable sap_playbook_parameter_confirm is set to true, the playbook +# Note: If the variable sap_playbook_parameter_confirm is set to true, the playbook # stops execution and waits for an input. If you want to run the playbook in # non-interactive mode, leave the variable unset or set to false. @@ -28,7 +28,7 @@ - name: Ansible Role Configuration ansible.builtin.debug: msg: |- - The Hana setup runs with the following configuration + The SAP HANA preconfiguration runs with the following configuration: - 'Hostname : {{ sap_hostname | d(ansible_hostname) }}' - 'IP Address : {{ sap_ip | d(ansible_default_ipv4.address) }}' - 'Domain : {{ (sap_domain | d('') | length > 0) | ternary(sap_domain, ansible_domain) }}' From 109c3a2b763f22ca6a7f96c9965684b38eebe30a Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 23 Sep 2024 16:55:48 +0200 Subject: [PATCH 162/210] collection/sample playbooks: Add SPDX header to sap_hana_preconfigure_exec.yml Signed-off-by: Bernd Finger --- playbooks/sap_hana_preconfigure_exec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/sap_hana_preconfigure_exec.yml b/playbooks/sap_hana_preconfigure_exec.yml index 14ce9962f..5faa89c5e 100644 --- a/playbooks/sap_hana_preconfigure_exec.yml +++ b/playbooks/sap_hana_preconfigure_exec.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 --- ## # Call this playbook only with all variables defined. From fbead1e8e8995eb5d4be855968069ca8f829764f Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 24 Sep 2024 13:09:58 +0200 Subject: [PATCH 163/210] docs: Readme update collection, pacemaker --- README.md | 142 +- docs/README.md | 135 -- .../INPUT_PARAMETERS.md | 91 ++ roles/sap_anydb_install_oracle/README.md | 89 +- .../defaults/main.yml | 6 +- .../INPUT_PARAMETERS.md | 1020 ++++++++++++++ roles/sap_ha_pacemaker_cluster/README.md | 1252 ++--------------- 7 files changed, 1399 insertions(+), 1336 deletions(-) delete mode 100644 docs/README.md create mode 100644 roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md create mode 100644 roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md diff --git a/README.md b/README.md index 03a04fd0e..55ca84a22 100644 --- a/README.md +++ b/README.md @@ -2,48 +2,140 @@ ![Ansible Lint](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint.yml/badge.svg?branch=main) -This Ansible Collection executes various SAP Software installations and configuration tasks for running various SAP solutions and deployment scenarios on Linux operating systems (RHEL or SLES). +## Description -This includes handlers for SAP HANA database lifecycle manager (HDBLCM) and SAP Software Provisioning Manager (SWPM), and can be combined with other Ansible Collections to provide end-to-end automation _(e.g. provision, download, install, operations)_. +This Ansible Collection executes various SAP Software installations and configuration tasks for various SAP solutions and deployment scenarios on supported Linux operating systems. +Included roles cover range of tasks: +- Preparation of Operating system and SAP installation media before installation +- Installation of SAP Database, either SAP HANA or Oracle Database +- Installation of SAP Products, like SAP S4HANA, SAP BW4HANA, SAP Netweaver, SAP Solution Manager and others. +- Configuration of replication of SAP HANA and High Availability clusters for SAP HANA and SAP Netweaver -**Examples of verified installations include:** +## Requirements + +### Control Nodes +Operating system: +- Any operating system with required Python and Ansible versions. + +Python: 3.11 or higher + +Ansible: 9.9.x + +Ansible-core: 2.16.x + +**NOTE: Ansible 10 and ansible-core 2.17.x are not supported, because of breaking changes requiring higher Python version on managed nodes.** + +### Managed Nodes +Operating system: +- SUSE Linux Enterprise Server for SAP applications 15 SP5+ (SLE4SAP) +- Red Hat Enterprise Linux for SAP Solutions 8.x 9.x (RHEL4SAP) + +**NOTE: Operating system needs to have access to required package repositories either directly or via subscription registration.** + + +Python: 3.6 or higher + + +## Installation Instructions + +### Installation +Install this collection with Ansible Galaxy command: +```console +ansible-galaxy collection install community.sap_install +``` + +Optionally you can include collection in requirements.yml file and include it together with other collections using: `ansible-galaxy collection install -r requirements.yml` +Requirements file need to be maintained in following format: +```yaml +collections: + - name: community.sap_install +``` + +### Upgrade +Installed Ansible Collection will not be upgraded automatically when Ansible package is upgraded. + +To upgrade the collection to the latest available version, run the following command: +```console +ansible-galaxy collection install community.sap_install --upgrade +``` + +You can also install a specific version of the collection, when you encounter issues with latest version. Please report these issues in affected Role repository if that happens. +Example of downgrading collection to version 1.4.0: +``` +ansible-galaxy collection install community.sap_install:==1.4.0 +``` + +See [Installing collections](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html) for more details on installation methods. + + +## Use Cases + +### Example Scenarios +- Preparation of Operating system for SAP installation +- Preparation of SAP installation media for SAP installation +- Installation of SAP HANA (including High Availability with replication) or Oracle Database +- Installation of SAP S4HANA or other SAP products +- Configuration of Pacemaker cluster for SAP HANA and SAP Netweaver + +More deployment scenarios are available in [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) repository. + +### Ansible Roles +All included roles can be execute separately or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + +| Name | Summary | +| :--- | :--- | +| [sap_anydb_install_oracle](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_anydb_install_oracle) | Install Oracle DB 19.x for SAP | +| [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) | Configure general OS settings for SAP software | +| [sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_install_hana_hsr) | Configure and enable SAP HANA System Replication | +| [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) | Configure Pacemaker cluster for SAP HANA and SAP Netweaver | +| [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) | Install SAP HANA via HDBLCM | +| [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) | Configure OS settings for SAP HANA database server | +| [sap_hostagent](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hostagent) | Install SAP Host Agent | +| [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) | Detect and extract SAP Software installation media | +| [sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_maintain_etc_hosts) | Maintain the /etc/hosts file of an SAP software host | +| [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) | Configure OS settings for SAP NetWeaver application server | +| [sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_storage_setup) | Configure storage for SAP system (Folder structure, LVM, XFS, NFS) | +| [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) | Install SAP Software via SWPM | + + +## Testing +This Ansible Collection was tested across different Operating Systems, SAP products and scenarios. You can find examples of some of them below. + +Operating systems: +- SUSE Linux Enterprise Server for SAP applications 15 SP5+ (SLE4SAP) +- Red Hat Enterprise Linux for SAP Solutions 8.x 9.x (RHEL4SAP) + +Deployment scenarios: +- All scenarios included in [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) repository + +SAP Products: - SAP S/4HANA AnyPremise (1809, 1909, 2020, 2021, 2022, 2023) with setup as Standard, Distributed, High Availability and optional Maintenance Planner or Restore System Copy - SAP Business Suite (ECC) on HANA and SAP Business Suite (ECC) with SAP AnyDB - SAP ASE, SAP MaxDB, IBM Db2, Oracle DB - SAP BW/4HANA (2021, 2023) with setup as Standard or Scale-Out - SAP HANA 2.0 (SPS04+) with setup as Scale-Up, Scale-Out, High Availability - Other SAP installation activities; such as System Rename, System Copy Export, SAP Solution Manager and SAP Web Dispatcher +**NOTE: It is not possible to test every Operating System and SAP Product combination with every release. Testing is regularly done for common scenarios: SAP HANA, SAP HANA HA, SAP S4HANA Distributed HA** -**Please read the [full documentation](/docs#readme) for how-to guidance, requirements, and all other details. Summary documentation is below:** +## Contributing +You can find more information about ways you can contribute at [sap-linuxlab website](https://sap-linuxlab.github.io/initiative_contributions/). -## Contents +## Support +You can report any issues using [Issues](https://github.com/sap-linuxlab/community.sap_install/issues) section. -Within this Ansible Collection, there are various Ansible Roles and no custom Ansible Modules. -### Ansible Roles +## Release Notes and Roadmap +You can find the release notes of this collection in [Changelog file](https://github.com/sap-linuxlab/community.sap_install/blob/main/CHANGELOG.rst) -| Name | Summary | -| :--- | :--- | -| [sap_anydb_install_oracle](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_anydb_install_oracle) | install Oracle DB 19.x for SAP | -| [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) | configure general OS settings for SAP software | -| [sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_install_hana_hsr) | install SAP HANA System Replication | -| [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) | install and configure pacemaker and SAP resources | -| [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) | install SAP HANA via HDBLCM | -| [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) | configure settings for SAP HANA database server | -| [sap_hostagent](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hostagent) | install SAP Host Agent | -| [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) | detect and extract SAP Software installation media | -| [sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_maintain_etc_hosts) | maintain the /etc/hosts file of an SAP software host | -| [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) | configure settings for SAP NetWeaver application server | -| [sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_storage_setup) | configure storage for SAP HANA, with LVM partitions and XFS filesystem | -| [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) | install SAP Software via SWPM | -## License +## Further Information -- [Apache 2.0](./LICENSE) +### Variable Precedence Rules +Please follow [Ansible Precedence guidelines](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable) on how to pass variables when using this collection. -## Contributors -Contributors to the Ansible Roles within this Ansible Collection, are shown within [/docs/contributors](./docs/CONTRIBUTORS.md). +## License +[Apache 2.0](https://github.com/sap-linuxlab/community.sap_install/blob/main/LICENSE) diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index b71bedb27..000000000 --- a/docs/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# Documentation of community.sap_install Ansible Collection - -## Introduction - -The `sap_install` Ansible Collection provides a variety of automated tasks for the configuration and installation of SAP Software. - -Each Ansible Role contained within this Ansible Collection, performs a distinct set of tasks and are designed to be run independently or cohesively - depending on the outcome desired by an end-user. - - -## Functionality - -This Ansible Collection executes various SAP Software installations for different SAP solution scenarios. The code structure and logic has been separated to support a flexible execution of different steps for various scenarios. - -Any Ansible Roles labelled "preconfigure" and "prepare" are prerequisites, executed before the corresponding installation Ansible Roles (such as `sap_hana_install` or `sap_swpm`). - -At a high-level, the key installation functionality of this Ansible Collection includes: - -1. **OS Preparation activities for SAP HANA Database Server, SAP AnyDB Database Server or SAP NetWeaver Application Server** - -2. **SAP HANA installations via SAP HANA database lifecycle manager (HDBLCM)** - - Configure Firewall rules and Hosts file for SAP HANA database server instance/s - - Install SAP Host Agent - - Install SAP HANA database server, with any SAP HANA Component (e.g. Live Cache Apps, Application Function Library etc.) - - Apply license to SAP HANA - -3. **SAP HANA High Availability tasks** - - Install SAP HANA System Replication - - Install Linux Pacemaker, configure Pacemaker Fencing Agents for a given Infrastructure Platform - - Configure Linux Pacemaker Resource Agents for SAP HANA - -4. **Every SAP Software installation via SAP Software Provisioning Manager (SWPM)** - - Execute SAP SWPM Unattended installation - - Using on-the-fly generated inifile.params from Ansible Variables - - Using a list of inifile parameters in an Ansible Dictionary - - Re-using an existing inifile.params - -5. **SAP NetWeaver High Availability tasks** - - Install Linux Pacemaker, configure Pacemaker Fencing Agents for a given Infrastructure Platform - - Configure Linux Pacemaker Resource Agents for SAP NetWeaver ASCS/ERS - - -## Execution - -An Ansible Playbook is the file created and executed by an end-user, which imports from Ansible Collections to perform various activities on the target hosts. - -The Ansible Playbook can call either an Ansible Role, or directly call the individual Ansible Modules: - -- **Ansible Roles** (runs multiple Ansible Modules) -- **Ansible Modules** (and adjoining Python/Bash Functions) - -It is strongly recommended to execute these Ansible Roles in accordance to best practice Ansible usage, where an Ansible Playbook is executed from a host and Ansible will login to a target host to perform the activities. - -> If an Ansible Playbook is executed from the target host itself (similar to logging in and running a shell script), this is known as an Ansible Playbook 'localhost execution' and is not recommended as it has limitations on SAP Software installations (particularly installations across multiple hosts). - -At a high-level, complex executions with various interlinked activities are run in parallel or sequentially using the following execution structure: - -``` -Ansible Playbook --> source Ansible Collection --> execute Ansible Task ----> run Ansible Role ------> run Ansible Module (e.g. built-in Ansible Module for Shell) -``` - -### Execution examples - -There are various methods to execute the Ansible Collection, dependent on the use case. - -For more information, see [Getting started](./getting_started#readme) and edit the [sample Ansible Playbooks in `/playbooks`](../playbooks/). - - -## Requirements and Dependencies - -### Target host - Operating System requirements - -Designed for Linux operating systems, e.g. RHEL (7.x, 8.x, 9.x) and SLES (15 SPx). - -This Ansible Collection has not been tested and amended for SAP NetWeaver Application Server instantiations on IBM AIX or Windows Server. - -Assumptions for executing the Ansible Roles from this Ansible Collection include: - -- Registered OS -- OS Package repositories are available (from the relevant content delivery network of the OS vendor) - -N.B. The Ansible Collection works with SLES from version 15 SP3 and upwards, for the following reasons: - -- firewalld is used within the Ansible Collection. In SLES 15 SP3, firewalld became the replacement for nftables. See changelog [SLE-16300](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP3/index.html#jsc-SLE-16300) -- SELinux is used within the Ansible Collection. While introduced earlier with community support, full support for SELinux was provided as of SLES 15 SP3. See changelog [SLE-17307](https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP3/index.html#jsc-SLE-17307) - -### Execution/Controller host - Operating System requirements - -Execution of Ansible Playbooks using this Ansible Collection have been tested with: -- Python 3.10.14 and above (i.e. CPython distribution) -- Ansible Core 2.16.9 and above _(included with optional installation of Ansible Community Edition 5.0 and above)_ -- OS: macOS with Homebrew, RHEL, SLES, and containers in Task Runners (e.g. Azure DevOps) - -#### Ansible Core version - -This Ansible Collection was designed for maximum backwards compatibility, with full compatibility starting from Ansible Core 2.16.9 and above. - -**Note 1:** Ansible 2.9 was the last release before the Ansible project was split into Ansible Core and Ansible Community Edition, and was before Ansible Collections functionality was introduced. This Ansible Collection should execute when Ansible 2.9 is used, but it is not recommended and errors should be expected (and will not be resolved). - -**Note 2:** Ansible Core versions prior to 2.14.12 , 2.15.8 , and 2.16.1 where `CVE-2023-5764` (templating inside `that` statement of `assert` Ansible Tasks) security fix was addressed, will work after `v1.3.4` of this Ansible Collection. Otherwise an error similar to the following will occur: - -```yaml -fatal: [host01]: FAILED! => - msg: 'The conditional check ''13 <= 128'' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated.' -``` - - -## Testing - -Various SAP Software solutions have been extensively tested. - -Prior to each release, basic scenarios are executed to confirm functionality is working as expected; including SAP S/4HANA installation. - -Important note: it is not possible for the project maintainers to test every SAP Software installation and solution scenario for each OS hosted on each Infrastructure Platform, if an error is identified please raise a [GitHub Issue](/../../issues/). - - -### Ansible Roles Lint Status - -| Role Name | Ansible Lint Status | -| :--- | :--- | -| [sap_anydb_install_oracle](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_anydb_install_oracle) | N/A | -| [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) | [![Ansible Lint for sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_general_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_general_preconfigure.yml) | -| [sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_install_hana_hsr) | [![Ansible Lint for sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_install_hana_hsr.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_install_hana_hsr.yml) | -| [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) | [![Ansible Lint for sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml) | -| [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) | [![Ansible Lint for sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_install.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_install.yml) | -| [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) | [![Ansible Lint for sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_preconfigure.yml) | -| [sap_hostagent](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hostagent) | N/A | -| [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) | N/A | -| [sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_maintain_etc_hosts) | [![Ansible Lint for sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_maintain_etc_hosts.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_maintain_etc_hosts.yml) | -| [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) | [![Ansible Lint for sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_netweaver_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_netweaver_preconfigure.yml) | -| [sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_storage_setup) | N/A | -| [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) | [![Ansible Lint for sap_swpm](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_swpm.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_swpm.yml) | diff --git a/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md b/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md new file mode 100644 index 000000000..70c6424b0 --- /dev/null +++ b/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md @@ -0,0 +1,91 @@ +## Input Parameters for sap_anydb_install_oracle Ansible Role + + +### sap_anydb_install_oracle_prep_reboot_ok + +- _Type:_ `bool` +- _Default:_ `True` + +Allows reboot of Managed node after packages are installed during pre-steps tasks. + +### sap_anydb_install_oracle_prep_fail_if_reboot_required + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to fail execution if packages are installed during pre-steps tasks, but you don't want to proceed with reboot. + +### sap_anydb_install_oracle_prep_precheck + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to execute installation in Check mode to verify all inputs. This is extra validation and it does not disable installation. + +### sap_anydb_install_oracle_method + +- _Type:_ `string` +- _Default:_ `minimal` + +Select installation method out of available: `minimal` or `responsefile`. + +### sap_anydb_install_oracle_sid: + +- _Type:_ `string` +- _Default:_ `OR1` + +Enter Oracle Database SID. + +### sap_anydb_install_oracle_base + +- _Type:_ `string` +- _Default:_ `/oracle` + +Enter base folder for Oracle Database installation. + +### sap_anydb_install_oracle_filesystem_storage + +- _Type:_ `string` +- _Default:_ `/oradata` + +Enter path for `oracle.install.db.config.starterdb.fileSystemStorage.dataLocation` + +### sap_anydb_install_oracle_inventory_central + +- _Type:_ `string` +- _Default:_ `/oraInventory` + +Enter path for `INVENTORY_LOCATION` + +### sap_anydb_install_oracle_system_password + +- _Type:_ `string` + +Enter password for Oracle SYSTEM user. + +### sap_anydb_install_oracle_extract_path + +- _Type:_ `string` + +Enter path of Installation media, for example: `/software`. + +### sap_anydb_install_oracle_patch_opatch_zip + +- _Type:_ `string` + +Enter name of Oracle opatch file, for example: `OPATCH19P_2308-70004508.ZIP` + +### sap_anydb_install_oracle_patch_sap_zip + +- _Type:_ `string` + +Enter name of Oracle SAP patch file, for example: `SAP19P_2311-70004508.ZIP` + +### sap_anydb_install_oracle_patch_enable + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to allow post-installation patching. + + \ No newline at end of file diff --git a/roles/sap_anydb_install_oracle/README.md b/roles/sap_anydb_install_oracle/README.md index 9db03c630..7e55d2424 100644 --- a/roles/sap_anydb_install_oracle/README.md +++ b/roles/sap_anydb_install_oracle/README.md @@ -1,54 +1,65 @@ + # sap_anydb_install_oracle Ansible Role + -Ansible role for Oracle DB 19.x installation for SAP +## Description + +Ansible role `sap_anydb_install_oracle` is used to install Oracle Database 19.x for SAP system. + ## Prerequisites - -### Software Installation files - -Download installation media from SAP Download Center on host, and set Ansible Variable `sap_anydb_install_oracle_extract_path` to this path. - -### Default Parameters - -Please check the default parameters file for more information on other parameters that can be used as an input -- [**sap_anydb_install_oracle** default parameters](defaults/main.yml) + +Managed nodes: +1. Installation media present and `sap_anydb_install_oracle_extract_path` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. + ## Execution - -Sample Ansible Playbook Execution: - -- Local Host Installation - - `ansible-playbook --connection=local --limit localhost -i "localhost," sap-anydb-oracle-install.yml -e "@inputs/oracledb.install"` - -- Target Host Installation - - `ansible-playbook -i "" sap-anydb-oracle-install.yml -e "@inputs/oracledb.install"` - -## Sample playbook - + + + +### Execution Flow + +1. Prepare OS: Install packages, create users, create folders and copy installation media. +2. Install Oracle Database in desired method +3. Execute post installation tasks +4. Apply Oracle Patches if available + + +### Example + ```yaml --- -- hosts: all +- name: Ansible Play for Oracle Database installation + hosts: oracle_host become: true - - collections: - - community.sap_install - - vars: - sap_anydb_install_oracle_method: minimal - sap_anydb_install_oracle_sid: "OR1" - sap_anydb_install_oracle_base: "/oracle" - sap_anydb_install_oracle_system_password: "Password1%" - sap_anydb_install_oracle_extract_path: "/software/oracledb_extracted" - + tasks: - name: Execute Ansible Role sap_anydb_install_oracle - include_role: - name: { role: community.sap_install.sap_anydb_install_oracle } + ansible.builtin.include_role: + name: community.sap_install.sap_anydb_install_oracle + vars: + sap_anydb_install_oracle_method: minimal + sap_anydb_install_oracle_sid: "OR1" + sap_anydb_install_oracle_base: "/oracle" + sap_anydb_install_oracle_system_password: "Password1%" + sap_anydb_install_oracle_extract_path: "/software/oracledb_extracted" ``` + -## License + + + + + -Apache license 2.0 +## License + +Apache 2.0 + -## Author Information +## Maintainers + +- [Sean Freeman](https://github.com/sean-freeman) + -Sean Freeman +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md) diff --git a/roles/sap_anydb_install_oracle/defaults/main.yml b/roles/sap_anydb_install_oracle/defaults/main.yml index 5fb993aae..ef7a5e71c 100644 --- a/roles/sap_anydb_install_oracle/defaults/main.yml +++ b/roles/sap_anydb_install_oracle/defaults/main.yml @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 --- -sap_anydb_install_oracle_prep_reboot_ok: yes +sap_anydb_install_oracle_prep_reboot_ok: true -sap_anydb_install_oracle_prep_fail_if_reboot_required: no +sap_anydb_install_oracle_prep_fail_if_reboot_required: false -sap_anydb_install_oracle_prep_precheck: no +sap_anydb_install_oracle_prep_precheck: false # minimal, responsefile sap_anydb_install_oracle_method: minimal diff --git a/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md b/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md new file mode 100644 index 000000000..49582b6b3 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md @@ -0,0 +1,1020 @@ +## Input Parameters for sap_ha_pacemaker_cluster Ansible Role + +Minimum required parameters for all clusters: + +- [sap_ha_pacemaker_cluster_hacluster_user_password](#sap_ha_pacemaker_cluster_hacluster_user_password) + +Additional minimum requirements depend on the type of cluster setup and on the target platform. + +### sap_ha_pacemaker_cluster_aws_access_key_id + +- _Type:_ `string` + +AWS access key to allow control of instances (for example for fencing operations).
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
+ +### sap_ha_pacemaker_cluster_aws_credentials_setup + +- _Type:_ `string` + +Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
+Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+ +### sap_ha_pacemaker_cluster_aws_region + +- _Type:_ `string` + +The AWS region in which the instances to be used for the cluster setup are located.
+Mandatory for cluster nodes setup on AWS EC2 instances.
+ +### sap_ha_pacemaker_cluster_aws_secret_access_key + +- _Type:_ `string` + +AWS secret key, paired with the access key for instance control.
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
+ +### sap_ha_pacemaker_cluster_aws_vip_update_rt + +- _Type:_ `string` + +List one more routing table IDs for managing Virtual IP failover through routing table changes.
+Multiple routing tables must be defined as a comma-separated string (no spaces).
+Mandatory for the VIP resource configuration in AWS EC2 environments.
+ +### sap_ha_pacemaker_cluster_cluster_name + +- _Type:_ `string` + +The name of the pacemaker cluster.
+Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +### sap_ha_pacemaker_cluster_cluster_nodes + +- _Type:_ `list` + +List of cluster nodes and associated attributes to describe the target SAP HA environment.
+This is required for the HANA System Replication configuration.
+Synonym for this parameter is `sap_hana_cluster_nodes`.
+Mandatory to be defined for HANA clusters.
+ +- **hana_site**
+ Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +- **node_ip**
+ IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +- **node_name**
+ Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +- **node_role**
+ Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ + +Example: + +```yaml +sap_ha_pacemaker_cluster_cluster_nodes: +- hana_site: DC01 + node_ip: 192.168.5.1 + node_name: nodeA + node_role: primary +- hana_site: DC02 +``` + +### sap_ha_pacemaker_cluster_cluster_properties + +- _Type:_ `dict` +- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` + +Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
+When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_cluster_properties: + concurrent-fencing: true + stonith-enabled: true + stonith-timeout: 900 +``` + +### sap_ha_pacemaker_cluster_create_config_dest + +- _Type:_ `string` +- _Default:_ `review_resource_config.yml` + +The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
+Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file.
+Specify a path/filename to save the file in a custom location.
+The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role.
+ +### sap_ha_pacemaker_cluster_create_config_varfile + +- _Type:_ `bool` +- _Default:_ `False` + +When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format.
+This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role.
+When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes.
+WARNING! This report may include sensitive details like secrets required for certain cluster resources!
+ +### sap_ha_pacemaker_cluster_enable_cluster_connector + +- _Type:_ `bool` +- _Default:_ `True` + +Enables/Disables the SAP HA Interface for SAP ABAP application server instances, also known as `sap_cluster_connector`.
+Set this parameter to 'false' if the SAP HA interface should not be installed and configured.
+ +### sap_ha_pacemaker_cluster_extra_packages + +- _Type:_ `list` + +Additional extra packages to be installed, for instance specific resource packages.
+For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
+ +### sap_ha_pacemaker_cluster_fence_agent_packages + +- _Type:_ `list` + +Additional fence agent packages to be installed.
+This is automatically combined with default packages in:
+`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`
+`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
+ +### sap_ha_pacemaker_cluster_gcp_project + +- _Type:_ `string` + +Google Cloud project name in which the target instances are installed.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_gcp_region_zone + +- _Type:_ `string` + +Google Cloud Platform region zone ID.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_ha_cluster + +- _Type:_ `dict` + +The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
+Optional _**host_vars**_ parameter - if defined it must be set for each node.
+Dictionary that can contain various node options for the pacemaker cluster configuration.
+Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_ha_cluster: + corosync_addresses: + - 192.168.1.10 + - 192.168.2.10 + node_name: nodeA +``` + +### sap_ha_pacemaker_cluster_hacluster_user_password required + +- _Type:_ `string` + +The password of the `hacluster` user which is created during pacemaker installation.
+Inherits the value of `ha_cluster_hacluster_password`, when defined.
+ +### sap_ha_pacemaker_cluster_hana_automated_register + +- _Type:_ `bool` +- _Default:_ `True` + +Parameter for the 'SAPHana' cluster resource.
+Define if a former primary should be re-registered automatically as secondary.
+ +### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name + +- _Type:_ `string` +- _Default:_ `col_saphana_vip__HDB_primary` + +Customize the cluster constraint name for VIP and SAPHana primary clone colocation.
+ +### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name + +- _Type:_ `string` +- _Default:_ `col_saphana_vip__HDB_readonly` + +Customize the cluster constraint name for VIP and SAPHana secondary clone colocation.
+ +### sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout + +- _Type:_ `int` +- _Default:_ `7200` + +Parameter for the 'SAPHana' cluster resource.
+Time difference needed between to primary time stamps, if a dual-primary situation occurs.
+If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status.
+This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
+ +### sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaFil__HDB` + +Customize the cluster resource name of the SAP HANA Filesystem clone.
+ +### sap_ha_pacemaker_cluster_hana_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaFil__HDB` + +Customize the cluster resource name of the SAP HANA Filesystem.
+ +### sap_ha_pacemaker_cluster_hana_global_ini_path + +- _Type:_ `string` +- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini` + +Path with location of global.ini for srHook update
+ +### sap_ha_pacemaker_cluster_hana_hook_chksrv + +- _Type:_ `bool` +- _Default:_ `False` + +Controls if ChkSrv srHook is enabled during srHook creation.
+It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
+ +### sap_ha_pacemaker_cluster_hana_hook_tkover + +- _Type:_ `bool` +- _Default:_ `False` + +Controls if TkOver srHook is enabled during srHook creation.
+It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
+ +### sap_ha_pacemaker_cluster_hana_hooks + +- _Type:_ `list` +- _Default:_ `[]` + +Customize required list of SAP HANA Hooks
+Mandatory to include SAPHanaSR srHook in list.
+Mandatory attributes are provider and path.
+Example below shows mandatory SAPHanaSR, TkOver and ChkSrv hooks.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_hana_hooks: +- options: + - name: execution_order + value: 1 + path: /usr/share/SAPHanaSR/ + provider: SAPHanaSR +- options: + - name: execution_order + value: 2 + path: /usr/share/SAPHanaSR/ + provider: susTkOver +- options: + - name: execution_order + value: 3 + - name: action_on_lost + value: stop + path: /usr/share/SAPHanaSR/ + provider: susChkSrv +``` + +### sap_ha_pacemaker_cluster_hana_instance_nr + +- _Type:_ `string` + +The instance number of the SAP HANA database which this role will configure in the cluster.
+Inherits the value of `sap_hana_instance_number`, when defined.
+Mandatory for SAP HANA cluster setups.
+ +### sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_vip__HDB_primary` + +Customize the cluster constraint name for VIP and SAPHana primary clone order.
+ +### sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_vip__HDB_readonly` + +Customize the cluster constraint name for VIP and SAPHana secondary clone order.
+ +### sap_ha_pacemaker_cluster_hana_order_topology_hana_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_saphanatop__HDB` + +Customize the cluster constraint name for SAPHana and Topology order.
+ +### sap_ha_pacemaker_cluster_hana_prefer_site_takeover + +- _Type:_ `bool` +- _Default:_ `True` + +Parameter for the 'SAPHana' cluster resource.
+Set to "false" if the cluster should first attempt to restart the instance on the same node.
+When set to "true" (default) a failover to secondary will be initiated on resource failure.
+ +### sap_ha_pacemaker_cluster_hana_resource_clone_msl_name + +- _Type:_ `string` +- _Default:_ `msl_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource master slave clone.
+Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
+ +### sap_ha_pacemaker_cluster_hana_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource clone.
+ +### sap_ha_pacemaker_cluster_hana_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource.
+ +### sap_ha_pacemaker_cluster_hana_sid + +- _Type:_ `string` + +The SAP HANA SID of the instance that will be configured in the cluster.
+The SID must follow SAP specifications - see SAP Note 1979280.
+Inherits the value of `sap_hana_sid`, when defined.
+Mandatory for SAP HANA cluster setups.
+ +### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaTop__HDB` + +Customize the cluster resource name of the SAP HANA Topology resource clone.
+ +### sap_ha_pacemaker_cluster_hana_topology_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaTop__HDB` + +Customize the cluster resource name of the SAP HANA Topology resource.
+ +### sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaCon__HDB` + +Customize the cluster resource name of the SAP HANA Controller clone.
+ +### sap_ha_pacemaker_cluster_hanacontroller_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaCon__HDB` + +Customize the cluster resource name of the SAP HANA Controller.
+ +### sap_ha_pacemaker_cluster_host_type + +- _Type:_ `list` +- _Default:_ `hana_scaleup_perf` + +The SAP landscape to for which the cluster is to be configured.
+The default is a 2-node SAP HANA scale-up cluster.
+ +### sap_ha_pacemaker_cluster_ibmcloud_api_key + +- _Type:_ `string` + +The API key which is required to allow the control of instances (for example for fencing operations).
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type + +- _Type:_ `string` + +IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
+Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url + +- _Type:_ `string` + +IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
+When public network interface, can be ignored.
+When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn + +- _Type:_ `string` + +IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
+Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_region + +- _Type:_ `string` + +The IBM Cloud VS region name in which the instances are running.
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_msazure_resource_group + +- _Type:_ `string` + +Resource group name/ID in which the target instances are defined.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_msazure_subscription_id + +- _Type:_ `string` + +Subscription ID of the MS Azure environment containing the target instances.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP AAS instance.
+Mandatory for NetWeaver AAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + +- _Type:_ `bool` +- _Default:_ `False` + +The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
+Set this parameter to 'true' to configure it as ENSA1.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + +- _Type:_ `bool` +- _Default:_ `True` + +Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount
+Set this parameter to 'true' to configure ENSA2 Simple Mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__ASCS` + +Name of the filesystem resource for the ASCS instance.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness + +- _Type:_ `string` +- _Default:_ `3000` + +NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool + +- _Type:_ `bool` +- _Default:_ `False` + +NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout + +- _Type:_ `string` +- _Default:_ `60` + +NetWeaver ASCS instance failure-timeout attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold + +- _Type:_ `string` +- _Default:_ `1` + +NetWeaver ASCS instance migration-threshold setting attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name + +- _Type:_ `string` + +The name of the ASCS instance, typically the profile name.
+Mandatory for the NetWeaver ASCS/ERS cluster setup
+Recommended format _ASCS_.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPInstance__ASCS` + +Name of the ASCS instance resource.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness + +- _Type:_ `string` +- _Default:_ `5000` + +NetWeaver ASCS instance resource stickiness attribute.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string + +- _Type:_ `string` + +The full path and name of the ASCS instance profile.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPStartSrv__ASCS` + +Name of the ASCS SAPStartSrv resource for simple mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__ERS` + +Name of the filesystem resource for the ERS instance.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool + +- _Type:_ `bool` +- _Default:_ `False` + +NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name + +- _Type:_ `string` + +The name of the ERS instance, typically the profile name.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
+Recommended format _ERS_.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPInstance__ERS` + +Name of the ERS instance resource.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string + +- _Type:_ `string` + +The full path and name of the ERS instance profile.
+Mandatory for the NetWeaver ASCS/ERS cluster.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPStartSrv__ERS` + +Name of the ERS SAPstartSrv resource for simple mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP PAS instance.
+Mandatory for NetWeaver PAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_sid + +- _Type:_ `string` + +SID of the NetWeaver instances.
+Mandatory for NetWeaver cluster configuration.
+Uses `sap_swpm_sid` if defined.
+Mandatory for NetWeaver cluster setups.
+ +### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name + +- _Type:_ `string` +- _Default:_ `col_ascs_separate_` + +Customize the cluster constraint name for ASCS and ERS separation colocation.
+ +### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name + +- _Type:_ `string` +- _Default:_ `ord_ascs_first_` + +Customize the cluster constraint name for ASCS starting before ERS order.
+ +### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__sapmnt` + +Filesystem resource clone name for the shared filesystem /sapmnt.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__sapmnt` + +Filesystem resource name for the shared filesystem /sapmnt.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed + +- _Type:_ `bool` +- _Default:_ `False` + +Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
+ +### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__sys` + +Filesystem resource clone name for the shared filesystem /usr/sap//SYS.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__sys` + +Filesystem resource name for the transports filesystem /usr/sap//SYS.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__trans` + +Filesystem resource clone name for the shared filesystem /usr/sap/trans.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__trans` + +Filesystem resource name for the transports filesystem /usr/sap/trans.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_operation_defaults + +- _Type:_ `dict` +- _Default:_ `{'record-pending': True, 'timeout': 600}` + +Set default operation parameters that will be valid for all pacemaker resources.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_operation_defaults: + record-pending: true + timeout: 600 +``` + +### sap_ha_pacemaker_cluster_resource_defaults + +- _Type:_ `dict` +- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` + +Set default parameters that will be valid for all pacemaker resources.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_resource_defaults: + migration-threshold: 5000 + resource-stickiness: 1000 +``` + +### sap_ha_pacemaker_cluster_saphanasr_angi_detection + +- _Type:_ `string` +- _Default:_ `True` + +Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
+ +### sap_ha_pacemaker_cluster_sbd_devices + +- _Type:_ `list` + +Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of block devices for Stonith SBD agent
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +``` + +### sap_ha_pacemaker_cluster_sbd_enabled + +- _Type:_ `bool` + +Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
+Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
+Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +sap_ha_pacemaker_cluster_sbd_enabled: true +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:external/sbd + id: stonith_sbd + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 15 +``` + +### sap_ha_pacemaker_cluster_sbd_options + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of SBD specific options that are added into SBD configuration file.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_options: +- name: startmode + value: clean +``` + +### sap_ha_pacemaker_cluster_sbd_watchdog + +- _Type:_ `str` +- _Default:_ `/dev/watchdog` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide watchdog name to override default /dev/watchdog
+ +### sap_ha_pacemaker_cluster_sbd_watchdog_modules + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_watchdog_modules: +- softdog +``` + +### sap_ha_pacemaker_cluster_stonith_custom + +- _Type:_ `list` + +Custom list of STONITH resource(s) to be configured in the cluster.
+This definition override any defaults the role would apply otherwise.
+Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
+ +- **agent**
+ Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. +- **id**
+ Parameter `id` is required.
Name that will be used as the resource ID (name). +- **instance_attrs**
+ Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. +- **meta_attrs**
+ Defines meta attributes as list of name/value pairs. +- **name**
+ WARNING! This option will be removed in future release. +- **operations**
+ Defines list of resource agent operations. +- **options**
+ WARNING! This option will be removed in future release. + +Example: + +```yaml +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:fence_rhevm + id: my-fence-resource + instance_attrs: + - attrs: + - name: ip + value: rhevm-server + - name: username + value: login-user + - name: password + value: login-user-password + - name: pcmk_host_list + value: node1,node2 + - name: power_wait + value: 3 + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 +``` + +### sap_ha_pacemaker_cluster_storage_definition + +- _Type:_ `list` + +List of filesystem definitions used for filesystem cluster resources.
+Options relevant, see example.
+Mandatory for SAP NetWeaver HA cluster configurations.
+Reuse `sap_storage_setup_definition` if defined.
+Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'.
+Reuse `sap_storage_setup_definition` all options are documented under Ansible Role `sap_storage_setup`.
+Note! For this variable, the argument specification does not list options, to avoid errors during reuse of `sap_storage_setup_definition` if defined.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_storage_definition: +- mountpoint: /usr/sap + name: usr_sap + nfs_path: /usr/sap + nfs_server: nfs-server.example.com:/ +- mountpoint: /usr/sap/trans + name: usr_sap_trans + nfs_path: /usr/sap/trans + nfs_server: nfs-server.example.com:/ +- mountpoint: /sapmnt + name: sapmnt + nfs_filesystem_type: nfs + nfs_mount_options: defaults + nfs_path: /sapmnt + nfs_server: nfs-server.example.com:/ +``` + +### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type + +- _Type:_ `string` +- _Default:_ `nfs` + +Filesystem type of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_mount_options + +- _Type:_ `string` +- _Default:_ `defaults` + +Mount options of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_server + +- _Type:_ `string` + +Default address of the NFS server, if not defined individually by filesystem.
+ +### sap_ha_pacemaker_cluster_system_roles_collection + +- _Type:_ `string` +- _Default:_ `fedora.linux_system_roles` + +Reference to the Ansible Collection used for the Linux System Roles.
+For community/upstream, use 'fedora.linux_system_roles'.
+For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'.
+ +### sap_ha_pacemaker_cluster_vip_client_interface + +- _Type:_ `string` + +OS device name of the network interface to use for the Virtual IP configuration.
+When there is only one interface on the system, its name will be used by default.
+ +### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address + +- _Type:_ `string` + +The virtual IP of the primary HANA instance.
+Mandatory parameter for HANA clusters.
+ +### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__HDB_primary` + +Customize the name of the resource managing the Virtual IP of the primary HANA instance.
+ +### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address + +- _Type:_ `string` + +The virtual IP for read-only access to the secondary HANA instance.
+Optional parameter in HANA clusters.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver AAS instance.
+Mandatory for NetWeaver AAS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__AAS` + +Name of the SAPInstance resource for NetWeaver AAS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name + +- _Type:_ `string` +- _Default:_ `grp__ASCS` + +Name of the NetWeaver ASCS resource group.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__ASCS` + +Name of the SAPInstance resource for NetWeaver ASCS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name + +- _Type:_ `string` +- _Default:_ `grp__ERS` + +Name of the NetWeaver ERS resource group.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__ERS` + +Name of the SAPInstance resource for NetWeaver ERS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver PAS instance.
+Mandatory for NetWeaver PAS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__PAS` + +Name of the SAPInstance resource for NetWeaver PAS.
+ +### sap_ha_pacemaker_cluster_vip_secondary_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__HDB_readonly` + +Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
+ + + \ No newline at end of file diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index de8c02791..55e19ad21 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -1,1154 +1,138 @@ - + # sap_ha_pacemaker_cluster Ansible Role - + ![Ansible Lint for sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_pacemaker_cluster.yml/badge.svg) -Ansible Role for installation and configuration of Linux Pacemaker for High Availability of SAP Systems run on various Infrastructure Platforms. - -## Scope - -This Ansible Role provides: -- installation of Linux Pacemaker packages and dependencies -- configuration of Linux Pacemaker cluster with all relevant fencing agent and resource agent for an Infrastructure Platform and SAP Software (SAP HANA or SAP NetWeaver) -- setup and instantiation of Linux Pacemaker cluster (using `ha_cluster` Linux System Role) - -This Ansible Role has been tested for the following SAP Software Solution scenario deployments: -- SAP HANA Scale-up High Availability (SAPHanaSR Classic and SAPHanaSR-angi) -- SAP NetWeaver (ABAP) AS ASCS and ERS High Availability -- `Experimental:` SAP NetWeaver (ABAP) AS PAS and AAS High Availability -- `Experimental:` SAP NetWeaver (JAVA) AS SCS and ERS High Availability - -This Ansible Role contains Infrastructure Platform specific alterations for: -- AWS EC2 Virtual Servers -- `Beta:` Microsoft Azure Virtual Machines -- `Experimental:` Google Cloud Compute Engine Virtual Machine -- `Experimental:` IBM Cloud Virtual Server -- `Experimental:` IBM Power Virtual Server from IBM Cloud -- `Experimental:` IBM PowerVC hypervisor Virtual Machine - -Please note, this Ansible Role `sap_ha_pacemaker_cluster` is acting as a wrapper and generates the parameter definitions for a given SAP System, Infrastructure Platform specific variables and other additional steps to complete the SAP High Availability setup using Linux Pacemaker clusters. - -### Warnings :warning: - -- :warning: Do **not** execute this Ansible Role against already configured Linux Pacemaker cluster nodes; unless you know what you are doing and have prepared the input variables for the Ansible Role according to / matching to the existing Linux Pacemaker setup! -- :warning: Infrastructure Platforms not explicitly listed as available/tested are very unlikely to work. - -## Functionality - -_All of the following functionality is provided as **Technology Preview**._ - -### SAP HANA scale-up (performance-optimized) with SAP HANA System Replication, High Availability using Linux Pacemaker 2-node cluster - -| Platform | Usability | -| -------- | --------- | -| :heavy_check_mark: physical server | expected to work with any fencing method that is supported by the `ha_cluster` Linux System Role | -| :heavy_check_mark: OVirt VM | tested and working | -| :heavy_check_mark: AWS EC2 VS | platform detection and awscli setup included, tested and expected to work | - -### SAP NetWeaver (ABAP) ASCS and ERS, High Availability using Linux Pacemaker 2-node cluster - -| Platform | Usability | -| -------- | --------- | -| :heavy_check_mark: physical server | expected to work with any fencing method that is supported by the `ha_cluster` Linux System Role | -| :heavy_check_mark: OVirt VM | tested and working | -| :heavy_check_mark: AWS EC2 VS | platform detection and awscli setup included, tested and expected to work | - -## Requirements - -The Ansible Role requires the SAP HANA Database Server or SAP NetWeaver Application Server software installation to already exist on the target host/s. - -The target host must be either: -- Red Hat - - OS version: Registered RHEL4SAP (HA and US) 8.4+ - - OS package repositories enabled: SAP and High Availability -- SUSE - - OS version: Registered SLES for SAP 15+ (SLES4SAP 15+) - - OS package repositories enabled: HA Extension is part of registered SLES4SAP - - - -The Ansible Control System (where Ansible is executed from) must have: -- Ansible Core 2.9+ -- Access to dependency Ansible Collections and Ansible Roles: - - **Upstream**: - - Ansible Collection [`community.sap_install` from Ansible Galaxy](https://galaxy.ansible.com/community/sap_install) version `1.4.1` or later - - Ansible Collection [`fedora.linux_system_roles` from Ansible Galaxy](https://galaxy.ansible.com/fedora/linux_system_roles) version `1.82.0` or later - - **Supported (Downstream)** via Red Hat Ansible Automation Platform (AAP) license: - - Ansible Collection [`redhat.sap_install` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/sap_install) version `1.3.0` or later - - Ansible Collection [`redhat.rhel_system_roles` from Red Hat Ansible Automation Platform Hub](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles) version `1.20.0` or later - - **Supported (Downstream)** via RHEL4SAP license: - - RHEL System Roles for SAP RPM Package `rhel-system-roles-sap-3.6.0` or later - - RHEL System Roles RPM Package `rhel-system-roles-1.20.0` or later +## Description + +Ansible Role `sap_ha_pacemaker_cluster` is used to install and configure Linux Pacemaker High Availability clusters for SAP HANA and SAP Netweaver systems on various infrastructure platforms. + ## Prerequisites + +Infrastructure: +- It is required to create them manually or using [sap_vm_provision](https://github.com/sap-linuxlab/community.sap_infrastructure/tree/main/roles/sap_vm_provision) role, because this role does not create any Cloud platform resources that are required by Resource Agents. -All SAP Software must be installed, and all remote/file storage mounts must be available with correct permissions defined by SAP documentation. For SAP HANA High Availability, SAP HANA System Replication must already be installed. +Collection dependency: +1. `fedora.linux_system_roles` -In addition, the following network ports must be available: +Managed nodes: +1. Supported SAP system is installed +2. SAP HANA System Replication is configured for SAP HANA HA cluster +3. Operating system has access to all required packages +4. All required ports are open (details below) -| **SAP Technical Application and Component** | **Port** | +| SAP HANA System Replication process | Port | +| --- | --- | +| hdbnameserver
used for log and data shipping from a primary site to a secondary site.
System DB port number plus 10,000
| 4``01 | +| hdbnameserver
unencrypted metadata communication between sites.
System DB port number plus 10,000
| 4``02 | +| hdbnameserver
used for encrypted metadata communication between sites.
System DB port number plus 10,000
| 4``06 | +| hdbindexserver
used for first MDC Tenant database schema | 4``03 | +| hdbxsengine
used for SAP HANA XSC/XSA | 4``07| +| hdbscriptserver
used for log and data shipping from a primary site to a secondary site.
Tenant port number plus 10,000
| 4``40-97 | +| hdbxsengine
used for log and data shipping from a primary site to a secondary site.
Tenant port number plus 10,000
| 4``40-97 | + +| Linux Pacemaker process | Port | | --- | --- | -| **_SAP HANA System Replication_** | | -| hdbnameserver
used for log and data shipping from a primary site to a secondary site.
System DB port number plus 10,000
| 4``01 | -| hdbnameserver
unencrypted metadata communication between sites.
System DB port number plus 10,000
| 4``02 | -| hdbnameserver
used for encrypted metadata communication between sites.
System DB port number plus 10,000
| 4``06 | -| hdbindexserver
used for first MDC Tenant database schema | 4``03 | -| hdbxsengine
used for SAP HANA XSC/XSA | 4``07| -| hdbscriptserver
used for log and data shipping from a primary site to a secondary site.
Tenant port number plus 10,000
| 4``40-97 | -| hdbxsengine
used for log and data shipping from a primary site to a secondary site.
Tenant port number plus 10,000
| 4``40-97 | -| **_Linux Pacemaker_** | | | pcsd
cluster nodes requirement for node-to-node communication | 2224 (TCP)| | pacemaker
cluster nodes requirement for Pacemaker Remote service daemon | 3121 (TCP) | | corosync
cluster nodes requirement for node-to-node communication | 5404-5412 (UDP) | + + +## Execution + +**:warning: This ansible role will destroy and then recreate Linux Pacemaker cluster in process.** +:warning: Do not execute this Ansible Role against existing Linux Pacemaker clusters unless you know what you are doing and you prepare inputs according to existing cluster. + +Role can be execute separately or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + +### Supported Platforms +| Platform | Status | Notes | +| -------- | --------- | --------- | +| Physical server | :heavy_check_mark: | Need to specify valid fence agent | +| AWS EC2 Virtual Servers | :heavy_check_mark: | | +| Google Cloud Compute Engine Virtual Machine | :heavy_check_mark: | | +| Microsoft Azure Virtual Machines | :heavy_check_mark: | | +| IBM Cloud Virtual Server | :heavy_check_mark: | | +| IBM Power Virtual Server from IBM Cloud | :heavy_check_mark: | | +| IBM PowerVC hypervisor Virtual Machine | :heavy_check_mark: | | +| OVirt VM | :heavy_check_mark: | | + +### Supported scenarios + +| Platform | Variant | Status | +| -------- | --------- | --------- | +| SAP HANA scale-up (performance-optimized) 2 nodes | SAPHanaSR Classic | :heavy_check_mark: | +| SAP HANA scale-up (performance-optimized) 2 nodes | SAPHanaSR-angi | :heavy_check_mark: | +| SAP NetWeaver (ABAP) ASCS and ERS 2 nodes | Classic | :heavy_check_mark: | +| SAP NetWeaver (ABAP) ASCS and ERS 2 nodes | Simple Mount | :heavy_check_mark: | + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Detect target infrastructure platform and prepare recommended inputs unless they were provided. +3. Prepare variables with all cluster parameters and resources +4. Execute role `ha_cluster` from Ansible Collection `fedora.linux_system_roles` with prepared inputs. +5. Execute SAP product specific post tasks and verify cluster is running + + +### Example + +```yaml +--- +- name: Ansible Play for SAP HANA HA Scale-up cluster setup + hosts: hana_primary, hana_secondary + become: true + tasks: + - name: Execute Ansible Role sap_ha_pacemaker_cluster + ansible.builtin.include_role: + name: community.sap_install.sap_ha_pacemaker_cluster + vars: + sap_ha_pacemaker_cluster_cluster_name: clusterhdb + sap_ha_pacemaker_cluster_hacluster_user_password: 'clusterpass' + + sap_ha_pacemaker_cluster_sap_type: saphana_scaleup + sap_ha_pacemaker_cluster_host_type: + - hana_scaleup_perf + + sap_ha_pacemaker_cluster_hana_sid: "H01" + sap_ha_pacemaker_cluster_hana_instance_nr: "01" + + sap_ha_pacemaker_cluster_cluster_nodes: + - node_name: h01hana0 + node_ip: "10.10.10.10" + node_role: primary + hana_site: DC01 + - node_name: h01hana1 + node_ip: "10.10.10.11" + node_role: secondary + hana_site: DC02 + sap_ha_pacemaker_cluster_replication_type: none + sap_ha_pacemaker_cluster_vip_resource_group_name: viphdb + + sap_hana_cluster_nodes: +``` + -## Execution Flow - -The Ansible Role is sequential: -- Validate input Ansible Variables -- Identify host's Infrastructure Platform -- Generate Linux Pacemaker definition for given Infrastructure Platform and SAP Software -- Execute `ha_cluster` Ansible Role with Linux Pacemaker definition -- Instantiate Linux Pacemaker cluster - -## Tips - -Check out the [role variables of the `ha_cluster` Linux System Role](https://github.com/linux-system-roles/ha_cluster/blob/main/README.md) for additional possible settings that can be applied when using the `sap_ha_pacemaker_cluster` role. - -For example:
-Adding `ha_cluster_start_on_boot: false` to disable the automatic start of cluster services on boot. - -## Sample + + -Please see a full sample using multiple hosts to create an SAP S/4HANA Distributed deployment in the [/playbooks](../../playbooks/) directory of the Ansible Collection `sap_install`. + +## Further Information +Cluster can be further customized with inputs available from underlying role [ha_cluster](https://github.com/linux-system-roles/ha_cluster/blob/main/README.md), which will take precedence over `sap_ha_pacemaker_cluster` inputs. + ## License - + Apache 2.0 + -## Author Information +## Maintainers + +- [Janine Fuchs](https://github.com/ja9fuchs) +- [Marcel Mamula](https://github.com/marcelmamula) + -Red Hat for SAP Community of Practice, Janine Fuchs, IBM Lab for SAP Solutions - - - ---- - ## Role Input Parameters - -Minimum required parameters for all clusters: - -- [sap_ha_pacemaker_cluster_hacluster_user_password](#sap_ha_pacemaker_cluster_hacluster_user_password) - -Additional minimum requirements depend on the type of cluster setup and on the target platform. - -### sap_ha_pacemaker_cluster_aws_access_key_id - -- _Type:_ `string` - -AWS access key to allow control of instances (for example for fencing operations).
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
-2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
- -### sap_ha_pacemaker_cluster_aws_credentials_setup - -- _Type:_ `string` - -Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
-Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
- -### sap_ha_pacemaker_cluster_aws_region - -- _Type:_ `string` - -The AWS region in which the instances to be used for the cluster setup are located.
-Mandatory for cluster nodes setup on AWS EC2 instances.
- -### sap_ha_pacemaker_cluster_aws_secret_access_key - -- _Type:_ `string` - -AWS secret key, paired with the access key for instance control.
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
-2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
- -### sap_ha_pacemaker_cluster_aws_vip_update_rt - -- _Type:_ `string` - -List one more routing table IDs for managing Virtual IP failover through routing table changes.
-Multiple routing tables must be defined as a comma-separated string (no spaces).
-Mandatory for the VIP resource configuration in AWS EC2 environments.
- -### sap_ha_pacemaker_cluster_cluster_name - -- _Type:_ `string` - -The name of the pacemaker cluster.
-Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
-If not defined, the `ha_cluster` Linux System Role default will be used.
- -### sap_ha_pacemaker_cluster_cluster_nodes - -- _Type:_ `list` - -List of cluster nodes and associated attributes to describe the target SAP HA environment.
-This is required for the HANA System Replication configuration.
-Synonym for this parameter is `sap_hana_cluster_nodes`.
-Mandatory to be defined for HANA clusters.
- -- **hana_site**
- Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). -- **node_ip**
- IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ -- **node_name**
- Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ -- **node_role**
- Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ - -Example: - -```yaml -sap_ha_pacemaker_cluster_cluster_nodes: -- hana_site: DC01 - node_ip: 192.168.5.1 - node_name: nodeA - node_role: primary -- hana_site: DC02 -``` - -### sap_ha_pacemaker_cluster_cluster_properties - -- _Type:_ `dict` -- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` - -Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
-When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_cluster_properties: - concurrent-fencing: true - stonith-enabled: true - stonith-timeout: 900 -``` - -### sap_ha_pacemaker_cluster_create_config_dest - -- _Type:_ `string` -- _Default:_ `review_resource_config.yml` - -The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
-Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file.
-Specify a path/filename to save the file in a custom location.
-The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role.
- -### sap_ha_pacemaker_cluster_create_config_varfile - -- _Type:_ `bool` -- _Default:_ `False` - -When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format.
-This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role.
-When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes.
-WARNING! This report may include sensitive details like secrets required for certain cluster resources!
- -### sap_ha_pacemaker_cluster_enable_cluster_connector - -- _Type:_ `bool` -- _Default:_ `True` - -Enables/Disables the SAP HA Interface for SAP ABAP application server instances, also known as `sap_cluster_connector`.
-Set this parameter to 'false' if the SAP HA interface should not be installed and configured.
- -### sap_ha_pacemaker_cluster_extra_packages - -- _Type:_ `list` - -Additional extra packages to be installed, for instance specific resource packages.
-For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
- -### sap_ha_pacemaker_cluster_fence_agent_packages - -- _Type:_ `list` - -Additional fence agent packages to be installed.
-This is automatically combined with default packages in:
-`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`
-`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
- -### sap_ha_pacemaker_cluster_gcp_project - -- _Type:_ `string` - -Google Cloud project name in which the target instances are installed.
-Mandatory for the cluster setup on GCP instances.
- -### sap_ha_pacemaker_cluster_gcp_region_zone - -- _Type:_ `string` - -Google Cloud Platform region zone ID.
-Mandatory for the cluster setup on GCP instances.
- -### sap_ha_pacemaker_cluster_ha_cluster - -- _Type:_ `dict` - -The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
-Optional _**host_vars**_ parameter - if defined it must be set for each node.
-Dictionary that can contain various node options for the pacemaker cluster configuration.
-Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
-If not defined, the `ha_cluster` Linux System Role default will be used.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_ha_cluster: - corosync_addresses: - - 192.168.1.10 - - 192.168.2.10 - node_name: nodeA -``` - -### sap_ha_pacemaker_cluster_hacluster_user_password required - -- _Type:_ `string` - -The password of the `hacluster` user which is created during pacemaker installation.
-Inherits the value of `ha_cluster_hacluster_password`, when defined.
- -### sap_ha_pacemaker_cluster_hana_automated_register - -- _Type:_ `bool` -- _Default:_ `True` - -Parameter for the 'SAPHana' cluster resource.
-Define if a former primary should be re-registered automatically as secondary.
- -### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_primary` - -Customize the cluster constraint name for VIP and SAPHana primary clone colocation.
- -### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_readonly` - -Customize the cluster constraint name for VIP and SAPHana secondary clone colocation.
- -### sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout - -- _Type:_ `int` -- _Default:_ `7200` - -Parameter for the 'SAPHana' cluster resource.
-Time difference needed between to primary time stamps, if a dual-primary situation occurs.
-If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status.
-This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
- -### sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaFil__HDB` - -Customize the cluster resource name of the SAP HANA Filesystem clone.
- -### sap_ha_pacemaker_cluster_hana_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaFil__HDB` - -Customize the cluster resource name of the SAP HANA Filesystem.
- -### sap_ha_pacemaker_cluster_hana_global_ini_path - -- _Type:_ `string` -- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini` - -Path with location of global.ini for srHook update
- -### sap_ha_pacemaker_cluster_hana_hook_chksrv - -- _Type:_ `bool` -- _Default:_ `False` - -Controls if ChkSrv srHook is enabled during srHook creation.
-It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
- -### sap_ha_pacemaker_cluster_hana_hook_tkover - -- _Type:_ `bool` -- _Default:_ `False` - -Controls if TkOver srHook is enabled during srHook creation.
-It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
- -### sap_ha_pacemaker_cluster_hana_hooks - -- _Type:_ `list` -- _Default:_ `[]` - -Customize required list of SAP HANA Hooks
-Mandatory to include SAPHanaSR srHook in list.
-Mandatory attributes are provider and path.
-Example below shows mandatory SAPHanaSR, TkOver and ChkSrv hooks.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_hana_hooks: -- options: - - name: execution_order - value: 1 - path: /usr/share/SAPHanaSR/ - provider: SAPHanaSR -- options: - - name: execution_order - value: 2 - path: /usr/share/SAPHanaSR/ - provider: susTkOver -- options: - - name: execution_order - value: 3 - - name: action_on_lost - value: stop - path: /usr/share/SAPHanaSR/ - provider: susChkSrv -``` - -### sap_ha_pacemaker_cluster_hana_instance_nr - -- _Type:_ `string` - -The instance number of the SAP HANA database which this role will configure in the cluster.
-Inherits the value of `sap_hana_instance_number`, when defined.
-Mandatory for SAP HANA cluster setups.
- -### sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_primary` - -Customize the cluster constraint name for VIP and SAPHana primary clone order.
- -### sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_readonly` - -Customize the cluster constraint name for VIP and SAPHana secondary clone order.
- -### sap_ha_pacemaker_cluster_hana_order_topology_hana_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_saphanatop__HDB` - -Customize the cluster constraint name for SAPHana and Topology order.
- -### sap_ha_pacemaker_cluster_hana_prefer_site_takeover - -- _Type:_ `bool` -- _Default:_ `True` - -Parameter for the 'SAPHana' cluster resource.
-Set to "false" if the cluster should first attempt to restart the instance on the same node.
-When set to "true" (default) a failover to secondary will be initiated on resource failure.
- -### sap_ha_pacemaker_cluster_hana_resource_clone_msl_name - -- _Type:_ `string` -- _Default:_ `msl_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource master slave clone.
-Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
- -### sap_ha_pacemaker_cluster_hana_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource clone.
- -### sap_ha_pacemaker_cluster_hana_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource.
- -### sap_ha_pacemaker_cluster_hana_sid - -- _Type:_ `string` - -The SAP HANA SID of the instance that will be configured in the cluster.
-The SID must follow SAP specifications - see SAP Note 1979280.
-Inherits the value of `sap_hana_sid`, when defined.
-Mandatory for SAP HANA cluster setups.
- -### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaTop__HDB` - -Customize the cluster resource name of the SAP HANA Topology resource clone.
- -### sap_ha_pacemaker_cluster_hana_topology_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaTop__HDB` - -Customize the cluster resource name of the SAP HANA Topology resource.
- -### sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaCon__HDB` - -Customize the cluster resource name of the SAP HANA Controller clone.
- -### sap_ha_pacemaker_cluster_hanacontroller_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaCon__HDB` - -Customize the cluster resource name of the SAP HANA Controller.
- -### sap_ha_pacemaker_cluster_host_type - -- _Type:_ `list` -- _Default:_ `hana_scaleup_perf` - -The SAP landscape to for which the cluster is to be configured.
-The default is a 2-node SAP HANA scale-up cluster.
- -### sap_ha_pacemaker_cluster_ibmcloud_api_key - -- _Type:_ `string` - -The API key which is required to allow the control of instances (for example for fencing operations).
-Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type - -- _Type:_ `string` - -IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
-Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url - -- _Type:_ `string` - -IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
-When public network interface, can be ignored.
-When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn - -- _Type:_ `string` - -IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
-Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_region - -- _Type:_ `string` - -The IBM Cloud VS region name in which the instances are running.
-Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
- -### sap_ha_pacemaker_cluster_msazure_resource_group - -- _Type:_ `string` - -Resource group name/ID in which the target instances are defined.
-Mandatory for the cluster setup on MS Azure instances.
- -### sap_ha_pacemaker_cluster_msazure_subscription_id - -- _Type:_ `string` - -Subscription ID of the MS Azure environment containing the target instances.
-Mandatory for the cluster setup on MS Azure instances.
- -### sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP AAS instance.
-Mandatory for NetWeaver AAS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 - -- _Type:_ `bool` -- _Default:_ `False` - -The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
-Set this parameter to 'true' to configure it as ENSA1.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - -- _Type:_ `bool` -- _Default:_ `True` - -Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount
-Set this parameter to 'true' to configure ENSA2 Simple Mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__ASCS` - -Name of the filesystem resource for the ASCS instance.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness - -- _Type:_ `string` -- _Default:_ `3000` - -NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP ASCS instance.
-Mandatory for NetWeaver ASCS/ERS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool - -- _Type:_ `bool` -- _Default:_ `False` - -NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout - -- _Type:_ `string` -- _Default:_ `60` - -NetWeaver ASCS instance failure-timeout attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold - -- _Type:_ `string` -- _Default:_ `1` - -NetWeaver ASCS instance migration-threshold setting attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name - -- _Type:_ `string` - -The name of the ASCS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup
-Recommended format _ASCS_.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ASCS` - -Name of the ASCS instance resource.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness - -- _Type:_ `string` -- _Default:_ `5000` - -NetWeaver ASCS instance resource stickiness attribute.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string - -- _Type:_ `string` - -The full path and name of the ASCS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ASCS` - -Name of the ASCS SAPStartSrv resource for simple mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__ERS` - -Name of the filesystem resource for the ERS instance.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool - -- _Type:_ `bool` -- _Default:_ `False` - -NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name - -- _Type:_ `string` - -The name of the ERS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
-Recommended format _ERS_.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ERS` - -Name of the ERS instance resource.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string - -- _Type:_ `string` - -The full path and name of the ERS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ERS` - -Name of the ERS SAPstartSrv resource for simple mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP PAS instance.
-Mandatory for NetWeaver PAS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_sid - -- _Type:_ `string` - -SID of the NetWeaver instances.
-Mandatory for NetWeaver cluster configuration.
-Uses `sap_swpm_sid` if defined.
-Mandatory for NetWeaver cluster setups.
- -### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name - -- _Type:_ `string` -- _Default:_ `col_ascs_separate_` - -Customize the cluster constraint name for ASCS and ERS separation colocation.
- -### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name - -- _Type:_ `string` -- _Default:_ `ord_ascs_first_` - -Customize the cluster constraint name for ASCS starting before ERS order.
- -### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__sapmnt` - -Filesystem resource clone name for the shared filesystem /sapmnt.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__sapmnt` - -Filesystem resource name for the shared filesystem /sapmnt.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed - -- _Type:_ `bool` -- _Default:_ `False` - -Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
- -### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__sys` - -Filesystem resource clone name for the shared filesystem /usr/sap//SYS.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__sys` - -Filesystem resource name for the transports filesystem /usr/sap//SYS.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__trans` - -Filesystem resource clone name for the shared filesystem /usr/sap/trans.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__trans` - -Filesystem resource name for the transports filesystem /usr/sap/trans.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_operation_defaults - -- _Type:_ `dict` -- _Default:_ `{'record-pending': True, 'timeout': 600}` - -Set default operation parameters that will be valid for all pacemaker resources.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_operation_defaults: - record-pending: true - timeout: 600 -``` - -### sap_ha_pacemaker_cluster_resource_defaults - -- _Type:_ `dict` -- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` - -Set default parameters that will be valid for all pacemaker resources.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_resource_defaults: - migration-threshold: 5000 - resource-stickiness: 1000 -``` - -### sap_ha_pacemaker_cluster_saphanasr_angi_detection - -- _Type:_ `string` -- _Default:_ `True` - -Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
- -### sap_ha_pacemaker_cluster_sbd_devices - -- _Type:_ `list` - -Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of block devices for Stonith SBD agent
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 -``` - -### sap_ha_pacemaker_cluster_sbd_enabled - -- _Type:_ `bool` - -Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
-Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
-Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 -sap_ha_pacemaker_cluster_sbd_enabled: true -sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:external/sbd - id: stonith_sbd - instance_attrs: - - attrs: - - name: pcmk_delay_max - value: 15 -``` - -### sap_ha_pacemaker_cluster_sbd_options - -- _Type:_ `list` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of SBD specific options that are added into SBD configuration file.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_options: -- name: startmode - value: clean -``` - -### sap_ha_pacemaker_cluster_sbd_watchdog - -- _Type:_ `str` -- _Default:_ `/dev/watchdog` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide watchdog name to override default /dev/watchdog
- -### sap_ha_pacemaker_cluster_sbd_watchdog_modules - -- _Type:_ `list` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_watchdog_modules: -- softdog -``` - -### sap_ha_pacemaker_cluster_stonith_custom - -- _Type:_ `list` - -Custom list of STONITH resource(s) to be configured in the cluster.
-This definition override any defaults the role would apply otherwise.
-Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
- -- **agent**
- Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. -- **id**
- Parameter `id` is required.
Name that will be used as the resource ID (name). -- **instance_attrs**
- Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. -- **meta_attrs**
- Defines meta attributes as list of name/value pairs. -- **name**
- WARNING! This option will be removed in future release. -- **operations**
- Defines list of resource agent operations. -- **options**
- WARNING! This option will be removed in future release. - -Example: - -```yaml -sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:fence_rhevm - id: my-fence-resource - instance_attrs: - - attrs: - - name: ip - value: rhevm-server - - name: username - value: login-user - - name: password - value: login-user-password - - name: pcmk_host_list - value: node1,node2 - - name: power_wait - value: 3 - meta_attrs: - - attrs: - - name: target-role - value: Started - operations: - - action: start - attrs: - - name: interval - value: 0 - - name: timeout - value: 180 -``` - -### sap_ha_pacemaker_cluster_storage_definition - -- _Type:_ `list` - -List of filesystem definitions used for filesystem cluster resources.
-Options relevant, see example.
-Mandatory for SAP NetWeaver HA cluster configurations.
-Reuse `sap_storage_setup_definition` if defined.
-Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'.
-Reuse `sap_storage_setup_definition` all options are documented under Ansible Role `sap_storage_setup`.
-Note! For this variable, the argument specification does not list options, to avoid errors during reuse of `sap_storage_setup_definition` if defined.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_storage_definition: -- mountpoint: /usr/sap - name: usr_sap - nfs_path: /usr/sap - nfs_server: nfs-server.example.com:/ -- mountpoint: /usr/sap/trans - name: usr_sap_trans - nfs_path: /usr/sap/trans - nfs_server: nfs-server.example.com:/ -- mountpoint: /sapmnt - name: sapmnt - nfs_filesystem_type: nfs - nfs_mount_options: defaults - nfs_path: /sapmnt - nfs_server: nfs-server.example.com:/ -``` - -### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type - -- _Type:_ `string` -- _Default:_ `nfs` - -Filesystem type of the NFS filesystems that are part of the cluster configuration.
- -### sap_ha_pacemaker_cluster_storage_nfs_mount_options - -- _Type:_ `string` -- _Default:_ `defaults` - -Mount options of the NFS filesystems that are part of the cluster configuration.
- -### sap_ha_pacemaker_cluster_storage_nfs_server - -- _Type:_ `string` - -Default address of the NFS server, if not defined individually by filesystem.
- -### sap_ha_pacemaker_cluster_system_roles_collection - -- _Type:_ `string` -- _Default:_ `fedora.linux_system_roles` - -Reference to the Ansible Collection used for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'.
-For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'.
- -### sap_ha_pacemaker_cluster_vip_client_interface - -- _Type:_ `string` - -OS device name of the network interface to use for the Virtual IP configuration.
-When there is only one interface on the system, its name will be used by default.
- -### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address - -- _Type:_ `string` - -The virtual IP of the primary HANA instance.
-Mandatory parameter for HANA clusters.
- -### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_primary` - -Customize the name of the resource managing the Virtual IP of the primary HANA instance.
- -### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address - -- _Type:_ `string` - -The virtual IP for read-only access to the secondary HANA instance.
-Optional parameter in HANA clusters.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver AAS instance.
-Mandatory for NetWeaver AAS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__AAS` - -Name of the SAPInstance resource for NetWeaver AAS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver ASCS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name - -- _Type:_ `string` -- _Default:_ `grp__ASCS` - -Name of the NetWeaver ASCS resource group.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__ASCS` - -Name of the SAPInstance resource for NetWeaver ASCS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name - -- _Type:_ `string` -- _Default:_ `grp__ERS` - -Name of the NetWeaver ERS resource group.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__ERS` - -Name of the SAPInstance resource for NetWeaver ERS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver PAS instance.
-Mandatory for NetWeaver PAS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__PAS` - -Name of the SAPInstance resource for NetWeaver PAS.
- -### sap_ha_pacemaker_cluster_vip_secondary_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_readonly` - -Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
- - +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md) From 5450f3efd2c5281933d5ddc9f9fb62a6d1708004 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 25 Sep 2024 12:49:30 +0200 Subject: [PATCH 164/210] fix: vip resources must be first in ASCS/ERS resource groups --- .../tasks/construct_vars_nwas_abap_ascs_ers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml index 67d2ad991..7c264ec45 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml @@ -256,9 +256,9 @@ resource_ids: | {% set resource_ids_list = [] %} {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name, sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name, sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name, sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} @@ -288,9 +288,9 @@ resource_ids: | {% set resource_ids_list = [] %} {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name, sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name, sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name, sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} From 594516ecbcc6e55629ec76a3ba1c8b7314358bc1 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 26 Sep 2024 13:39:10 +0200 Subject: [PATCH 165/210] Docs: Readme update for all roles except swpm --- README.md | 5 +- docs/getting_started/README.md | 32 + roles/sap_anydb_install_oracle/README.md | 10 +- .../INPUT_PARAMETERS.md | 311 +++++++++ roles/sap_general_preconfigure/README.md | 531 ++++----------- .../INPUT_PARAMETERS.md | 27 + roles/sap_ha_install_anydb_ibmdb2/README.md | 122 ++-- .../INPUT_PARAMETERS.md | 90 +++ roles/sap_ha_install_hana_hsr/README.md | 174 +++-- .../INPUT_PARAMETERS.md | 18 +- roles/sap_ha_pacemaker_cluster/README.md | 52 +- roles/sap_hana_install/INPUT_PARAMETERS.md | 59 ++ roles/sap_hana_install/README.md | 372 +++++------ .../sap_hana_preconfigure/INPUT_PARAMETERS.md | 324 +++++++++ roles/sap_hana_preconfigure/README.md | 626 ++++-------------- roles/sap_hostagent/INPUT_PARAMETERS.md | 130 ++++ roles/sap_hostagent/README.md | 254 ++++--- .../INPUT_PARAMETERS.md | 181 +++++ roles/sap_install_media_detect/README.md | 161 +++-- .../INPUT_PARAMETERS.md | 78 +++ roles/sap_maintain_etc_hosts/README.md | 218 +++--- .../INPUT_PARAMETERS.md | 92 +++ roles/sap_netweaver_preconfigure/README.md | 255 +++---- roles/sap_storage_setup/INPUT_PARAMETERS.md | 140 ++++ roles/sap_storage_setup/README.md | 259 ++++---- 25 files changed, 2595 insertions(+), 1926 deletions(-) create mode 100644 roles/sap_general_preconfigure/INPUT_PARAMETERS.md create mode 100644 roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md create mode 100644 roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md create mode 100644 roles/sap_hana_install/INPUT_PARAMETERS.md create mode 100644 roles/sap_hana_preconfigure/INPUT_PARAMETERS.md create mode 100644 roles/sap_hostagent/INPUT_PARAMETERS.md create mode 100644 roles/sap_install_media_detect/INPUT_PARAMETERS.md create mode 100644 roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md create mode 100644 roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md create mode 100644 roles/sap_storage_setup/INPUT_PARAMETERS.md diff --git a/README.md b/README.md index 55ca84a22..d413df34e 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ See [Installing collections](https://docs.ansible.com/ansible/latest/collections More deployment scenarios are available in [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) repository. ### Ansible Roles -All included roles can be execute separately or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. +All included roles can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. | Name | Summary | | :--- | :--- | @@ -136,6 +136,9 @@ You can find the release notes of this collection in [Changelog file](https://gi ### Variable Precedence Rules Please follow [Ansible Precedence guidelines](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable) on how to pass variables when using this collection. +### Getting Started +More information on how to execute Ansible playbooks is in [Getting started guide](https://github.com/sap-linuxlab/community.sap_install/blob/main/docs/getting_started/README.md). + ## License [Apache 2.0](https://github.com/sap-linuxlab/community.sap_install/blob/main/LICENSE) diff --git a/docs/getting_started/README.md b/docs/getting_started/README.md index 7788e3c4d..c5b79b2c1 100644 --- a/docs/getting_started/README.md +++ b/docs/getting_started/README.md @@ -6,6 +6,7 @@ In this folder you will find sample files, a few additional tips for using the p - [Inventory and variable parameters](#inventory-and-variable-parameters) - [Security parameters](#security-parameters) - [Other useful options](#other-useful-options) + - [Improve readability of playbook output in terminal](#improve-readability-of-playbook-output-in-terminal) ## How to run playbooks @@ -95,3 +96,34 @@ These are not all available options, but ones that may help getting familiar wit Be careful to choose a task which covers pre-requisites, i.e. tasks that discover information which is used in subsequent tasks have to be run to fulfill conditionals. - `-C` attempts a dry-run of the playbook without applying actual changes. This is limited to simple tasks that do not require other changes already been done in previous tasks. - `--step` this executes the playbook but will prompt for every task to be run or skipped. At the prompt it can also be told to continue and not ask again, however. Useful to slow down execution and review each tasks result before proceeding with the next task. + +### Improve readability of playbook output in terminal +Note: For terminals with dark background, replace the color code `30m` by `37m`. +In case you need to make an invisible font readable on a terminal with dark background, run the following command in the terminal: +```yaml +printf "\033[37mreadable font\n" +``` +In case you need to make an invisible font readable on a terminal with bright background, run the following command in the terminal: +```yaml +printf "\033[30mreadable font\n" +``` + +Execution of `sap_general_preconfigure` playbook with a nice compact and colored output, this time for two hosts: +```console +ansible-playbook sap.yml -l host_1,host_2 -e "{sap_general_preconfigure_assert: yes, sap_general_preconfigure_assert_ignore_errors: yes}" | +awk '{sub (" \"msg\": ", "")} + /TASK/{task_line=$0} + /fatal:/{fatal_line=$0; nfatal[host]++} + /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0} + /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2} + /SAP note/{print "\033[30m[" host"] "$0} + /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0} + /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0} + /PASS:/{npass[host]++; print "\033[32m[" host"] "$0} + /INFO:/{print "\033[34m[" host"] "$0} + /changed/&&/unreachable/{print "\033[30m[" host"] "$0} + END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) { + printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033[30m Last TASK and fatal output:\n"); print task_line, fatal_line + } + else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033[30m\n", nfail[var], nwarn[var], npass[var])}}' +``` diff --git a/roles/sap_anydb_install_oracle/README.md b/roles/sap_anydb_install_oracle/README.md index 7e55d2424..027615e3c 100644 --- a/roles/sap_anydb_install_oracle/README.md +++ b/roles/sap_anydb_install_oracle/README.md @@ -7,16 +7,22 @@ Ansible role `sap_anydb_install_oracle` is used to install Oracle Database 19.x for SAP system. -## Prerequisites + + + +## Prerequisites Managed nodes: -1. Installation media present and `sap_anydb_install_oracle_extract_path` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. +- Directory with installation media is present and `sap_anydb_install_oracle_extract_path` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. ## Execution + + + ### Execution Flow 1. Prepare OS: Install packages, create users, create folders and copy installation media. diff --git a/roles/sap_general_preconfigure/INPUT_PARAMETERS.md b/roles/sap_general_preconfigure/INPUT_PARAMETERS.md new file mode 100644 index 000000000..364683233 --- /dev/null +++ b/roles/sap_general_preconfigure/INPUT_PARAMETERS.md @@ -0,0 +1,311 @@ +## Input Parameters for sap_general_preconfigure Ansible Role + +#### Minimum required parameters: + +This role does not require any parameter to be set in the playbook or inventory. + + +### sap_general_preconfigure_config_all +- _Type:_ `bool` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_general_preconfigure_installation +- _Type:_ `bool` + +If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_general_preconfigure_configuration +- _Type:_ `bool` + +If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
+ +Example: + +```yaml +sap_general_preconfigure_config_all: false +sap_general_preconfigure_configuration: true +sap_general_preconfigure_2002167_02: true +sap_general_preconfigure_1391070: true +``` + +### sap_general_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_general_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_general_preconfigure_system_roles_collection +- _Type:_ `str` +- _Default:_ `'fedora.linux_system_roles'` +- _Possible Values:_
+ - `fedora.linux_system_roles` + - `redhat.rhel_system_roles` + +Set which Ansible Collection to use for the Linux System Roles.
+For community/upstream, use 'fedora.linux_system_roles'
+For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
+ +### sap_general_preconfigure_enable_repos +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want the role to enable the repos as configured by the following repo related parameters.
+The default is `false`, meaning that the role will not enable repos.
+ +### sap_general_preconfigure_use_netweaver_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the SAP NetWeaver repo(s).
+The default is `true`, meaning that the role will enable the SAP NetWeaver repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_use_hana_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the SAP HANA repo(s).
+The default is `true`, meaning that the role will enable the SAP HANA repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_use_ha_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the high availability repo(s).
+The default is `true`, meaning that the role will enable the high availability repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_disable_all_other_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not disable all repos before enabling the desired ones as configured above.
+The default is `true`, meaning that the role will disable all repos before enabling the desired ones.
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_req_repos +- _Type:_ `list` with elements of type `str` + +If you want to provide your own list of repos (e.g. on cloud systems), set this variable accordingly.
+Otherwise, the RHEL default repo names with the maximum support duration for the RHEL minor release are chosen automatically
+(e.g. normal repos for RHEL 8.3, e4s repos for RHEL 8.4).
+ +Example: + +```yaml +sap_general_preconfigure_req_repos: +- rhel-8-for-x86_64-baseos-eus-rpms +- rhel-8-for-x86_64-appstream-eus-rpms +- rhel-8-for-x86_64-sap-solutions-eus-rpms +- rhel-8-for-x86_64-sap-netweaver-eus-rpms +- rhel-8-for-x86_64-highavailability-eus-rpms +``` + +### sap_general_preconfigure_set_minor_release +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want the role to set the RHEL minor release, which is required for SAP HANA. Default is `false`.
+If you set the RHEL minor release, then you must also use the `eus` or `e4s` repos.
+ +### sap_general_preconfigure_packagegroups +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +The name of the software package group to install.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +'@minimal-environment' +``` + +### sap_general_preconfigure_envgroups +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +The name of the software environment group to check.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +'@minimal-environment' +``` + +### sap_general_preconfigure_packages +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +The list of packages to install.
+The default for this variable is set in the vars file which corresponds to the detected OS version.
+ +### sap_general_preconfigure_min_package_check +- _Type:_ `bool` +- _Default:_ `true` + +The default is to install or check if the minimum package versions are installed as defined in the vars files.
+Set to `false` if you do not install or check these minimum package versions.
+ +### sap_general_preconfigure_install_ibm_power_tools +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
+See also SAP note 2679703.
+ +### sap_general_preconfigure_add_ibm_power_repo +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
+are already available on the local network). The IBM Power Systems service and productivity tools will only
+be installed if the variable `sap_general_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
+ +### sap_general_preconfigure_ibm_power_repo_url +- _Type:_ `str` +- _Default:_ `'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm'` + +URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools
+ +### sap_general_preconfigure_update +- _Type:_ `bool` +- _Default:_ `false` + +By default, the role will not update the system, for avoiding an unintentional minor OS release update.
+Set this parameter to `true` if you want to update your system to the latest package versions.
+When using SAP HANA, make sure to set the release lock properly so the minor OS release will be one of
+those for which SAP HANA is supported. See also `sap_general_preconfigure_set_minor_release`.
+ +### sap_general_preconfigure_reboot_ok +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want to perform a reboot at the end of the role, if necessary.
+ +### sap_general_preconfigure_fail_if_reboot_required +- _Type:_ `bool` +- _Default:_ `true` + +If `sap_general_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
+remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
+Can be useful if you want to implement your own reboot handling.
+ +### sap_general_preconfigure_selinux_state +- _Type:_ `str` +- _Default:_ `'permissive'` +- _Possible Values:_
+ - `enforcing` + - `permissive` + - `disabled` + +One of the SELinux states to be set on the system.
+ +### sap_general_preconfigure_create_directories +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the SAP directories to be created by the role.
+The SAP directories will always be created if `sap_general_preconfigure_modify_selinux_labels`
+(see below) is set to `true`, no matter how `sap_general_preconfigure_create_directories` is set.
+ +### sap_general_preconfigure_sap_directories +- _Type:_ `list` with elements of type `str` +- _Default:_ + - /usr/sap + +List of SAP directories to be created.
+ +### sap_general_preconfigure_modify_selinux_labels +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want to modify the SELinux labels for the SAP directories set
+in variable `sap_general_preconfigure_sap_directories`.
+ +### sap_general_preconfigure_size_of_tmpfs_gb +- _Type:_ `str` +- _Default:_ `"{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}"` + +The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735.
+ +### sap_general_preconfigure_modify_etc_hosts +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the role to modify the `/etc/hosts` file.
+ +### sap_general_preconfigure_etc_sysctl_sap_conf +- _Type:_ `str` +- _Default:_ `'/etc/sysctl.d/sap.conf'` + +The file name of the sysctl config file to be used
+ +### sap_general_preconfigure_kernel_parameters +- _Type:_ `list` with elements of type `dict` +- _Default:_ (set by platform/environment specific variables) + +The Linux kernel parameters to use. By default, these are taken from the vars file.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +sap_general_preconfigure_kernel_parameters: +- name: vm.max_map_count + value: '2147483647' +- name: fs.aio-max-nr + value: '18446744073709551615' +``` + +### sap_general_preconfigure_max_hostname_length +- _Type:_ `str` +- _Default:_ `'13'` + +The maximum length of the hostname. See SAP note 611361.
+ +### sap_hostname +- _Type:_ `str` +- _Default:_ `"{{ ansible_hostname }}"` + +The hostname to be used for updating or checking `/etc/hosts` entries.
+ +### sap_domain +- _Type:_ `str` +- _Default:_ `"{{ ansible_domain }}"` + +The DNS domain name to be used for updating or checking `/etc/hosts` entries.
+ +### sap_ip +- _Type:_ `str` +- _Default:_ `"{{ ansible_default_ipv4.address }}"` + +The IPV4 address to be used for updating or checking `/etc/hosts` entries.
+ +### sap_general_preconfigure_db_group_name +- _Type:_ `str` + +Use this variable to specify the name of the RHEL group which is used for the database processes.
+If defined, it will be used to configure process limits as per step
+Configuring Process Resource Limits
+ +Example: + +```yaml +sap_general_preconfigure_db_group_name: dba +``` + \ No newline at end of file diff --git a/roles/sap_general_preconfigure/README.md b/roles/sap_general_preconfigure/README.md index 65875d070..d2e05c7be 100644 --- a/roles/sap_general_preconfigure/README.md +++ b/roles/sap_general_preconfigure/README.md @@ -1,341 +1,74 @@ + # sap_general_preconfigure Ansible Role + +![Ansible Lint for sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_general_preconfigure.yml/badge.svg) -This role installs required packages and performs configuration steps which are required for installing and running SAP NetWeaver or SAP HANA. Specific installation and configuration steps on top of these basic steps are performed with roles sap-netweaver-preconfigure and sap-hana-preconfigure. Future implementations may reduce the scope of this role, for example if certain installation or configuration steps are done in the more specific roles. +## Description + +Ansible Role `sap_general_preconfigure` is used to ensure that Managed nodes are configured to host SAP systems according to SAP Notes. -For SLES systems, this role may not be necessary. The majority of SAP preparation and tuning is covered by `saptune` which is configured in the `sap_hana_preconfigure` and `sap_netweaver_preconfigure` roles. +This role performs installation of required packages for running SAP systems and configuration of Operating system parameters. -## Requirements - -The role requires additional collections which are specified in `meta/collection-requirements.yml`. Before using this role, -make sure that the required collections are installed, for example by using the following command: - -`ansible-galaxy install -vv -r meta/collection-requirements.yml` - -To use this role, your system needs to be installed according to: -- RHEL 7: SAP note 2002167, Red Hat Enterprise Linux 7.x: Installation and Upgrade, section "Installing Red Hat Enterprise Linux 7" -- RHEL 8: SAP note 2772999, Red Hat Enterprise Linux 8.x: Installation and Configuration, section "Installing Red Hat Enterprise Linux 8". -- RHEL 9: SAP note 3108316, Red Hat Enterprise Linux 9.x: Installation and Configuration, section "Installing Red Hat Enterprise Linux 9". - -Note ----- -Do not run this role against an SAP or other production system. The role will enforce a certain configuration on the managed node(s), which might not be intended. - - -## Role Input Parameters - -#### Minimum required parameters: - -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_general_preconfigure_config_all -- _Type:_ `bool` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_general_preconfigure_installation -- _Type:_ `bool` - -If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_general_preconfigure_configuration -- _Type:_ `bool` - -If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
- -Example: - -```yaml -sap_general_preconfigure_config_all: false -sap_general_preconfigure_configuration: true -sap_general_preconfigure_2002167_02: true -sap_general_preconfigure_1391070: true -``` - -### sap_general_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_general_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_general_preconfigure_system_roles_collection -- _Type:_ `str` -- _Default:_ `'fedora.linux_system_roles'` -- _Possible Values:_
- - `fedora.linux_system_roles` - - `redhat.rhel_system_roles` - -Set which Ansible Collection to use for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'
-For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
- -### sap_general_preconfigure_enable_repos -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want the role to enable the repos as configured by the following repo related parameters.
-The default is `false`, meaning that the role will not enable repos.
- -### sap_general_preconfigure_use_netweaver_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the SAP NetWeaver repo(s).
-The default is `true`, meaning that the role will enable the SAP NetWeaver repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_use_hana_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the SAP HANA repo(s).
-The default is `true`, meaning that the role will enable the SAP HANA repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_use_ha_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the high availability repo(s).
-The default is `true`, meaning that the role will enable the high availability repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_disable_all_other_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not disable all repos before enabling the desired ones as configured above.
-The default is `true`, meaning that the role will disable all repos before enabling the desired ones.
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_req_repos -- _Type:_ `list` with elements of type `str` - -If you want to provide your own list of repos (e.g. on cloud systems), set this variable accordingly.
-Otherwise, the RHEL default repo names with the maximum support duration for the RHEL minor release are chosen automatically
-(e.g. normal repos for RHEL 8.3, e4s repos for RHEL 8.4).
- -Example: - -```yaml -sap_general_preconfigure_req_repos: -- rhel-8-for-x86_64-baseos-eus-rpms -- rhel-8-for-x86_64-appstream-eus-rpms -- rhel-8-for-x86_64-sap-solutions-eus-rpms -- rhel-8-for-x86_64-sap-netweaver-eus-rpms -- rhel-8-for-x86_64-highavailability-eus-rpms -``` - -### sap_general_preconfigure_set_minor_release -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want the role to set the RHEL minor release, which is required for SAP HANA. Default is `false`.
-If you set the RHEL minor release, then you must also use the `eus` or `e4s` repos.
- -### sap_general_preconfigure_packagegroups -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -The name of the software package group to install.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -'@minimal-environment' -``` - -### sap_general_preconfigure_envgroups -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -The name of the software environment group to check.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -'@minimal-environment' -``` - -### sap_general_preconfigure_packages -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -The list of packages to install.
-The default for this variable is set in the vars file which corresponds to the detected OS version.
- -### sap_general_preconfigure_min_package_check -- _Type:_ `bool` -- _Default:_ `true` - -The default is to install or check if the minimum package versions are installed as defined in the vars files.
-Set to `false` if you do not install or check these minimum package versions.
- -### sap_general_preconfigure_install_ibm_power_tools -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
-See also SAP note 2679703.
- -### sap_general_preconfigure_add_ibm_power_repo -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
-are already available on the local network). The IBM Power Systems service and productivity tools will only
-be installed if the variable `sap_general_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
- -### sap_general_preconfigure_ibm_power_repo_url -- _Type:_ `str` -- _Default:_ `'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm'` - -URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools
- -### sap_general_preconfigure_update -- _Type:_ `bool` -- _Default:_ `false` - -By default, the role will not update the system, for avoiding an unintentional minor OS release update.
-Set this parameter to `true` if you want to update your system to the latest package versions.
-When using SAP HANA, make sure to set the release lock properly so the minor OS release will be one of
-those for which SAP HANA is supported. See also `sap_general_preconfigure_set_minor_release`.
- -### sap_general_preconfigure_reboot_ok -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want to perform a reboot at the end of the role, if necessary.
- -### sap_general_preconfigure_fail_if_reboot_required -- _Type:_ `bool` -- _Default:_ `true` - -If `sap_general_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
-remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
-Can be useful if you want to implement your own reboot handling.
- -### sap_general_preconfigure_selinux_state -- _Type:_ `str` -- _Default:_ `'permissive'` -- _Possible Values:_
- - `enforcing` - - `permissive` - - `disabled` - -One of the SELinux states to be set on the system.
- -### sap_general_preconfigure_create_directories -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the SAP directories to be created by the role.
-The SAP directories will always be created if `sap_general_preconfigure_modify_selinux_labels`
-(see below) is set to `true`, no matter how `sap_general_preconfigure_create_directories` is set.
- -### sap_general_preconfigure_sap_directories -- _Type:_ `list` with elements of type `str` -- _Default:_ - - /usr/sap - -List of SAP directories to be created.
- -### sap_general_preconfigure_modify_selinux_labels -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want to modify the SELinux labels for the SAP directories set
-in variable `sap_general_preconfigure_sap_directories`.
- -### sap_general_preconfigure_size_of_tmpfs_gb -- _Type:_ `str` -- _Default:_ `"{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}"` - -The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735.
- -### sap_general_preconfigure_modify_etc_hosts -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the role to modify the `/etc/hosts` file.
- -### sap_general_preconfigure_etc_sysctl_sap_conf -- _Type:_ `str` -- _Default:_ `'/etc/sysctl.d/sap.conf'` - -The file name of the sysctl config file to be used
- -### sap_general_preconfigure_kernel_parameters -- _Type:_ `list` with elements of type `dict` -- _Default:_ (set by platform/environment specific variables) - -The Linux kernel parameters to use. By default, these are taken from the vars file.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -sap_general_preconfigure_kernel_parameters: -- name: vm.max_map_count - value: '2147483647' -- name: fs.aio-max-nr - value: '18446744073709551615' -``` - -### sap_general_preconfigure_max_hostname_length -- _Type:_ `str` -- _Default:_ `'13'` - -The maximum length of the hostname. See SAP note 611361.
- -### sap_hostname -- _Type:_ `str` -- _Default:_ `"{{ ansible_hostname }}"` - -The hostname to be used for updating or checking `/etc/hosts` entries.
- -### sap_domain -- _Type:_ `str` -- _Default:_ `"{{ ansible_domain }}"` - -The DNS domain name to be used for updating or checking `/etc/hosts` entries.
- -### sap_ip -- _Type:_ `str` -- _Default:_ `"{{ ansible_default_ipv4.address }}"` - -The IPV4 address to be used for updating or checking `/etc/hosts` entries.
- -### sap_general_preconfigure_db_group_name -- _Type:_ `str` - -Use this variable to specify the name of the RHEL group which is used for the database processes.
-If defined, it will be used to configure process limits as per step
-Configuring Process Resource Limits
- -Example: +This is general preconfigure role that used for both SAP Netweaver and SAP HANA, which have separate follow-up roles [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) and [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure). + + +## Dependencies +- `fedora.linux_system_roles` + - Roles: + - `selinux` +- `community.sap_install` (This collection) + - Roles: + - `sap_maintain_etc_hosts` + +Install required collections by `ansible-galaxy install -vv -r meta/collection-requirements.yml`. + + + +## Prerequisites + +(Red Hat specific) Ensure system is installed according to: +- RHEL 7: SAP note 2002167, Red Hat Enterprise Linux 7.x: Installation and Upgrade, section `Installing Red Hat Enterprise Linux 7`. +- RHEL 8: SAP note 2772999, Red Hat Enterprise Linux 8.x: Installation and Configuration, section `Installing Red Hat Enterprise Linux 8`. +- RHEL 9: SAP note 3108316, Red Hat Enterprise Linux 9.x: Installation and Configuration, section `Installing Red Hat Enterprise Linux 9`. + + + +## Execution + +**:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Install required packages and patch system if `sap_general_preconfigure_update:true` +3. Apply configurations based on SAP Notes +4. Reboot Managed nodes if packages were installed or patched and `sap_general_preconfigure_reboot_ok: true` + + +### Example + ```yaml -sap_general_preconfigure_db_group_name: dba -``` - - - -## Tags (RHEL systems only) - +--- +- name: Ansible Play for SAP HANA HA Scale-up preconfigure + hosts: hana_primary, hana_secondary + become: true + tasks: + - name: Execute Ansible Role sap_general_preconfigure + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure +``` +Further referenced as `example.yml` + + + +### Role Tags With the following tags, the role can be called to perform certain activities only: - tag `sap_general_preconfigure_installation`: Perform only the installation tasks - tag `sap_general_preconfigure_configuration`: Perform only the configuration tasks @@ -344,69 +77,64 @@ With the following tags, the role can be called to perform certain activities on - tag `sap_general_preconfigure_etc_hosts`: Perform only the tasks(s) related to this step. This step might be one of multiple configuration activities of a SAP note. Also this step might be valid for multiple RHEL major releases. -Sample call for only performing all installation and configuration tasks (sample playbook name sap.yml, see the next section for -an example). This is the default behavior. If no tag is specified, all installation and configuration tasks are enabled: -``` -# ansible-playbook sap.yml -``` - -Sample call for only performing all installation tasks: -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_installation -``` +
+ How to run sap_general_preconfigure with tags -Sample call for only performing all configuration tasks: -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_configuration -``` + #### Perform only installation tasks: + ```console + ansible-playbook sap.yml --tags=sap_general_preconfigure_installation + ``` -Sample call for only verifying and modifying the /etc/hosts file: -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_etc_hosts -``` + #### Perform only configuration tasks: + ```console + ansible-playbook sap.yml --tags=sap_general_preconfigure_configuration + ``` -Sample call for performing all configuration steps except verifying and modifying the /etc/hosts file: -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_configuration --skip_tags=sap_general_preconfigure_etc_hosts -``` + #### Verify and modify /etc/hosts file: + ```console + ansible-playbook sap.yml --tags=sap_general_preconfigure_etc_hosts + ``` -Sample call for only performing the configuration activities related to SAP note 3108316 (RHEL 9 specific): -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_3108316 -``` + #### Perform all configuration steps except verifying and modifying the /etc/hosts file + ``` + ansible-playbook sap.yml --tags=sap_general_preconfigure_configuration --skip_tags=sap_general_preconfigure_etc_hosts + ``` -Sample call for performing all configuration activities except those related to step 2 (SELinux settings) of SAP note 3108316 (RHEL 9 specific): -Sample call for only performing the configuration activities related to step 2 (SELinux settings) of SAP note 3108316 (RHEL 9 specific): -``` -# ansible-playbook sap.yml --tags=sap_general_preconfigure_3108316_02 -``` + #### (Red Hat) Perform configuration activities related to SAP note 3108316 (RHEL 9) + ``` + ansible-playbook sap.yml --tags=sap_general_preconfigure_3108316 + ``` -Sample call for performing all configuration activities except those related to step 2 (SELinux settings) of SAP note 3108316 (RHEL 9 specific): -``` -# ansible-playbook sap-general-preconfigure.yml --tags=sap_general_preconfigure_configuration --skip_tags=sap_general_preconfigure_3108316_02 -``` + #### (Red Hat) Perform configuration activities related to step 2 (SELinux settings) of SAP note 3108316 (RHEL 9) + ``` + ansible-playbook sap.yml --tags=sap_general_preconfigure_3108316_02 + ``` -## Dependencies + #### (Red Hat) Perform all configuration activities except those related to step 2 (SELinux settings) of SAP note 3108316 (RHEL 9 specific) + ``` + ansible-playbook sap-general-preconfigure.yml --tags=sap_general_preconfigure_configuration --skip_tags=sap_general_preconfigure_3108316_02 + ``` +
+ -This role does not depend on any other role. -## Example Playbook + + -Simple playbook, named sap.yml: -```yaml ---- -- hosts: all - roles: - - role: sap_general_preconfigure -``` +## License + +Apache 2.0 + -## Example Usage +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) + -Normal run: -```yaml -ansible-playbook sap.yml -l remote_host -``` +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_general_preconfigure/INPUT_PARAMETERS.md) +### Controlling execution with input parameters Extended Check (assert) run, aborting for any error which has been found: ```yaml ansible-playbook sap.yml -l remote_host -e "{sap_general_preconfigure_assert: yes}" @@ -414,42 +142,5 @@ ansible-playbook sap.yml -l remote_host -e "{sap_general_preconfigure_assert: ye Extended Check (assert) run, not aborting even if an error has been found: ```yaml -ansible-playbook sap.yml -l remote_host -e "{sap_general_preconfigure_assert: yes, sap_general_preconfigure_assert_ignore_errors: no}" -``` - -Same as above, with a nice compact and colored output, this time for two hosts: -```yaml -ansible-playbook sap.yml -l host_1,host_2 -e "{sap_general_preconfigure_assert: yes, sap_general_preconfigure_assert_ignore_errors: yes}" | -awk '{sub (" \"msg\": ", "")} - /TASK/{task_line=$0} - /fatal:/{fatal_line=$0; nfatal[host]++} - /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0} - /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2} - /SAP note/{print "\033[30m[" host"] "$0} - /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0} - /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0} - /PASS:/{npass[host]++; print "\033[32m[" host"] "$0} - /INFO:/{print "\033[34m[" host"] "$0} - /changed/&&/unreachable/{print "\033[30m[" host"] "$0} - END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) { - printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033[30m Last TASK and fatal output:\n"); print task_line, fatal_line - } - else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033[30m\n", nfail[var], nwarn[var], npass[var])}}' +ansible-playbook sap.yml -l remote_host -e "{sap_general_preconfigure_assert: yes,sap_general_preconfigure_assert_ignore_errors: no}" ``` -Note: For terminals with dark background, replace the color code `30m` by `37m`. -In case you need to make an invisible font readable on a terminal with dark background, run the following command in the terminal: -```yaml -printf "\033[37mreadable font\n" -``` -In case you need to make an invisible font readable on a terminal with bright background, run the following command in the terminal: -```yaml -printf "\033[30mreadable font\n" -``` - -## License - -Apache license 2.0 - -## Author Information - -Red Hat for SAP Community of Practice, Bernd Finger, Markus Koch, Rainer Leber diff --git a/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md b/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md new file mode 100644 index 000000000..7bc555e10 --- /dev/null +++ b/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md @@ -0,0 +1,27 @@ +## Input Parameters for sap_ha_install_anydb_ibmdb2 Ansible Role + +### sap_ha_install_anydb_ibmdb2_hostname_primary + +- _Type:_ `string` + +Enter IBM Db2 Primary node hostname + + +### sap_ha_install_anydb_ibmdb2_hostname_secondary + +- _Type:_ `string` + +Enter IBM Db2 Secondary node hostname + +### sap_ha_install_anydb_ibmdb2_sid + +- _Type:_ `string` + +Enter IBM Db2 System ID + +### sap_ha_install_anydb_ibmdb2_software_directory + +- _Type:_ `string` + +Enter IBM Db2 installation media path + \ No newline at end of file diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index 808f032ed..a87751e6a 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -1,82 +1,86 @@ `EXPERIMENTAL` - + # sap_ha_install_anydb_ibmdb2 Ansible Role + +## Description + Ansible Role for instantiation of IBM Db2 'Integrated Linux Pacemaker' HADR cluster Note: IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models: - Mutual Failover option, **not** covered by this Ansible Role -- High Availability and Disaster Recovery (HADR) option for Idle Standby, initialised by this Ansible Role +- High Availability and Disaster Recovery (HADR) option for Idle Standby, initialized by this Ansible Role + + + + ## Prerequisites +Managed nodes: +- Directory with installation media is present and `sap_ha_install_anydb_ibmdb2_software_directory` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. -### Software Installation files - -Download IBM Db2 installation media from SAP Download Center on host, and set Ansible Variable `sap_ha_install_anydb_ibmdb2_software_directory` to this path. - -### Variables - -- `sap_ha_install_anydb_ibmdb2_hostname_primary` with the IBM Db2 Primary node hostname -- `sap_ha_install_anydb_ibmdb2_hostname_secondary` with the IBM Db2 Secondary node hostname -- `sap_ha_install_anydb_ibmdb2_sid` with the IBM Db2 System ID -- `sap_ha_install_anydb_ibmdb2_software_directory` with the IBM Db2 installation media path - -These are listed in the default variables file, but commented-out to enforce the required variables: -- [**sap_ha_install_anydb_ibmdb2** default parameters](defaults/main.yml) - -## Requirements and Dependencies - -This Ansible Role is applicable to IBM Db2 11.5 certified for SAP. - -It is applicable to 11.5.9 and later, which provides `db2cm` binary compatibility for AWS, GCP and MS Azure. - -### Target host - Infrastructure Platforms - -This Ansible Role contains Infrastructure Platform specific alterations for: -- AWS EC2 Virtual Servers -- Microsoft Azure Virtual Machines -- Google Cloud Compute Engine Virtual Machine -- IBM Cloud Virtual Server - -### Target host - Operating System requirements - -Designed for Linux operating systems, e.g. RHEL (7.x and 8.x) and SLES (15.x). +Software compatibility: +- This Ansible Role is applicable to IBM Db2 11.5 certified for SAP. +- It is applicable to 11.5.9 and later, which provides `db2cm` binary compatibility for AWS, GCP and MS Azure. + ## Execution - -Sample Ansible Playbook Execution: - -- Local Host Installation - - `ansible-playbook --connection=local --limit localhost -i "localhost," sap-ha-anydb-ibmdb2-init.yml -e "@inputs/ibmdb2_vars.yml` - -- Target Host Installation - - `ansible-playbook -i "" sap-ha-anydb-ibmdb2-init.yml -e "@inputs/ibmdb2_vars.yml"` - -## Sample Ansible Playbook - + +### Supported Platforms +| Platform | Status | Notes | +| -------- | --------- | --------- | +| AWS EC2 Virtual Servers | :heavy_check_mark: | | +| Google Cloud Compute Engine Virtual Machine | :heavy_check_mark: | | +| Microsoft Azure Virtual Machines | :heavy_check_mark: | | +| IBM Cloud Virtual Server | :heavy_check_mark: | | + + + + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Detect target infrastructure platform. +3. Execute platform specific configuration. +4. Instantiate IBM Db2 'Integrated Linux Pacemaker' HADR cluster. + + +### Example + ```yaml --- -- hosts: all - - collections: - - community.sap_install - - vars: - sap_ha_install_anydb_ibmdb2_sid: SD1 # Sandbox Database for D01 SAP System - sap_ha_install_anydb_ibmdb2_hostname_primary: db2-p - sap_ha_install_anydb_ibmdb2_hostname_secondary: db2-s - sap_ha_install_anydb_ibmdb2_software_directory: /software/ibmdb2_extracted - +- name: Ansible Play for IBM Db2 Database installation + hosts: db2_host + become: true + tasks: - name: Execute Ansible Role sap_ha_install_anydb_ibmdb2 ansible.builtin.include_role: name: community.sap_install.sap_ha_install_anydb_ibmdb2 + vars: + sap_ha_install_anydb_ibmdb2_sid: SD1 # Sandbox Database for D01 SAP System + sap_ha_install_anydb_ibmdb2_hostname_primary: db2-p + sap_ha_install_anydb_ibmdb2_hostname_secondary: db2-s + sap_ha_install_anydb_ibmdb2_software_directory: /software/ibmdb2_extracted ``` + -## License + + -Apache license 2.0 + + + +## License + +Apache 2.0 + -## Author Information +## Maintainers + +- [Sean Freeman](https://github.com/sean-freeman) + -Sean Freeman +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md) diff --git a/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md b/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md new file mode 100644 index 000000000..a9bab4b21 --- /dev/null +++ b/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md @@ -0,0 +1,90 @@ +## Input Parameters for sap_ha_pacemaker_cluster Ansible Role + + +### sap_ha_install_hana_hsr_sid + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_sid }}` + +Enter SID of SAP HANA database. + +### sap_ha_install_hana_hsr_instance_number + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_instance_number }}` + +Enter string value of SAP HANA SID. + +### sap_ha_install_hana_hsr_cluster_nodes + +- _Type:_ `list` +- _Default:_ `{{ sap_hana_cluster_nodes }}` + +List of cluster nodes and associated attributes to describe the target SAP HA environment.
+This is required for the HANA System Replication configuration.
+ +- **hana_site**
+ Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +- **node_ip**
+ IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +- **node_name**
+ Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +- **node_role**
+ Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ + +Example: + +```yaml +sap_ha_install_hana_hsr_cluster_nodes: + - node_name: node1 + node_ip: 192.168.1.11 + node_role: primary + hana_site: DC01 + + - node_name: node2 + node_ip: 192.168.1.12 + node_role: secondary + hana_site: DC02 +``` + +### sap_ha_install_hana_hsr_hdbuserstore_system_backup_user + +- _Type:_ `string` +- _Default:_ `HDB_SYSTEMDB` + +Enter name of SYSTEM user for backup execution. + +### sap_ha_install_hana_hsr_db_system_password + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_install_master_password }}` + +Enter password of SYSTEM user for backup execution. + +### sap_ha_install_hana_hsr_fqdn + +- _Type:_ `string` +- _Default:_ {{ sap_domain }} + +Enter domain of SAP system, for example `example.com`. + +### sap_ha_install_hana_hsr_rep_mode + +- _Type:_ `string` +- _Default:_ `sync` + +Enter SAP HANA System Replication mode. + +### sap_ha_install_hana_hsr_oper_mode + +- _Type:_ `string` +- _Default:_ `logreplay` + +Enter SAP HANA System Replication operation mode. + +### sap_ha_install_hana_hsr_update_etchosts +- _Type:_ `bool` +- _Default:_ `True` + +Enable to update /etc/hosts file. + \ No newline at end of file diff --git a/roles/sap_ha_install_hana_hsr/README.md b/roles/sap_ha_install_hana_hsr/README.md index f8a5730b3..e16b11b8d 100644 --- a/roles/sap_ha_install_hana_hsr/README.md +++ b/roles/sap_ha_install_hana_hsr/README.md @@ -1,103 +1,93 @@ + # sap_ha_install_hana_hsr Ansible Role + +![Ansible Lint for sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_ha_install_hana_hsr.yml/badge.svg) -Ansible role for SAP HANA System Replication Setup on 2 nodes. +## Description + +Ansible Role `sap_ha_install_hana_hsr` is used to configure and enable SAP HANA System Replication between 2 nodes. + -## Prerequisites - -- target nodes are on the same OS level -- target nodes are using the same SAP HANA release - -## Overview - -The **sap_ha_install_hana_hsr** role is part of this system role sequence: - -| Sequence | System Role | Description | -| :------: | :----------------------- | :----------------------------------------------------------- | -| 1. | sap_general_preconfigure | System Preparation for SAP | -| 2. | sap_hana_preconfigure | System Preparation for SAP HANA | -| 3. | sap_hana_install | Installation of SAP HANA Database | -| _4._ | _sap_ha_install_hana_hsr_ | _Configuration of SAP HANA System Replication_ | -| 5. | sap_ha_pacemaker_cluster | Linux Pacemaker cluster setup and SAP resources configuration | - -The **sap_ha_install_hana_hsr** roles configures a HANA system replication relationship which is used by the pacemaker cluster to automate SAP HANA System Replication (HSR). Prerequisite is the SAP HANA installation on the nodes. - -## Tasks included - -| Task | Description | -| ---------------------- | ----------------------------------------------------------------------------------- | -| update_etchosts.yml | ensures that all nodes of the cluster are configured in all nodes' /etc/hosts | -| configure_firewall.yml | this will configure the firewall für HANA system replication (disabled) | -| hdbuserstore.yml | create a user in the hdbuserstore | -| log_mode.yml | check/set database logmode | -| pki_files.yml | copy pki file from primary to secondary database | -| run_backup.yml | perform backup on the primary note as pre required step for HANA system replication | -| configure_hsr.yml | enable HANA system replication on primary node and register secondary database node | - -## Common Variables/Parameters Used - -| Name | Description | Value | -| -------------------------------- | ------------------------------- | ---------------------- | -| sap_domain | Domain Name | example: `example.com` | -| sap_hana_sid | SAP ID | example: `RH1` | -| sap_hana_instance_number | Instance Number | example: `"00"` | -| sap_hana_install_master_password | DB System Password | -| sap_hana_cluster_nodes | Parameter list of cluster nodes | -| sap_hana_hacluster_password | Pacemaker hacluster Password | - -## Role specific Variables - -| Name | Description | Value | -| --------------------------------- | ---------------- | -------------------- | -| sap_ha_install_hana_hsr_rep_mode | replication mode | default is sync | -| sap_ha_install_hana_hsr_oper_mode | operation mode | default is logreplay | - -## Example Parameter File + + + +## Prerequisites +Managed nodes: +- Same Operating system version +- SAP HANA is installed with same version on both nodes. + + +## Execution + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order: +1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) +3. [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) +4. [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) +5. *`sap_ha_install_hana_hsr`* + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Verify connection between nodes. +3. Update /etc/hosts, hdbuserstore, Log mode, PKI +4. Execute database backup +5. Configure SAP HANA System Replication + + +### Example + ```yaml -sap_hana_sid: "DB1" -sap_hana_instance_number: "00" -sap_hana_install_master_password: "my_hana-password" - -### Cluster Definition -sap_ha_install_pacemaker_cluster_name: cluster1 -sap_hana_hacluster_password: "my_hacluster-password" - -sap_domain: example.com - -sap_hana_cluster_nodes: - - node_name: node1 - node_ip: 192.168.1.11 - node_role: primary - hana_site: DC01 - - - node_name: node2 - node_ip: 192.168.1.12 - node_role: secondary - hana_site: DC02 -``` - -### Execution Design - -Having the parameters specified as above, it can be executed with one command: - -```text -ansible-playbook example_playbook_with_parameters.ymnl -``` - -If you need to execute the role using an external handled, you can also limit the playbook for specific a **host** adding parameter defined in e **parameter_file**. - -```text -ansible-playbook -l node1 example_playbook.yml -e @parameter_file.yml +--- +- name: Ansible Play for SAP HANA System Replication setup + hosts: hana_primary, hana_secondary + become: true + tasks: + - name: Execute Ansible Role sap_ha_install_hana_hsr + ansible.builtin.include_role: + name: community.sap_install.sap_ha_install_hana_hsr + vars: + sap_ha_install_hana_hsr_cluster_nodes: + - node_name: h01hana0 + node_ip: "10.10.10.10" + node_role: primary + hana_site: DC01 + + - node_name: h01hana1 + node_ip: "10.10.10.11" + node_role: secondary + hana_site: DC02 + + sap_ha_install_hana_hsr_sid: H01 + sap_ha_install_hana_hsr_instance_number: "01" + sap_ha_install_hana_hsr_hdbuserstore_system_backup_user: "HDB_SYSTEMDB" + sap_ha_install_hana_hsr_db_system_password: "Password" + sap_ha_install_hana_hsr_fqdn: example.com ``` + -A good way to start is executing the playbook with the option _--list_tasks_. You can than start a playbook with the option _--start-at-task_ at a specific point. _--list_task_ will not start any task. + + -For more information please check - -```text -ansible-playbook --help -``` + + ## License + +Apache 2.0 + + +## Maintainers + +- [Janine Fuchs](https://github.com/ja9fuchs) + -Apache license 2.0 +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md) diff --git a/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md b/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md index 49582b6b3..564cb3cf7 100644 --- a/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md +++ b/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md @@ -6,6 +6,15 @@ Minimum required parameters for all clusters: Additional minimum requirements depend on the type of cluster setup and on the target platform. +### sap_ha_pacemaker_cluster_hacluster_user_password + +- _Type:_ `string` + +**Mandatory Input Parameter.**
+The password of the `hacluster` user which is created during pacemaker installation.
+Inherits the value of `ha_cluster_hacluster_password`, when defined.
+ + ### sap_ha_pacemaker_cluster_aws_access_key_id - _Type:_ `string` @@ -180,13 +189,6 @@ sap_ha_pacemaker_cluster_ha_cluster: node_name: nodeA ``` -### sap_ha_pacemaker_cluster_hacluster_user_password required - -- _Type:_ `string` - -The password of the `hacluster` user which is created during pacemaker installation.
-Inherits the value of `ha_cluster_hacluster_password`, when defined.
- ### sap_ha_pacemaker_cluster_hana_automated_register - _Type:_ `bool` @@ -1015,6 +1017,4 @@ Name of the SAPInstance resource for NetWeaver PAS.
- _Default:_ `rsc_vip__HDB_readonly` Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
- - \ No newline at end of file diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 55e19ad21..2f0d9f3b3 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -8,19 +8,25 @@ Ansible Role `sap_ha_pacemaker_cluster` is used to install and configure Linux Pacemaker High Availability clusters for SAP HANA and SAP Netweaver systems on various infrastructure platforms. -## Prerequisites + +## Dependencies +- `fedora.linux_system_roles` + - Roles: + - `ha_cluster` + +Install required collections by `ansible-galaxy install -vv -r meta/collection-requirements.yml`. + + +## Prerequisites Infrastructure: - It is required to create them manually or using [sap_vm_provision](https://github.com/sap-linuxlab/community.sap_infrastructure/tree/main/roles/sap_vm_provision) role, because this role does not create any Cloud platform resources that are required by Resource Agents. -Collection dependency: -1. `fedora.linux_system_roles` - Managed nodes: -1. Supported SAP system is installed -2. SAP HANA System Replication is configured for SAP HANA HA cluster -3. Operating system has access to all required packages -4. All required ports are open (details below) +- Supported SAP system is installed. See [Recommended](#recommended) section. +- SAP HANA System Replication is configured for SAP HANA HA cluster. See [Recommended](#recommended) section. +- Operating system has access to all required packages +- All required ports are open (details below) | SAP HANA System Replication process | Port | | --- | --- | @@ -41,10 +47,10 @@ Managed nodes: ## Execution -**:warning: This ansible role will destroy and then recreate Linux Pacemaker cluster in process.** +**:warning: This ansible role will destroy and then recreate Linux Pacemaker cluster in process.**
:warning: Do not execute this Ansible Role against existing Linux Pacemaker clusters unless you know what you are doing and you prepare inputs according to existing cluster. -Role can be execute separately or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ### Supported Platforms | Platform | Status | Notes | @@ -68,13 +74,32 @@ Role can be execute separately or as part of [ansible.playbooks_for_sap](https:/ | SAP NetWeaver (ABAP) ASCS and ERS 2 nodes | Simple Mount | :heavy_check_mark: | + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+#### SAP HANA cluster +1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) +3. [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) +4. [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) +5. [sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_install_hana_hsr) +6. *`sap_ha_pacemaker_cluster`* + +#### SAP Netweaver cluster +1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) +3. [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) +4. [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) +5. *`sap_ha_pacemaker_cluster`* + + ### Execution Flow 1. Assert that required inputs were provided. 2. Detect target infrastructure platform and prepare recommended inputs unless they were provided. -3. Prepare variables with all cluster parameters and resources +3. Prepare variables with all cluster parameters and resources. 4. Execute role `ha_cluster` from Ansible Collection `fedora.linux_system_roles` with prepared inputs. -5. Execute SAP product specific post tasks and verify cluster is running +5. Execute SAP product specific post tasks and verify cluster is running. ### Example @@ -104,14 +129,13 @@ Role can be execute separately or as part of [ansible.playbooks_for_sap](https:/ node_ip: "10.10.10.10" node_role: primary hana_site: DC01 + - node_name: h01hana1 node_ip: "10.10.10.11" node_role: secondary hana_site: DC02 sap_ha_pacemaker_cluster_replication_type: none sap_ha_pacemaker_cluster_vip_resource_group_name: viphdb - - sap_hana_cluster_nodes: ``` diff --git a/roles/sap_hana_install/INPUT_PARAMETERS.md b/roles/sap_hana_install/INPUT_PARAMETERS.md new file mode 100644 index 000000000..93f909fb8 --- /dev/null +++ b/roles/sap_hana_install/INPUT_PARAMETERS.md @@ -0,0 +1,59 @@ +## Input Parameters for sap_ha_pacemaker_cluster Ansible Role + +### sap_hana_install_sid + +- _Type:_ `string` + +Enter SAP HANA System ID (SID). + +### sap_hana_install_number + +- _Type:_ `string` + +Enter SAP HANA Instance number. + +### sap_hana_install_fapolicyd_integrity + +- _Type:_ `string` +- _Default:_ `sha256` + +Select fapolicyd integrity check option out of: `none`, `size`, `sha256`, `ima`. + +### sap_hana_install_check_sidadm_user + +- _Type:_ `bool` +- _Default:_ `True` + +If the variable `sap_hana_install_check_sidadm_user` is set to `False`, the role will install SAP HANA even +if the sidadm user exists. Default is `True`, in which case the installation will not be performed if the +sidadm user exists. + +### sap_hana_install_new_system + +- _Type:_ `bool` +- _Default:_ `True` + +The variable `sap_hana_install_new_system` determines if the role will perform a fresh SAP HANA installation +or if it will add further hosts to an existing SAP HANA system as specified by variable +`sap_hana_install_addhosts`. Default is `True` for a fresh SAP HANA installation. + +### sap_hana_install_update_firewall + +- _Type:_ `bool` +- _Default:_ `False` + +The role can be configured to also set the required firewall ports for SAP HANA. If this is desired, set +the variable `sap_hana_install_update_firewall` to `yes` (default is `no`). The firewall ports are defined +in a variable which is compatible with the variable structure used by Linux System Role `firewall`. +The firewall ports for SAP HANA are defined in member `port` of the first field of variable +`sap_hana_install_firewall` (`sap_hana_install_firewall[0].port`), see file `defaults/main.yml`. If the +member `state` is set to `enabled`, the ports will be enabled. If the member `state` is set to `disabled`, +the ports will be disabled, which might be useful for testing. + +Certain parameters have identical meanings, for supporting different naming schemes in playbooks and inventories. +You can find those in the task `Rename some variables used by hdblcm configfile` of the file `tasks/main.yml`. +Example: The parameter `sap_hana_install_number`, which is used by the role to define the hdblm parameter `number` +(= SAP HANA instance number) can be defined by setting `sap_hana_instance_number`, `sap_hana_install_instance_nr`, +`sap_hana_install_instance_number`, or `sap_hana_install_number`. The order of precedence is from left to right. + + \ No newline at end of file diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index 35d439c27..efd9bc842 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -1,80 +1,79 @@ + # sap_hana_install Ansible Role + +![Ansible Lint for sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_install.yml/badge.svg) -Ansible role for SAP HANA Installation +## Description + +Ansible Role `sap_hana_install` is used to install SAP HANA database using HDBLCM. + -## Requirements + +## Dependencies +- `fedora.linux_system_roles` + - Roles: + - `selinux` -The role requires additional collections which are specified in `meta/collection-requirements.yml`. Before using this role, -make sure that the required collections are installed, for example by using the following command: +Install required collections by `ansible-galaxy install -vv -r meta/collection-requirements.yml`. + -`ansible-galaxy install -vv -r meta/collection-requirements.yml` +## Prerequisites + +Managed nodes: +- Directory with SAP Installation media is present and `sap_install_media_detect_source_directory` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community). +- Ensure that servers are configured for SAP HANA. See [Recommended](#recommended) section. +- Ensure that volumes and filesystems are configured correctly. See [Recommended](#recommended) section. -### Configure your system for the installation of SAP HANA - -- Make sure required volumes and filesystems are configured in the host. -You can use the role `sap_storage_setup` to configure this. More info [here](/roles/sap_storage_setup) - -- Run the roles `sap_general_preconfigure` and `sap_hana_preconfigure` for installing required packages and -for configuring system settings. - -### SAP HANA Software Installation .SAR Files +### Prepare SAP HANA installation media Place the following files in directory /software/hana or in any other directory specified by variable `sap_hana_install_software_directory`: - 1. The SAPCAR executable for the correct hardware architecture - 2. The SAP HANA Installation .SAR file - SAP HANA 2.0 Server - `IMDB_SERVER*.SAR` file - 3. Optional - SAP HANA Components .SAR files - Include other optional components such as `IMDB_AFL*.SAR` or `IMDB_LCAPPS*.SAR` - 4. Optional - SAP Host Agent .SAR file - Include other optional components such as `SAPHOSTAGENT*SAR` -#### Sample Directory Contents - with .SAR files - -- Sample directory `sap_hana_install_software_directory` containing SAP HANA software installation files - ```console - [root@hanahost SAP_HANA_INSTALLATION]# ls -l *.EXE *.SAR - -rwxr-xr-x. 1 nobody nobody 149561376 Mar 4 2021 IMDB_AFL20_054_1-80001894.SAR - -rwxr-xr-x. 1 nobody nobody 211762405 Mar 4 2021 IMDB_CLIENT20_007_23-80002082.SAR - -rwxr-xr-x. 1 nobody nobody 4483040 Mar 4 2021 SAPCAR_1010-70006178.EXE - -rwxr-xr-x. 1 nobody nobody 109492976 Mar 4 2021 IMDB_LCAPPS_2054_0-20010426.SAR - -rwxr-xr-x. 1 nobody nobody 109752805 Mar 4 2021 VCH202000_2054_0-80005463.SAR - -rwxr-xr-x. 1 nobody nobody 3694683699 Mar 4 2021 IMDB_SERVER20_054_0-80002031.SAR - -rwxr-xr-x. 1 nobody nobody 89285401 Sep 30 04:24 SAPHOSTAGENT51_51-20009394.SAR - ``` - -If more than one SAPCAR EXE file is present in the software directory, the role will select the latest version -for the current hardware architecture. Alternatively, the file name of the SAPCAR EXE file can also be set with -variable `sap_hana_install_sapcar_filename`. Example: -``` -sap_hana_install_sapcar_filename: SAPCAR_1115-70006178.EXE -``` - -If more than one SAR file for a certain software product is present in the software directory, the automatic -handling of such SAR files will fail after extraction, when moving the newly created product directories -(like `SAP_HOST_AGENT`) to already existing destinations. -For avoiding such situations, use following variable to provide a list of SAR files to extract: - -`sap_hana_install_sarfiles`. - -Example: -``` -sap_hana_install_sarfiles: - - SAPHOSTAGENT54_54-80004822.SAR - - IMDB_SERVER20_060_0-80002031.SAR +Example of `sap_hana_install_software_directory` content for SAP HANA installation: +```console +[root@hanahost SAP_HANA_INSTALLATION]# ls -l *.EXE *.SAR +-rwxr-xr-x. 1 nobody nobody 149561376 Mar 4 2021 IMDB_AFL20_054_1-80001894.SAR +-rwxr-xr-x. 1 nobody nobody 211762405 Mar 4 2021 IMDB_CLIENT20_007_23-80002082.SAR +-rwxr-xr-x. 1 nobody nobody 4483040 Mar 4 2021 SAPCAR_1010-70006178.EXE +-rwxr-xr-x. 1 nobody nobody 109492976 Mar 4 2021 IMDB_LCAPPS_2054_0-20010426.SAR +-rwxr-xr-x. 1 nobody nobody 109752805 Mar 4 2021 VCH202000_2054_0-80005463.SAR +-rwxr-xr-x. 1 nobody nobody 3694683699 Mar 4 2021 IMDB_SERVER20_054_0-80002031.SAR +-rwxr-xr-x. 1 nobody nobody 89285401 Sep 30 04:24 SAPHOSTAGENT51_51-20009394.SAR ``` -If there is a file named `.sha256` in the software download directory -`sap_hana_install_software_directory` which contains the checksum and the file name similar to the output -of the sha256sum command, the role will examine the sha256sum for the corresponding SAPCAR or SAR file and the -processing will continue only if the checksum matches. - -#### Extracted SAP HANA Software Installation Files - +**Considerations:** +- If more than one SAPCAR EXE file is present in the software directory, the role will select the latest version + for the current hardware architecture. Alternatively, the file name of the SAPCAR EXE file can also be set with + variable `sap_hana_install_sapcar_filename`. Example: + ``` + sap_hana_install_sapcar_filename: SAPCAR_1115-70006178.EXE + ``` +- If more than one SAR file for a certain software product is present in the software directory, the automatic + handling of such SAR files will fail after extraction, when moving the newly created product directories + (like `SAP_HOST_AGENT`) to already existing destinations. + For avoiding such situations, use following variable to provide a list of SAR files to extract: `sap_hana_install_sarfiles`. + + Example: + ``` + sap_hana_install_sarfiles: + - SAPHOSTAGENT54_54-80004822.SAR + - IMDB_SERVER20_060_0-80002031.SAR + ``` + +- If there is a file named `.sha256` in the software download directory + `sap_hana_install_software_directory` which contains the checksum and the file name similar to the output + of the sha256sum command, the role will examine the sha256sum for the corresponding SAPCAR or SAR file and the + processing will continue only if the checksum matches. + + +### Extracted SAP HANA Software Installation Files This role will detect if there is a file `hdblcm` already present in the directory specified by variable `sap_hana_install_software_extract_directory` or in any directory below. If If found, it will skip the .SAR extraction phase and proceed with the installation. @@ -94,16 +93,16 @@ software extract directory is required then set `sap_hana_install_cleanup_extrac these cleanup actions are false. -- Sample directory `sap_hana_install_software_extract_directory` containing extracted SAP HANA software installation files - ```console - [root@hanahost extracted]# ll -lrt - drwxr-xr-x 4 root root 4096 Sep 30 04:55 SAP_HANA_AFL - drwxr-xr-x 5 root root 4096 Sep 30 04:55 SAP_HANA_CLIENT - drwxr-xr-x 4 root root 4096 Sep 30 04:55 SAP_HANA_LCAPPS - drwxr-xr-x 8 root root 4096 Sep 30 04:57 SAP_HANA_DATABASE - drwxr-xr-x 2 root root 4096 Sep 30 04:58 SAP_HOST_AGENT - drwxr-xr-x 4 root root 4096 Sep 30 04:58 VCH_AFL_2020 - ``` +- Example of directory `sap_hana_install_software_extract_directory` containing extracted SAP HANA software installation files +```console +[root@hanahost extracted]# ll -lrt +drwxr-xr-x 4 root root 4096 Sep 30 04:55 SAP_HANA_AFL +drwxr-xr-x 5 root root 4096 Sep 30 04:55 SAP_HANA_CLIENT +drwxr-xr-x 4 root root 4096 Sep 30 04:55 SAP_HANA_LCAPPS +drwxr-xr-x 8 root root 4096 Sep 30 04:57 SAP_HANA_DATABASE +drwxr-xr-x 2 root root 4096 Sep 30 04:58 SAP_HOST_AGENT +drwxr-xr-x 4 root root 4096 Sep 30 04:58 VCH_AFL_2020 +``` #### SAP HANA hdblcm Configfile Processing @@ -140,111 +139,24 @@ Note: If there is a file named `configfile.cfg` in the directory specified by ro will be performed. Be aware that when using this file, any modifications to role variables after creation of this file will not be reflected. -## Further Variables and Parameters - -### Input Parameters - -If the variable `sap_hana_install_check_sidadm_user` is set to `no`, the role will install SAP HANA even -if the sidadm user exists. Default is `yes`, in which case the installation will not be performed if the -sidadm user exists. - -The variable `sap_hana_install_new_system` determines if the role will perform a fresh SAP HANA installation -or if it will add further hosts to an existing SAP HANA system as specified by variable -`sap_hana_install_addhosts`. Default is `yes` for a fresh SAP HANA installation. - -The role can be configured to also set the required firewall ports for SAP HANA. If this is desired, set -the variable `sap_hana_install_update_firewall` to `yes` (default is `no`). The firewall ports are defined -in a variable which is compatible with the variable structure used by Linux System Role `firewall`. -The firewall ports for SAP HANA are defined in member `port` of the first field of variable -`sap_hana_install_firewall` (`sap_hana_install_firewall[0].port`), see file `defaults/main.yml`. If the -member `state` is set to `enabled`, the ports will be enabled. If the member `state` is set to `disabled`, -the ports will be disabled, which might be useful for testing. - -Certain parameters have identical meanings, for supporting different naming schemes in playbooks and inventories. -You can find those in the task `Rename some variables used by hdblcm configfile` of the file `tasks/main.yml`. -Example: The parameter `sap_hana_install_number`, which is used by the role to define the hdblm parameter `number` -(= SAP HANA instance number) can be defined by setting `sap_hana_instance_number`, `sap_hana_install_instance_nr`, -`sap_hana_install_instance_number`, or `sap_hana_install_number`. The order of precedence is from left to right. - -### Default Parameters - -Please check the default parameters file for more information on other parameters that can be used as an input -- [**sap_hana_install** default parameters](defaults/main.yml) + ## Execution - -Sample Ansible Playbook Execution - -- Local Host Installation - - `ansible-playbook --connection=local --limit localhost -i "localhost," sap-hana-install.yml -e "@inputs/HDB.install"` - -- Target Host Installation - - `ansible-playbook -i "" sap-hana-install.yml -e "@inputs/HDB.install"` - -## Sample playbooks - -### Sample playbook for installing a new scale-up (=single node) SAP HANA system - -```yaml ---- -- hosts: all - collections: - - community.sap_install - become: true - vars: - sap_hana_install_software_directory: /software/hana - sap_hana_install_common_master_password: 'NewPass$321' - sap_hana_install_sid: 'H01' - sap_hana_install_instance_nr: '00' - roles: - - sap_hana_install -``` - -### Sample playbook for installing a new scale-out SAP HANA system - -```yaml ---- -- hosts: all - collections: - - community.sap_install - become: true - vars: - sap_hana_install_software_directory: /software/hana - sap_hana_install_common_master_password: 'NewPass$321' - sap_hana_install_root_password: 'NewPass$321' - sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' - sap_hana_install_sid: 'H01' - sap_hana_install_instance_nr: '00' - roles: - - sap_hana_install -``` - -### Sample playbook for adding additional nodes to an existing SAP HANA installation - -```yaml ---- -- hosts: all - collections: - - community.sap_install - become: true - vars: - sap_hana_install_software_directory: /software/hana - sap_hana_install_new_system: no - sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' - sap_hana_install_common_master_password: 'NewPass$321' - sap_hana_install_root_password: 'NewPass$321' - sap_hana_install_sid: 'H01' - sap_hana_install_instance_nr: '00' - roles: - - sap_hana_install -``` - -You can find more complex playbooks in directory `playbooks` of the collection `community.sap_install`. - -## Flow - -### New SAP HANA Installation - + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) +3. [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) +4. *`sap_hana_install`* + + +### Execution Flow + #### Perform Initial Checks These checks will be performed by default but can be skipped by setting `sap_hana_install_force` to `true`. @@ -338,9 +250,70 @@ in a temporary directory for use by the hdblcm command in the next step. #### Post-Install - Print a short summary of the result of the installation. + + +### Example + +#### Example playbook for installing a new scale-up (=single node) SAP HANA system +```yaml +--- +- name: Ansible Play for SAP HANA installation - One host + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hana_install + ansible.builtin.include_role: + name: community.sap_install.sap_hana_install + vars: + sap_hana_install_software_directory: /software/hana + sap_hana_install_common_master_password: 'NewPass$321' + sap_hana_install_sid: 'H01' + sap_hana_install_instance_nr: '00' +``` + +#### Example playbook for installing a new scale-out SAP HANA system +```yaml +--- +- name: Ansible Play for SAP HANA installation - Scale-out + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hana_install + ansible.builtin.include_role: + name: community.sap_install.sap_hana_install + vars: + sap_hana_install_software_directory: /software/hana + sap_hana_install_common_master_password: 'NewPass$321' + sap_hana_install_root_password: 'NewPass$321' + sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' + sap_hana_install_sid: 'H01' + sap_hana_install_instance_nr: '00' +``` + +#### Example playbook for adding additional nodes to an existing SAP HANA installation +```yaml +--- +- name: Ansible Play for SAP HANA installation - Add host + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hana_install + ansible.builtin.include_role: + name: community.sap_install.sap_hana_install + vars: + sap_hana_install_software_directory: /software/hana + sap_hana_install_new_system: no + sap_hana_install_addhosts: 'host2:role=worker,host3:role=worker:group=g02,host4:role=standby:group=g02' + sap_hana_install_common_master_password: 'NewPass$321' + sap_hana_install_root_password: 'NewPass$321' + sap_hana_install_sid: 'H01' + sap_hana_install_instance_nr: '00' +``` + -## Tags + +### Role Tags With the following tags, the role can be called to perform certain activities only: - tag `sap_hana_install_check_installation`: Perform an installation check, using `hdbcheck` or `hdblcm --action=check_installation`. @@ -373,30 +346,45 @@ With the following tags, the role can be called to perform certain activities on `overwrite`. - tag `sap_hana_install_store_connection_information`: Only run the `hdbuserstore` command -Sample call for only processing the SAPCAR and SAR files and creating the hdblcm configfile: -``` -# ansible-playbook sap-hana-install.yml --tags=sap_hana_install_preinstall --skip-tags=sap_hana_install_chown_hana_directories -``` +
+ How to run sap_hana_install with tags -Sample call for only processing the SAPCAR files: -``` -# ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sapcar -``` + #### Process SAPCAR and SAR files and create the hdblcm configfile: + ```console + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_preinstall --skip-tags=sap_hana_install_chown_hana_directories + ``` -Sample call for only processing the SAPCAR and SAR files, without extracting the SAR files: -``` -# ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sarfiles --skip-tags=sap_hana_install_extract_sarfiles -``` + #### Process only SAPCAR files: + ```console + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sapcar + ``` -Sample call for only displaying the SAP HANA hdblcm command line: -``` -# ansible-playbook sap-hana-install.yml --tags=sap_hana_install_hdblcm_commandline -``` + #### Process SAPCAR and SAR files without extracting SAR files: + ```console + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sarfiles --skip-tags=sap_hana_install_extract_sarfiles + ``` -## License + #### Display SAP HANA hdblcm command without using it + ``` + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_hdblcm_commandline + ``` +
-Apache license 2.0 -## Author Information + + + + + +## License + +Apache 2.0 + + +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) + -Red Hat for SAP Community of Practice, IBM Lab for SAP Solutions, Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo, Rainer Leber +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hana_install/INPUT_PARAMETERS.md) diff --git a/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md b/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md new file mode 100644 index 000000000..5cd5c87e9 --- /dev/null +++ b/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md @@ -0,0 +1,324 @@ +## Input Parameters for sap_hana_preconfigure Ansible Role + +## Role Input Parameters + +#### Minimum required parameters: + +This role does not require any parameter to be set in the playbook or inventory. + + +### sap_hana_preconfigure_config_all +- _Type:_ `bool` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_hana_preconfigure_installation +- _Type:_ `bool` + +If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_hana_preconfigure_configuration +- _Type:_ `bool` + +If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
+ +Example: + +```yaml +sap_hana_preconfigure_config_all: false +sap_hana_preconfigure_configuration: true +sap_hana_preconfigure_2772999_04: true +sap_hana_preconfigure_2382421: true +``` + +### sap_hana_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_hana_preconfigure_assert_all_config +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will check either tuned or static settings.
+If this parameter is set to to `true`, the role will check both tuned and static settings.
+ +### sap_hana_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_hana_preconfigure_system_roles_collection +- _Type:_ `str` +- _Default:_ `'fedora.linux_system_roles'` +- _Possible Values:_
+ - `fedora.linux_system_roles` + - `redhat.rhel_system_roles` + +Set which Ansible Collection to use for the Linux System Roles.
+For community/upstream, use 'fedora.linux_system_roles'
+For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
+ +### sap_hana_preconfigure_min_rhel_release_check +- _Type:_ `bool` +- _Default:_ `false` + +Check the RHEL release against parameter `sap_hana_preconfigure_supported_rhel_minor_releases`, which is a list of
+known SAP HANA supported RHEL minor releases. By default, the role will display a message and continue running if
+the RHEL release is not part of that list. If set to `true`, the role will fail in such a case.
+ +### sap_hana_preconfigure_supported_rhel_minor_releases +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA supported RHEL minor releases.
+ +### sap_hana_preconfigure_enable_sap_hana_repos +- _Type:_ `bool` +- _Default:_ `false` + +Set to 'true' to enable the SAP HANA required RHEL repos.
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_use_hana_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_7_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 7 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_7_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 7 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_8_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 8 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_8_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 8 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_9_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 9 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_9_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 9 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_set_minor_release +- _Type:_ `bool` +- _Default:_ `false` + +Use this parameter to set the RHEL minor release, which is required for SAP HANA.
+The related parameter is `sap_general_preconfigure_set_minor_release`.
+ +### sap_hana_preconfigure_create_directories +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the SAP HANA directories to be created by the role.
+The SAP HANA directories will always be created if `sap_hana_preconfigure_modify_selinux_labels`
+(see below) is set to `true`, no matter how `sap_hana_preconfigure_create_directories` is set.
+ +### sap_hana_preconfigure_hana_directories +- _Type:_ `list` with elements of type `str` +- _Default:_ + - /hana + - /lss/shared + +List of SAP HANA directories to be created.
+ +### sap_hana_preconfigure_modify_selinux_labels +- _Type:_ `bool` +- _Default:_ `true` + +For compatibility of SAP HANA with SELinux in enforcing mode, the role will recursively add
+the `usr_t` label to directories and files in the directories where HANA is installed.
+If relabeling not desired, set this parameter `false`.
+If the variable is set to `true`, the SAP HANA directories will be created no matter
+how the variable `sap_hana_preconfigure_create_directories` (see above) is set.
+ +### sap_hana_preconfigure_packages +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list
+or a list of the minimum required packages for SAP HANA server (parameter `__sap_hana_preconfigure_packages_min_install`).
+ +### sap_hana_preconfigure_min_package_check +- _Type:_ `bool` +- _Default:_ `true` + +SAP HANA requires certain minimum package versions to be supported. These minimum levels are listed in SAP Note 2235581.
+Set this parameter to `false` if you want to ignore these requirements.
+ +### sap_hana_preconfigure_update +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` to update the system to the latest package levels.
+By setting the parameter `sap_general_preconfigure_set_minor_release` of the
+role `sap_general_preconfigure` to `true`, you can install the most recent package updates
+without updating to a more recent RHEL minor release.
+ +### sap_hana_preconfigure_reboot_ok +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want to perform a reboot at the end of the role, if necessary.
+ +### sap_hana_preconfigure_fail_if_reboot_required +- _Type:_ `bool` +- _Default:_ `true` + +If `sap_hana_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
+remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
+Can be useful if you want to implement your own reboot handling.
+ +### sap_hana_preconfigure_kernel_parameters +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Network related linux kernel parameter settings for SAP HANA on all hardware platforms.
+ +### sap_hana_preconfigure_kernel_parameters_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Network related linux kernel parameter settings for platform ppc64le.
+ +### sap_hana_preconfigure_use_netapp_settings_nfs +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to also set NetApp NFS required kernel parameters.
+ +### sap_hana_preconfigure_install_ibm_power_tools +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
+ +### sap_hana_preconfigure_add_ibm_power_repo +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
+are already available on the local network). The IBM Power Systems service and productivity tools will only
+be installed if the variable `sap_hana_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
+ +### sap_hana_preconfigure_ibm_power_repo_url +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +URL of the IBM Power tools repository.
+ +### sap_hana_preconfigure_ppcle_mtu9000_if +- _Type:_ `str` +- _Default:_ `''` + +List of interfaces for which the MTU size will be set to `9000`.
+ +### sap_hana_preconfigure_ppcle_tso_if +- _Type:_ `list` with elements of type `str` +- _Default:_ + '{{ ansible_interfaces | difference([''lo'']) }}' + +List of interfaces for which the tso flag will be set.
+ +### sap_hana_preconfigure_use_tuned +- _Type:_ `bool` +- _Default:_ `true` + +Use tuned for configuring most of the kernel settings for SAP HANA
+Set this parameter to `false` to use static kernel settings
+ +### sap_hana_preconfigure_tuned_profile +- _Type:_ `str` +- _Default:_ `'sap-hana'` + +Name of the SAP HANA tuned tuned profile to enable (RHEL).
+ +### sap_hana_preconfigure_modify_grub_cmdline_linux +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` to modify the Grub boot command line.
+ +### sap_hana_preconfigure_run_grub2_mkconfig +- _Type:_ `bool` +- _Default:_ `true` + +By default, the role will run `grub2-mkconfig` to update the Grub configuration if necessary.
+Set this parameter to `false` if this is not desired.
+ +### sap_hana_preconfigure_db_group_name +- _Type:_ `str` + +Use this parameter to specify the name of the RHEL group which is used for the database processes.
+It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999.
+ +Example: + +```yaml +sap_hana_preconfigure_db_group_name: dba +``` + +### sap_hana_preconfigure_saptune_version +- _Type:_ `str` +- _Default:_ `''` + +Version of saptune to install (SLES for SAP Applications).
+This will replace the current installed version if present, even downgrade if necessary.
+ +### sap_hana_preconfigure_saptune_solution +- _Type:_ `str` +- _Default:_ `'HANA'` +- _Possible Values:_
+ - `HANA` + - `NETWEAVER+HANA` + - `S4HANA-APP+DB` + - `S4HANA-DBSERVER` + +The saptune solution to apply (SLES for SAP Applications).
+ +### sap_hana_preconfigure_saptune_azure +- _Type:_ `bool` +- _Default:_ `false` + +On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications).
+If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
+Set this parameter to `true` on Azure.
+ + \ No newline at end of file diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index bb581b58c..f141faac4 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -1,504 +1,146 @@ + # sap_hana_preconfigure Ansible Role + +![Ansible Lint for sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_preconfigure.yml/badge.svg) -This role installs additional required packages and performs additional configuration steps for installing and running SAP HANA. -If you want to configure a RHEL system for the installation and later usage of SAP HANA, you have to first run role sap_general_preconfigure -and then role sap_hana_preconfigure. However, if we wish to run SLES for HANA, you may run only this role. +## Description + +Ansible Role `sap_hana_preconfigure` is used to ensure that Managed nodes are configured to host SAP HANA systems according to SAP Notes after [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) role was executed. -## Requirements - -The role requires additional collections which are specified in `meta/collection-requirements.yml`. Before using this role, -make sure that the required collections are installed, for example by using the following command: - -`ansible-galaxy install -vv -r meta/collection-requirements.yml` - -To use this role, your system needs to be configured with the basic requirements for SAP NetWeaver or SAP HANA. This is typically done by running role sap_general_preconfigure (for RHEL managed nodes before RHEL 7.6, community maintained role sap-base-settings can be used). - -It is also strongly recommended to run role linux-system-roles.timesync for all systems running SAP HANA, to maintain an identical system time, before or after running role sap_hana_preconfigure. - -Managed nodes need to be properly registered to a repository source and have at least the following Red Hat repositories accessible (see also example playbook): - -for RHEL 7.x: -- rhel-7-[server|for-power-le]-e4s-rpms -- rhel-sap-hana-for-rhel-7-[server|for-power-le]-e4s-rpms - -for RHEL 8.x: -- rhel-8-for-[x86_64|ppc64le]-baseos-e4s-rpms -- rhel-8-for-[x86_64|ppc64le]-appstream-e4s-rpms -- rhel-8-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms - -for RHEL 9.x: -- rhel-9-for-[x86_64|ppc64le]-baseos-e4s-rpms -- rhel-9-for-[x86_64|ppc64le]-appstream-e4s-rpms -- rhel-9-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms - -for SLES 15.x: -- SLE-Module-SAP-Applications15-[SP number]-Pool -- SLE-Module-SAP-Applications15-[SP number]-Updates -- SLE-Product-SLES_SAP15-[SP number]-Pool -- SLE-Product-SLES_SAP15-[SP number]-Updates - -For details on configuring Red Hat, see the knowledge base article: [How to subscribe SAP HANA systems to the Update Services for SAP Solutions](https://access.redhat.com/solutions/3075991)). If you set role parameter sap_hana_preconfigure_enable_sap_hana_repos to `yes`, the role can enable these repos. - -To install HANA on Red Hat Enterprise Linux 7, 8, or 9, you need some additional packages which are contained in the -- rhel-sap-hana-for-rhel-7-[server|for-power-le]-e4s-rpms, -- rhel-8-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms, or -- rhel-9-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms - -repository. - -To get this repository you need to have one of the following products: - -- [RHEL for SAP Solutions](https://access.redhat.com/solutions/3082481) (premium, standard) -- RHEL for Business Partner NFRs -- [RHEL Developer Subscription](https://developers.redhat.com/products/sap/download/) - -To get a personal developer edition of RHEL for SAP solutions, please register as a developer and download the developer edition. - -- [Registration Link](http://developers.redhat.com/register) : - Here you can either register a new personal account or link it to an already existing - **personal** Red Hat Network account. -- [Download Link](https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.2/x86_64/product-software): - Here you can download the Installation DVD for RHEL with your previously registered - account - -*NOTE:* This is a regular RHEL installation DVD as RHEL for SAP Solutions is no additional - product but only a special bundling. The subscription grants you access to the additional - packages through our content delivery network (CDN) after installation. - -For supported RHEL releases [click here](https://access.redhat.com/solutions/2479121). - -Details on configuring SLES repositories can be found on the following articles for [on-premise systems](https://www.suse.com/support/kb/doc/?id=000018564) or [BYOS cloud images](https://www.suse.com/c/byos-instances-and-the-suse-public-cloud-update-infrastructure/) - - -It is also important that your disks are setup according to the [SAP storage requirements for SAP HANA](https://www.sap.com/documents/2015/03/74cdb554-5a7c-0010-8F2c7-eda71af511fa.html). This [BLOG](https://blogs.sap.com/2017/03/07/the-ultimate-guide-to-effective-sizing-of-sap-hana/) is also quite helpful when sizing HANA systems. -You can use the [storage](https://galaxy.ansible.com/linux-system-roles/storage) role to automate this process - -If you want to use this system in production, make sure that the time service is configured correctly. You can use [rhel-system-roles](https://access.redhat.com/articles/3050101) to automate this. - -Note ----- -For finding out which SAP notes will be used by this role for Red Hat systems, please check the contents of variable `__sap_hana_preconfigure_sapnotes` in files `vars/*.yml` (choose the file which matches your OS distribution and version). - -For SLES, notes are applied using the saptune service. Saptune supports a number of solutions. A solution implements several SAP notes. The default solution for this role is 'HANA'. To see a list of supported solutions and the notes that they implement, you can run `saptune solution list` on the command line. - -Do not run this role against an SAP HANA or other production system. The role will enforce a certain configuration on the managed node(s), which might not be intended. - -Changes -------- -1) Previous versions of this role used the variable sap_hana_preconfigure_use_tuned_where_possible to switch between either tuned settings -or kernel command line settings (where applicable). -The current version modifies this behavior: -- The variable sap_hana_preconfigure_use_tuned_where_possible has been renamed to sap_hana_preconfigure_use_tuned -- The variable sap_hana_preconfigure_switch_to_tuned_profile_sap_hana has been removed. -- If sap_hana_preconfigure_use_tuned is set to `yes`, which is also the default, the role will configure the system for using tuned and also switch to tuned profile sap-hana. - If sap_hana_preconfigure_use_tuned is set to `no`, the role will perform a static configuration, including the modification of the linux command line in grub. -- The role can use tuned, or configure the kernel command line, or both. - -2) Previous versions of this role used variable sap_hana_preconfigure_selinux_state to set the SELinux state to disabled. -As the role sap_general_preconfigure already allows to specify the desired SELinux state, and as sap_general_preconfigure -is always run before sap_hana_preconfigure, there is no need any more to let sap_hana_preconfigure configure the SELinux state. -The same applies to the assertion of the SELinux state. - -3) SLES systems are now configured using saptune rather than the ansible implementation of the notes. - - -## Role Input Parameters - -#### Minimum required parameters: - -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_hana_preconfigure_config_all -- _Type:_ `bool` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_hana_preconfigure_installation -- _Type:_ `bool` - -If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_hana_preconfigure_configuration -- _Type:_ `bool` - -If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
- -Example: - -```yaml -sap_hana_preconfigure_config_all: false -sap_hana_preconfigure_configuration: true -sap_hana_preconfigure_2772999_04: true -sap_hana_preconfigure_2382421: true -``` - -### sap_hana_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_hana_preconfigure_assert_all_config -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will check either tuned or static settings.
-If this parameter is set to to `true`, the role will check both tuned and static settings.
- -### sap_hana_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_hana_preconfigure_system_roles_collection -- _Type:_ `str` -- _Default:_ `'fedora.linux_system_roles'` -- _Possible Values:_
- - `fedora.linux_system_roles` - - `redhat.rhel_system_roles` - -Set which Ansible Collection to use for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'
-For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
- -### sap_hana_preconfigure_min_rhel_release_check -- _Type:_ `bool` -- _Default:_ `false` - -Check the RHEL release against parameter `sap_hana_preconfigure_supported_rhel_minor_releases`, which is a list of
-known SAP HANA supported RHEL minor releases. By default, the role will display a message and continue running if
-the RHEL release is not part of that list. If set to `true`, the role will fail in such a case.
- -### sap_hana_preconfigure_supported_rhel_minor_releases -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA supported RHEL minor releases.
- -### sap_hana_preconfigure_enable_sap_hana_repos -- _Type:_ `bool` -- _Default:_ `false` - -Set to 'true' to enable the SAP HANA required RHEL repos.
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_use_hana_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_7_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 7 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_7_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 7 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_8_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 8 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_8_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 8 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_9_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 9 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_9_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 9 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_set_minor_release -- _Type:_ `bool` -- _Default:_ `false` - -Use this parameter to set the RHEL minor release, which is required for SAP HANA.
-The related parameter is `sap_general_preconfigure_set_minor_release`.
- -### sap_hana_preconfigure_create_directories -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the SAP HANA directories to be created by the role.
-The SAP HANA directories will always be created if `sap_hana_preconfigure_modify_selinux_labels`
-(see below) is set to `true`, no matter how `sap_hana_preconfigure_create_directories` is set.
- -### sap_hana_preconfigure_hana_directories -- _Type:_ `list` with elements of type `str` -- _Default:_ - - /hana - - /lss/shared - -List of SAP HANA directories to be created.
- -### sap_hana_preconfigure_modify_selinux_labels -- _Type:_ `bool` -- _Default:_ `true` - -For compatibility of SAP HANA with SELinux in enforcing mode, the role will recursively add
-the `usr_t` label to directories and files in the directories where HANA is installed.
-If relabeling not desired, set this parameter `false`.
-If the variable is set to `true`, the SAP HANA directories will be created no matter
-how the variable `sap_hana_preconfigure_create_directories` (see above) is set.
- -### sap_hana_preconfigure_packages -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list
-or a list of the minimum required packages for SAP HANA server (parameter `__sap_hana_preconfigure_packages_min_install`).
- -### sap_hana_preconfigure_min_package_check -- _Type:_ `bool` -- _Default:_ `true` - -SAP HANA requires certain minimum package versions to be supported. These minimum levels are listed in SAP Note 2235581.
-Set this parameter to `false` if you want to ignore these requirements.
- -### sap_hana_preconfigure_update -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` to update the system to the latest package levels.
-By setting the parameter `sap_general_preconfigure_set_minor_release` of the
-role `sap_general_preconfigure` to `true`, you can install the most recent package updates
-without updating to a more recent RHEL minor release.
- -### sap_hana_preconfigure_reboot_ok -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want to perform a reboot at the end of the role, if necessary.
- -### sap_hana_preconfigure_fail_if_reboot_required -- _Type:_ `bool` -- _Default:_ `true` - -If `sap_hana_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
-remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
-Can be useful if you want to implement your own reboot handling.
- -### sap_hana_preconfigure_kernel_parameters -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Network related linux kernel parameter settings for SAP HANA on all hardware platforms.
- -### sap_hana_preconfigure_kernel_parameters_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Network related linux kernel parameter settings for platform ppc64le.
- -### sap_hana_preconfigure_use_netapp_settings_nfs -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` to also set NetApp NFS required kernel parameters.
- -### sap_hana_preconfigure_install_ibm_power_tools -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
- -### sap_hana_preconfigure_add_ibm_power_repo -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
-are already available on the local network). The IBM Power Systems service and productivity tools will only
-be installed if the variable `sap_hana_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
- -### sap_hana_preconfigure_ibm_power_repo_url -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -URL of the IBM Power tools repository.
- -### sap_hana_preconfigure_ppcle_mtu9000_if -- _Type:_ `str` -- _Default:_ `''` - -List of interfaces for which the MTU size will be set to `9000`.
- -### sap_hana_preconfigure_ppcle_tso_if -- _Type:_ `list` with elements of type `str` -- _Default:_ - '{{ ansible_interfaces | difference([''lo'']) }}' - -List of interfaces for which the tso flag will be set.
- -### sap_hana_preconfigure_use_tuned -- _Type:_ `bool` -- _Default:_ `true` - -Use tuned for configuring most of the kernel settings for SAP HANA
-Set this parameter to `false` to use static kernel settings
- -### sap_hana_preconfigure_tuned_profile -- _Type:_ `str` -- _Default:_ `'sap-hana'` - -Name of the SAP HANA tuned tuned profile to enable (RHEL).
- -### sap_hana_preconfigure_modify_grub_cmdline_linux -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` to modify the Grub boot command line.
- -### sap_hana_preconfigure_run_grub2_mkconfig -- _Type:_ `bool` -- _Default:_ `true` - -By default, the role will run `grub2-mkconfig` to update the Grub configuration if necessary.
-Set this parameter to `false` if this is not desired.
- -### sap_hana_preconfigure_db_group_name -- _Type:_ `str` - -Use this parameter to specify the name of the RHEL group which is used for the database processes.
-It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999.
- -Example: - -```yaml -sap_hana_preconfigure_db_group_name: dba -``` - -### sap_hana_preconfigure_saptune_version -- _Type:_ `str` -- _Default:_ `''` - -Version of saptune to install (SLES for SAP Applications).
-This will replace the current installed version if present, even downgrade if necessary.
- -### sap_hana_preconfigure_saptune_solution -- _Type:_ `str` -- _Default:_ `'HANA'` -- _Possible Values:_
- - `HANA` - - `NETWEAVER+HANA` - - `S4HANA-APP+DB` - - `S4HANA-DBSERVER` - -The saptune solution to apply (SLES for SAP Applications).
- -### sap_hana_preconfigure_saptune_azure -- _Type:_ `bool` -- _Default:_ `false` - -On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications).
-If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
-Set this parameter to `true` on Azure.
- - - -## Example Playbook - -Simple playbook, named sap+hana.yml: -```yaml ---- -- hosts: all - roles: - - role: sap_general_preconfigure - - role: sap_hana_preconfigure -``` - -Simple playbook for an extended check (assert) run, named sap+hana-assert.yml: +This role performs installation of required packages for running SAP HANA systems and configuration of Operating system parameters. + + + +## Dependencies +- `fedora.linux_system_roles` + - Roles: + - `selinux` + +Install required collections by `ansible-galaxy install -vv -r meta/collection-requirements.yml`. + + + +## Prerequisites +Managed nodes: +- Ensure that general operating system configuration for SAP is performed by [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure). See [Recommended](#recommended) section. + +
+ (Red Hat) Ensure required repositories are available + + Managed nodes need to be properly registered to a repository source and have at least the following Red Hat repositories accessible: + + for RHEL 7.x: + - rhel-7-[server|for-power-le]-e4s-rpms + - rhel-sap-hana-for-rhel-7-[server|for-power-le]-e4s-rpms + + for RHEL 8.x: + - rhel-8-for-[x86_64|ppc64le]-baseos-e4s-rpms + - rhel-8-for-[x86_64|ppc64le]-appstream-e4s-rpms + - rhel-8-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms + + for RHEL 9.x: + - rhel-9-for-[x86_64|ppc64le]-baseos-e4s-rpms + - rhel-9-for-[x86_64|ppc64le]-appstream-e4s-rpms + - rhel-9-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms + + For details on configuring Red Hat, see the knowledge base article: [How to subscribe SAP HANA systems to the Update Services for SAP Solutions](https://access.redhat.com/solutions/3075991)). If you set role parameter sap_hana_preconfigure_enable_sap_hana_repos to `yes`, the role can enable these repos. + + To install HANA on Red Hat Enterprise Linux 7, 8, or 9, you need some additional packages which are contained in one of following repositories + - rhel-sap-hana-for-rhel-7-[server|for-power-le]-e4s-rpms + - rhel-8-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms + - rhel-9-for-[x86_64|ppc64le]-sap-solutions-e4s-rpms + + To get this repository you need to have one of the following products: + - [RHEL for SAP Solutions](https://access.redhat.com/solutions/3082481) (premium, standard) + - RHEL for Business Partner NFRs + - [RHEL Developer Subscription](https://developers.redhat.com/products/sap/download/) + + To get a personal developer edition of RHEL for SAP solutions, please register as a developer and download the developer edition. + + - [Registration Link](http://developers.redhat.com/register) : + Here you can either register a new personal account or link it to an already existing + **personal** Red Hat Network account. + - [Download Link](https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.2/x86_64/product-software): + Here you can download the Installation DVD for RHEL with your previously registered + account + + *NOTE:* This is a regular RHEL installation DVD as RHEL for SAP Solutions is no additional + product but only a special bundling. The subscription grants you access to the additional + packages through our content delivery network (CDN) after installation. + + For supported RHEL releases [click here](https://access.redhat.com/solutions/2479121). + + It is also important that your disks are setup according to the [SAP storage requirements for SAP HANA](https://www.sap.com/documents/2015/03/74cdb554-5a7c-0010-8F2c7-eda71af511fa.html). This [BLOG](https://blogs.sap.com/2017/03/07/the-ultimate-guide-to-effective-sizing-of-sap-hana/) is also quite helpful when sizing HANA systems. + You can use the [storage](https://galaxy.ansible.com/linux-system-roles/storage) role to automate this process + + If you want to use this system in production, make sure that the time service is configured correctly. You can use [rhel-system-roles](https://access.redhat.com/articles/3050101) to automate this. + + Note + ---- + For finding out which SAP notes will be used by this role for Red Hat systems, please check the contents of variable `__sap_hana_preconfigure_sapnotes` in files `vars/*.yml` (choose the file which matches your OS distribution and version). +
+ + +## Execution + +**:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** + +**NOTE: It is recommended to execute `timesync` role from Ansible Collection `fedora.linux_system_roles` before or after executing this role.** + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. *`sap_hana_preconfigure`* + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Install required packages and patch system if `sap_hana_preconfigure_update:true` +3. Apply configurations + - Execute configuration tasks based on SAP Notes + - (SUSE) Execute saptune with solution `sap_hana_preconfigure_saptune_solution` (Default: `HANA`) +4. Reboot Managed nodes if packages were installed or patched and `sap_hana_preconfigure_reboot_ok: true` + + +### Example + +Example of execution together with prerequisite role [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) ```yaml --- -- hosts: all - vars: - sap_general_preconfigure_assert: yes - sap_general_preconfigure_assert_ignore_errors: yes - sap_hana_preconfigure_assert: yes - sap_hana_preconfigure_assert_ignore_errors: yes - roles: - - role: sap_general_preconfigure - - role: sap_hana_preconfigure -``` - -## Example Usage - -Normal run, for configuring server host_1 for SAP HANA: -```yaml -ansible-playbook sap+hana.yml -l host_1 -``` - -Extended Check (assert) run, not aborting if an error has been found: -```yaml -ansible-playbook sap+hana-assert.yml -l host_1 +- name: Ansible Play for SAP HANA HA Scale-up preconfigure + hosts: hana_primary, hana_secondary + become: true + tasks: + - name: Execute Ansible Role sap_general_preconfigure + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure + + - name: Execute Ansible Role sap_hana_preconfigure + ansible.builtin.include_role: + name: community.sap_install.sap_hana_preconfigure ``` + -Same as above, with a nice compact and colored output, this time for two hosts: -```yaml -ansible-playbook sap+hana-assert.yml -l host_1,host_2 | -awk '{sub (" \"msg\": ", "")} - /TASK/{task_line=$0} - /fatal:/{fatal_line=$0; nfatal[host]++} - /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0} - /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2} - /SAP note/{print "\033[30m[" host"] "$0} - /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0} - /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0} - /PASS:/{npass[host]++; print "\033[32m[" host"] "$0} - /INFO:/{print "\033[34m[" host"] "$0} - /changed/&&/unreachable/{print "\033[30m[" host"] "$0} - END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) { - printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033[30m Last TASK and fatal output:\n"); print task_line, fatal_line - } - else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033[30m\n", nfail[var], nwarn[var], npass[var])}}' -``` -Note: For terminals with dark background, replace the color code `30m` by `37m`. -In case you need to make an invisible font readable on a terminal with dark background, run the following command in the terminal: -```yaml -printf "\033[37mreadable font\n" -``` -In case you need to make an invisible font readable on a terminal with bright background, run the following command in the terminal: -```yaml -printf "\033[30mreadable font\n" -``` - -## Contribution + + -Please read the [developer guidelines](./README.DEV.md) if you want to contribute + + ## License + +Apache 2.0 + -Apache license 2.0 +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) + -## Author Information - -Red Hat for SAP Community of Practice, Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo, Rainer Leber +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md) diff --git a/roles/sap_hostagent/INPUT_PARAMETERS.md b/roles/sap_hostagent/INPUT_PARAMETERS.md new file mode 100644 index 000000000..1b10434b8 --- /dev/null +++ b/roles/sap_hostagent/INPUT_PARAMETERS.md @@ -0,0 +1,130 @@ +## Input Parameters for sap_hostagent Ansible Role + + +### sap_hostagent_installation_type + +- _Type:_ `string` +- _Default:_ `rpm` + +Select type of installation source for SAPHOSTAGENT.
+Available options: `sar`, `sar-remote`, `bundle`, `rpm` + + +## Input Parameters for SAR +Following input parameters are used by both Local SAR and Remote SAR. + +### sap_hostagent_sar_file_name + +- _Type:_ `string` + +Name of SAR file containing SAPHOSTAGENT. + +### sap_hostagent_sapcar_file_name + +- _Type:_ `string` + +Name of SAR file containing SAPCAR. + +## Input Parameters for Local SAR + +### sap_hostagent_sar_local_path + +- _Type:_ `string` + +Local directory path where SAR file is located. Do not use together with `sap_hostagent_sar_remote_path`. + +### sap_hostagent_sapcar_local_path + +- _Type:_ `string` + +Local directory path where SAPCAR file is located. Do not use together with `sap_hostagent_sapcar_remote_path`. + +## Input Parameters for Remote SAR + +### sap_hostagent_sar_remote_path + +- _Type:_ `string` + +Remote directory path where SAR file is located. Do not use together with `sap_hostagent_sar_local_path`. + +### sap_hostagent_sapcar_remote_path + +- _Type:_ `string` + +Local directory path where SAPCAR file is located. Do not use together with `sap_hostagent_sapcar_local_path`. + + +## Input Parameters for RPM + +### sap_hostagent_rpm_local_path + +- _Type:_ `string` + +Local directory path where RPM file is located. Do not use together with `sap_hostagent_rpm_remote_path`. + +### sap_hostagent_rpm_remote_path + +- _Type:_ `string` + +Remote directory path where RPM file is located. Do not use together with `sap_hostagent_rpm_local_path`. + +### sap_hostagent_rpm_file_name + +- _Type:_ `string` + +Name of RPM package containing SAPHOSTAGENT. + + +## Input Parameters for SAP Bundle + +### sap_hostagent_bundle_path + +- _Type:_ `string` + +Remote directory path where SAP Bundle file is located after being extracted. + + +## Input Parameters for SSL setup + +### sap_hostagent_config_ssl + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to configure PSE and create CSR.
+Adding signed certificates from a valid CA is not supported yet. + +### sap_hostagent_ssl_passwd + +- _Type:_ `string` + +Enter password for the CSR. It is used when `sap_hostagent_config_ssl` is set. + +### sap_hostagent_ssl_org + +- _Type:_ `string` + +Enter Organization information for the CSR. It is used when `sap_hostagent_config_ssl` is set. + +### sap_hostagent_ssl_country + +- _Type:_ `string` + +Enter Country information for the CSR. It is used when `sap_hostagent_config_ssl` is set. + + +### sap_hostagent_agent_tmp_directory + +- _Type:_ `string` +- _Default:_ `/tmp/hostagent` + +Temporary directory for processing of source file. + +### sap_hostagent_clean_tmp_directory + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to remove temporary directory after installation. + + \ No newline at end of file diff --git a/roles/sap_hostagent/README.md b/roles/sap_hostagent/README.md index 13aa84fa4..400395153 100644 --- a/roles/sap_hostagent/README.md +++ b/roles/sap_hostagent/README.md @@ -1,150 +1,134 @@ + # sap_hostagent Ansible Role + -SAP Host Agent is an agent that can accomplish several life-cycle management tasks, such as operating system monitoring, database monitoring, system instance control and provisioning. - -It is recommended to install SAP Host Agent upfront in any HA environment. - -You can find the latest Documentation in [SAP NOTE 1907566](https://launchpad.support.sap.com/#/notes/1907566) - -This role installs or updates the SAP Host Agent on a RHEL 7.x or 8.x system. It is provided as RPM package, tarball or as part of an SAP softwarebundle. -While Red Hat recommends RPM for easier upgrade, this role take care of all formats. - -## Requirements - -This role is intended to use on a RHEL system that gets SAP software. -So your system needs to be installed with at least the RHEL core packages, properly registered and prepared for HANA or Netweaver installation. - -It needs access to the software repositories required to install SAP HANA (see also: [How to subscribe SAP HANA systems to the Update Services for SAP Solutions](https://access.redhat.com/solutions/3075991)) - -You can use the [redhat_sap.sap_rhsm](https://galaxy.ansible.com/redhat_sap/sap_rhsm) Galaxy Role to automate this process - -To install SAP software on Red Hat Enterprise Linux you need some additional packages which come in a special repository. To get this repository you need to have one -of the following products: - -- [RHEL for SAP Solutions](https://access.redhat.com/solutions/3082481) (premium, standard, developer Edition) -- [RHEL for Business Partner NFRs](https://partnercenter.redhat.com/NFRPageLayout) - -[Click here](https://developers.redhat.com/products/sap/download/) to achieve a personal developer edition of RHEL for SAP Solutions. Please register as a developer and download the developer edition. - -- [Registration Link](http://developers.redhat.com/register) : - Here you can either register a new personal account or link it to an already existing **personal** Red Hat Network account. -- [Download Link](https://access.redhat.com/downloads/): - Here you can download the Installation DVD for RHEL with your previously registered account - -*NOTE:* This is a regular RHEL installation DVD as RHEL for SAP Solutions is no additional - product but only a special bundling. The subscription grants you access to the additional - packages through our content delivery network(CDN) after installation. - -It is also important that your disks are setup according to the [SAP storage requirements for SAP HANA](https://www.sap.com/documents/2015/03/74cdb554-5a7c-0010-82c7-eda71af511fa.html). This [BLOG](https://blogs.sap.com/2017/03/07/the-ultimate-guide-to-effective-sizing-of-sap-hana/) is also quite helpful when sizing HANA systems. - -## Role Variables - -### RPM based installations - -| variable | info | required? | -|:--------:|:----:|:---------:| -|sap_hostagent_installation_type|Source type of the installation for SAPHOSTAGENT|yes, with `rpm` value| -|sap_hostagent_rpm_local_path|Local directory path where RPM file is located|yes, unless `sap_hostagent_rpm_remote_path` is used| -|sap_hostagent_rpm_remote_path|Local directory path where RPM file is located|yes, unless `sap_hostagent_rpm_local_path` is used| -|sap_hostagent_rpm_file_name|Local RPM file name|yes| -|sap_hostagent_agent_tmp_directory|Temporary directory path that will be created on the target host|no (defaulted in the role)| -|sap_hostagent_clean_tmp_directory|Boolean variable to indicate if the temporary directory will be removed or not after the installation| no (defaulted in the role)| - -### SAR based installations (content on ansible control node) - -| variable | info | required? | -|:--------:|:----:|:---------:| -|sap_hostagent_installation_type|Source type of the installation for SAPHOSTAGENT|yes with `sar` value| -|sap_hostagent_sar_local_path|Local directory path where SAR file is located|yes| -|sap_hostagent_sar_file_name|Local SAR file name|yes| -|sap_hostagent_sapcar_local_path|Local directory path where SAPCAR tool file is located|yes| -|sap_hostagent_sapcar_file_name|Local SAPCAR tool file name|yes| -|sap_hostagent_agent_tmp_directory|Temporary directory path that will be created on the target host|no (defaulted in the role)| -|sap_hostagent_clean_tmp_directory|Boolean variable to indicate if the temporary directory will be removed or not after the installation| no (defaulted in the role)| - -### SAR based installations (with content existing on target node) - -| variable | info | required? | -|:--------:|:----:|:---------:| -|sap_hostagent_installation_type|Source type of the installation for SAPHOSTAGENT|yes with `sar-remote` value| -|sap_hostagent_sar_remote_path|Remote directory path where SAR tool file is located|yes| -|sap_hostagent_sar_file_name|SAR tool file name|yes| -|sap_hostagent_sapcar_remote_path|Remote directory path of SAR archive|yes| -|sap_hostagent_sapcar_file_name|Remote file name of SAR archive|yes| -|sap_hostagent_agent_tmp_directory|Temporary directory path that will be created on the target host|no (defaulted in the role)| -|sap_hostagent_clean_tmp_directory|Boolean variable to indicate if the temporary directory will be removed or not after the installation| no (defaulted in the role)| +## Description + +Ansible Role `sap_hostagent` is used install SAP Host Agent. +SAP Host Agent is an agent that can accomplish several life-cycle management tasks, such as operating system monitoring, database monitoring, system instance control and provisioning. -### SAP Bundle based installations - -| variable | info | required? | -|:--------:|:----:|:---------:| -|sap_hostagent_installation_type|Source type of the installation for SAPHOSTAGENT|yes with `bundle` value| -|sap_hostagent_bundle_path|Target host directory path where SAP Installation Bundle has been unarchived| -|sap_hostagent_agent_tmp_directory|Temporary directory path that will be created on the target host|no (defaulted in the role)| -|sap_hostagent_clean_tmp_directory|Boolean variable to indicate if the temporary directory will be removed or not after the installation| no (defaulted in the role)| - -### SSL Configuration - -Right now the role will configure the PSE and create a CSR. Adding signed certificates from a valid CA is not supported yet - -| variable | info | required? | -|:--------:|:----:|:---------:| -|sap_hostagent_config_ssl|This boolean variable will configure Agent for SSL communication|no (defaulted in the role)| -|sap_hostagent_ssl_passwd|Password to be used for the CSR|yes when `sap_hostagent_config_ssl` True| -|sap_hostagent_ssl_org|Organization information for the CSR|yes when `sap_hostagent_config_ssl` True| -|sap_hostagent_ssl_country|Country information for the CSR|yes when `sap_hostagent_config_ssl` True| - -## Dependencies - -Before using this role ensure your system has been configured properly to run SAP applications. - -You can use the supported role `sap_general_preconfigure` coming with RHEL 7 and 8 with RHEL for SAP Solutions Subscription - -The upstream version of this role can be found [here](https://github.com/linux-system-roles/sap_general_preconfigure) - -## Example Playbook - +This role installs SAP Host Agent with following source methods: +- SAP SAR file +- SAP Bundle +- RPM package (Red Hat only) + + + + + + +## Prerequisites +Managed nodes: +- Ensure that servers are configured for SAP Systems. See [Recommended](#recommended) section. + + +## Execution + + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. *`sap_hostagent`* + + +### Execution Flow + +1. Create temporary directory. +2. Execute deployment based on chosen method. +3. Configure SSL if `sap_hostagent_config_ssl` was set. +4. Cleanup temporary directory + + +### Example + +#### Example playbook for installing using SAR file located on control node ```yaml - - hosts: servers - roles: - - role: sap_hostagent +--- +- name: Ansible Play for SAP Host Agent installation - Local SAR + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hostagent + ansible.builtin.include_role: + name: community.sap_install.sap_hostagent + vars: + sap_hostagent_installation_type: "sar" + sap_hostagent_sar_local_path: "/software/SAPHOSTAGENT" + sap_hostagent_sar_file_name: "SAPHOSTAGENT44_44-20009394.SAR" + sap_hostagent_sapcar_local_path: "/software/SAPHOSTAGENT" + sap_hostagent_sapcar_file_name: "SAPCAR_1311-80000935.EXE" + sap_hostagent_clean_tmp_directory: true ``` - -## Example Inventory - -When using RPM: - +#### Example playbook for installing using SAR file located on managed node ```yaml -sap_hostagent_installation_type: "rpm" -sap_hostagent_rpm_local_path: "/mylocaldir/SAPHOSTAGENT" -sap_hostagent_rpm_file_name: "saphostagentrpm_44-20009394.rpm" -sap_hostagent_clean_tmp_directory: true +--- +- name: Ansible Play for SAP Host Agent installation - Remote SAR + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hostagent + ansible.builtin.include_role: + name: community.sap_install.sap_hostagent + vars: + sap_hostagent_installation_type: "sar" + sap_hostagent_sar_remote_path: "/software/SAPHOSTAGENT" + sap_hostagent_sar_file_name: "SAPHOSTAGENT44_44-20009394.SAR" + sap_hostagent_sapcar_remote_path: "/software/SAPHOSTAGENT" + sap_hostagent_sapcar_file_name: "SAPCAR_1311-80000935.EXE" + sap_hostagent_clean_tmp_directory: true ``` - -When using SAR: - +#### Example playbook for installing using SAP Bundle ```yaml -sap_hostagent_installation_type: "sar" -sap_hostagent_sar_local_path: "/mylocaldir/SAPHOSTAGENT" -sap_hostagent_sar_file_name: "SAPHOSTAGENT44_44-20009394.SAR" -sap_hostagent_sapcar_local_path: "/mylocaldir/SAPHOSTAGENT" -sap_hostagent_sapcar_file_name: "SAPCAR_1311-80000935.EXE" -sap_hostagent_clean_tmp_directory: true +--- +- name: Ansible Play for SAP Host Agent installation - SAP bundle + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hostagent + ansible.builtin.include_role: + name: community.sap_install.sap_hostagent + vars: + sap_hostagent_installation_type: "bundle" + sap_hostagent_bundle_path: "/usr/local/src/HANA-BUNDLE/51053381" + sap_hostagent_clean_tmp_directory: true ``` - -When using SAP Bundle: - +#### Example playbook for installing using RPM on Red Hat ```yaml -sap_hostagent_installation_type: "bundle" -sap_hostagent_bundle_path: "/usr/local/src/HANA-BUNDLE/51053381" -sap_hostagent_clean_tmp_directory: true +--- +- name: Ansible Play for SAP Host Agent installation - SAP bundle + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_hostagent + ansible.builtin.include_role: + name: community.sap_install.sap_hostagent + vars: + sap_hostagent_installation_type: "rpm" + sap_hostagent_rpm_local_path: "/mylocaldir/SAPHOSTAGENT" + sap_hostagent_rpm_file_name: "saphostagentrpm_44-20009394.rpm" + sap_hostagent_clean_tmp_directory: true ``` + -## License + + -Apache license 2.0 + + -## Author Information - -IBM Lab for SAP Solutions, Red Hat for SAP Community of Practice +## License + +Apache 2.0 + + +## Maintainers + +- [Markus Koch](https://github.com/rhmk) +- [Bernd Finger](https://github.com/berndfinger) + + +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hostagent/INPUT_PARAMETERS.md) diff --git a/roles/sap_install_media_detect/INPUT_PARAMETERS.md b/roles/sap_install_media_detect/INPUT_PARAMETERS.md new file mode 100644 index 000000000..67beaf028 --- /dev/null +++ b/roles/sap_install_media_detect/INPUT_PARAMETERS.md @@ -0,0 +1,181 @@ +## Input Parameters for sap_install_media_detect Ansible Role + +### sap_install_media_detect_rar_handling + +- _Type:_ `bool` +- _Default:_ `True` + +Set this parameter to `false` for skipping the handling of RAR files. In this case, also no `unar` or other RAR handling software will be installed. + + +### sap_install_media_detect_rar_package + +- _Type:_ `str` +- _Default:_ `EPEL` + +Set this parameter to use either the `unar` package from `EPEL` or another software package for handling RAR files.
+Based on this setting, the commands for listing and extracting RAR files are being set in tasks/prepare/enable_rar_handling.yml + +### sap_install_media_detect_epel_gpg_key_url + +- _Type:_ `str` +- _Default:_ `https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}` + +URL for the EPEL GPG key + +### sap_install_media_detect_use_rpm_key_module_for_removing_the_key + +- _Type:_ `bool` +- _Default:_ `True` + +The `EPEL` GPG key can be removed with the rpm_key module and the URL for the key, or by using the `rpm -e` command.
+For using the rpm -e command, set this variable to 'false'. + +### sap_install_media_detect_file_server_only + +- _Type:_ `bool` +- _Default:_ `False` + +If this role is running on a file server on which the SAP software is not to be installed, set the following to true.
+If this role is running on a system on which the SAP software is to be installed, set the following to false. + +### sap_install_media_detect_rar_list + +- _Type:_ `str` +- _Default:_ `/usr/bin/unrar lb` + +Fully qualified path to the program for listing RAR files, including the argument for listing files.
+If not specified, the `lsar` program (or a link with the name `lsar`, pointing to the actual `lsar` program) is expected to be located in one of the PATH directories.
+If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. + +### sap_install_media_detect_rar_extract + +- _Type:_ `str` +- _Default:_ `/usr/bin/unrar x` + +Fully qualified path to the program for extracting RAR files, including the argument for extracting files.
+If not specified, the `unar` program (or a link with the name `unar`, pointing to the actual `unar` program) is expected to be located in one of the PATH directories.
+If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. + +### sap_install_media_detect_rar_extract_directory_argument + +- _Type:_ `str` + +Fully qualified path to an additional argument to the program for extracting RAR files, for specifying the directory into which the archive is to be extracted. Needs to be empty or start with a space character.
+If sap_install_media_detect_rar_package is set to 'EPEL', this variable is not used. + +### sap_install_media_detect_source_directory + +- _Type:_ `str` +- _Default:_ `/software` + +Directory where the SAP software is located + +### sap_install_media_detect_target_directory + +- _Type:_ `str` + +Directory where the SAP software is located after the role is run, if different from `sap_install_media_detect_source_directory` + +### sap_install_media_detect_create_target_directory + +- _Type:_ `bool` +- _Default:_ `True` + +Create target directory if it does not yet exist. If set to false, perform a check only + +### sap_install_media_detect_rename_target_file_exists + +- _Type:_ `str` +- _Default:_ `skip` + +If there are two files of the same RAR or ZIP type, one with and one without suffix, the following parameter will determine what the role will do for such a file: `skip` the file renaming, `fail`, or `overwrite` the file with the suffix by the file without suffix + +### sap_install_media_detect_extract_archives + +- _Type:_ `bool` +- _Default:_ `True` + +If you want the role to not extract archives which have the extract flag set, set the following parameter to `false`. + +### sap_install_media_detect_move_or_copy_archives + +- _Type:_ `bool` +- _Default:_ `True` + +If you want the role to not move or copy archive files to the `target_dir` subdirectories, set the following parameter to `false`. + +### sap_install_media_detect_assert_after_sapfile + +- _Type:_ `bool` +- _Default:_ `True` + +By default, the presence of at least one file for each file type according to the configured role parameters is asserted. Set the following parameter to 'false' to skip this step. + +### sap_install_media_detect_db + +- _Type:_ `str` + +Select which database type to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` + +### sap_install_media_detect_db_client + +- _Type:_ `str` + +Select which database client to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` + +### sap_install_media_detect_swpm + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SWPM. + +### sap_install_media_detect_hostagent + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Hostagent. + +### sap_install_media_detect_igs + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP IGS. + +### sap_install_media_detect_kernel + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Kernel files. + +### sap_install_media_detect_kernel_db + +- _Type:_ `str` + +Select which database kernel to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2`
\ No newline at end of file diff --git a/roles/sap_install_media_detect/README.md b/roles/sap_install_media_detect/README.md index 23dfaa60c..45e739bd6 100644 --- a/roles/sap_install_media_detect/README.md +++ b/roles/sap_install_media_detect/README.md @@ -1,48 +1,104 @@ + # sap_install_media_detect Ansible Role - -Ansible Role for detection and extraction of SAP Software installation media - -This role is used to prepare for installation of SAP Software, by searching a given directory for SAP installation media (e.g. SAR files), -moving files to subdirectories (i.e. `/sap_hana` and `/sap_swpm`) with the directory/file ownership permissions, then extracting the detected files. - -Detection of installation media is available for SAP HANA and the various key installation files when using SAP SWPM to install -SAP Business Applications based upon SAP NetWeaver (e.g. SAP S/4HANA, SAP BW/4HANA, SAP ECC, SAP BW, SAP WebDispatcher etc). -As an example, SAP HANA Client would be detected and the SAP Kernel Part I/II would be detected. - -Once detection (e.g. using `zipinfo -1` and `unrar lb`) and extraction are completed, the file paths are shown and stored as variables for subsequent use by other Ansible Tasks. - -RAR files can be either handled by the unar package from EPEL or by another package which can list the contents of, and extract files from, -RAR files. See the comments and examples for the RAR file handling in `defaults/main.yml`. If the EPEL repo had been enabled at the time -when the role was run, it will remain enabled. If the EPEL repo was not present, the associated GPG key will be removed and the EPEL repo -will be disabled as the last task. - -## Execution Flow - -- At the beginning of the execution of the role, a new tool `sapfile` is pushed to a temporary directory on the managed node. -- Also a package which contains a command for extracting and listing content of files of type `RAR` is installed. -- The next step is to check if source and/or target directories exist. If role parameter `sap_install_media_detect_target_directory` is defined, files will later be copied from `sap_install_media_detect_source_directory`. This is the `remote_dir` case. -- If the system on which the `sap_install_media_detect_source_directory` is not writable, the role would normally fail because one or both of the following conditions are not met: - - The SAPCAR EXE file is not executable. - - There are one or more `ZIP` or `RAR` files without extension. -- In this `remote_dir` case, to make sure the role does not fail, it needs to be run first on the node on which `sap_install_media_detect_source_directory` is writable, with role parameter `sap_install_media_detect_file_server_only` set to `true` so the role will not perform and further file detection activities. -- After the SAPCAR EXE file is executable and there are no more `ZIP` or `RAR` files without extension, the role can be called on a managed node where `sap_install_media_detect_source_directory` is not writable. -- A new list of all files with the correct final file names will then be created, and for each of the files, the SAP file types are determined using the `sapfile` tool, either using the file names or - if this information is not sufficient - from information inside the file. -- We then assert that there is at least (or exactly, depending on the file type) one file available for each of the `sap_install_media_detect_*` parameters. For example, if `sap_install_media_detect_kernel_db` is set to `saphana`, then there must be one SAP Kernel DB dependent file for SAP HANA. -- In case of `remote_dir`, the next step is to copy all files from `sap_install_media_detect_source_directory` to `sap_install_media_detect_target_directory`. -- Then we extract files which are configured in `sapfile` to be extracted, and copy or move files which are configured in `sapfile` to be copied or moved. Certain files like `SAPCAR*.EXE` and the SAP Host Agent will be copied to two different directories. -- Once all necessary files have been extracted and all files are copied or moved to where we want them to be, we are using the Ansible find module to identify the different file types by using file or directory name patterns. -- The last step is to fill all required `sap_swpm` parameters from the result of the previous find step, and display all the variables. - -## Variables and Parameters - -See the file `defaults/main.yml`. - -## Dependencies - -This role does not depend on any other Ansible Role. - -## Tags - + +![Ansible Lint for sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_install_media_detect.yml/badge.svg) + +## Description + +Ansible Role `sap_install_media_detect` is used to detect and extract SAP installation media. + +This role searches provided source directory, sorts files based on type and extracts them to target directory. Extraction can be further adjusted to create individual folders based on defined inputs. + +Detection of supported installation media is available for SAP HANA and wide range of SAP Applications (example: SAP S/4HANA, SAP BW/4HANA, SAP ECC, SAP BW, SAP WebDispatcher, SAP Business Applications based upon SAP NetWeaver, etc). + + + + + + +## Prerequisites +Managed nodes: +- Directory with SAP Installation media is present and `sap_install_media_detect_source_directory` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. + + +## Execution + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+#### SAP HANA +1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) +3. *`sap_install_media_detect`* +4. [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) +5. [sap_ha_install_hana_hsr](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_install_hana_hsr) - High Availability specific +6. [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) - High Availability specific + +#### SAP Netweaver +1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) +3. *`sap_install_media_detect`* +4. [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) +5. [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) - High Availability specific + + +### Execution Flow + +1. At the beginning of the execution of the role, a new tool `sapfile` is pushed to a temporary directory on the managed node. +2. Also a package which contains a command for extracting and listing content of files of type `RAR` is installed. +3. The next step is to check if source and/or target directories exist. If role parameter `sap_install_media_detect_target_directory` is defined, files will later be copied from `sap_install_media_detect_source_directory`. This is the `remote_dir` case. +4. If the system on which the `sap_install_media_detect_source_directory` is not writable, the role would normally fail because one or both of the following conditions are not met: + - The SAPCAR EXE file is not executable. + - There are one or more `ZIP` or `RAR` files without extension. +5. In this `remote_dir` case, to make sure the role does not fail, it needs to be run first on the node on which `sap_install_media_detect_source_directory` is writable, with role parameter `sap_install_media_detect_file_server_only` set to `true` so the role will not perform and further file detection activities. +6. After the SAPCAR EXE file is executable and there are no more `ZIP` or `RAR` files without extension, the role can be called on a managed node where `sap_install_media_detect_source_directory` is not writable. +7. A new list of all files with the correct final file names will then be created, and for each of the files, the SAP file types are determined using the `sapfile` tool, either using the file names or - if this information is not sufficient - from information inside the file. +8. We then assert that there is at least (or exactly, depending on the file type) one file available for each of the `sap_install_media_detect_*` parameters. For example, if `sap_install_media_detect_kernel_db` is set to `saphana`, then there must be one SAP Kernel DB dependent file for SAP HANA. +9. In case of `remote_dir`, the next step is to copy all files from `sap_install_media_detect_source_directory` to `sap_install_media_detect_target_directory`. +10. Then we extract files which are configured in `sapfile` to be extracted, and copy or move files which are configured in `sapfile` to be copied or moved. Certain files like `SAPCAR*.EXE` and the SAP Host Agent will be copied to two different directories. +11. Once all necessary files have been extracted and all files are copied or moved to where we want them to be, we are using the Ansible find module to identify the different file types by using file or directory name patterns. +12. The last step is to fill all required `sap_swpm` parameters from the result of the previous find step, and display all the variables. + - Once detection (e.g. using `zipinfo -1` and `unrar lb`) and extraction are completed, the file paths are shown and stored as variables for subsequent use by other Ansible Tasks. + +
+ (Red Hat) Additional steps for RAR files + + RAR files can be either handled by the unar package from EPEL or by another package which can list the contents of, and extract files from, RAR files. See the comments and examples for the RAR file handling in `defaults/main.yml`. + + - If the EPEL repo had been enabled at the time when the role was run, it will remain enabled. + - If the EPEL repo was not present, the associated GPG key will be removed and the EPEL repo will be disabled as the last task. +
+ + +### Example + +Example playbook to extract SAP Installation media for SAP ASCS Netweaver. +```yaml +--- +- name: Ansible Play for SAP NetWeaver ASCS - Extract SAP Installation media + hosts: nwas_ascs + become: true + any_errors_fatal: true + max_fail_percentage: 0 + tasks: + + - name: Execute Ansible Role sap_install_media_detect + ansible.builtin.include_role: + name: community.sap_install.sap_install_media_detect + vars: + sap_install_media_detect_swpm: true + sap_install_media_detect_hostagent: true + sap_install_media_detect_igs: true + sap_install_media_detect_kernel: true + sap_install_media_detect_webdisp: false +``` + + + +### Role Tags With the following tags, the role can be called to perform certain activities only: - tag `sap_install_media_detect_zip_handling`: Only perform the task for enabling the listing and extracting of files of type `ZIP`. - tag `sap_install_media_detect_rar_handling`: Only perform the tasks for enabling the listing and extracting of files of type `RAR`. This @@ -59,11 +115,20 @@ With the following tags, the role can be called to perform certain activities on Note: After running the role with the following four tags, the SAP archive files will be in the same place as before running the role the first time. The directories with pattern `*_extracted` will remain in place. `sap_install_media_detect_provide_sapfile_utility,sap_install_media_detect_check_directories,sap_install_media_detect_create_file_list_phase_1,sap_install_media_detect_move_files_to_main_directory` + -## License + + -Apache license 2.0 +## License + +Apache 2.0 + -## Author Information +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) + -IBM Lab for SAP Solutions, Red Hat for SAP Community of Practice, Bernd Finger +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_install_media_detect/INPUT_PARAMETERS.md) diff --git a/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md b/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md new file mode 100644 index 000000000..959447a1f --- /dev/null +++ b/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md @@ -0,0 +1,78 @@ +## Input Parameters for sap_maintain_etc_hosts Ansible Role + + +This role requires the dictionary `sap_maintain_etc_hosts_list` which contains the parameters for the `/etc/hosts` file. + +The default value is the definition of the cluster nodes like in the role [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster). If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined, then the role creates a default value from `ansible_facts`. + +**NOTE: If you want to use this role to remove entries from /etc/hosts it is a good practice to do this before adding entries. The adding/removal is done in the order the entries are listed.** + +### sap_maintain_etc_hosts_list + +- _Type:_ `list` with elements of type `dict` + +Mandatory list of nodes in form of dictionaries to be added or removed in `/etc/hosts` file. + +Following dictionary keys can be defined: +- **node_ip**
+ IP address of the managed node.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, where `node_name` and `node_domain` can be used instead. + + - _Type:_ `string` + +- **node_name**
+ Hostname of the managed node.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, when `node_ip` is not used. + + - _Type:_ `string` + +- **node_domain**
+ Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_domain`.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, when `node_name` is used. + + - _Type:_ `string` + - _Default:_ `sap_domain` + +- **aliases**
+ List of aliases for the managed node.
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `list` with elements of type `string` + +- **alias_mode**
+ Select method of updating `/etc/hosts` file:
+ - `merge` : merges the list of aliases with the exiting aliases of the node.
+ - `overwrite` : overwrites the aliases of the node. + _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + - _Default:_ `merge` + +- **node_comment**
+ Node comment is appended at end of line of managed node.
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + - _Default:_ `managed by ansible sap_maintain_etc_hosts role` + +- **hana_site**
+ Used by [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) and it is appended to `node_comment`
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + +- **node_role**
+ Not used, but mentioned for compatibility reasons for [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role.
+ + - _Type:_ `string` + +- **state**
+ Select `present` for adding new entries, `absent` for removing them.
+ **Required** for removing entries, otherwise default `present` is used. + + - _Type:_ `string` + - _Default:_ `present` + \ No newline at end of file diff --git a/roles/sap_maintain_etc_hosts/README.md b/roles/sap_maintain_etc_hosts/README.md index 98fab9adf..e822ae55e 100644 --- a/roles/sap_maintain_etc_hosts/README.md +++ b/roles/sap_maintain_etc_hosts/README.md @@ -1,142 +1,92 @@ -# Role Name: sap_maintain_etc_hosts - -This role can be used to reliably update the /etc/hosts file. - - - -## Role Input Parameters - -This role requires the dictionary `sap_maintain_etc_hosts_list` which contains the parameters for the hostfile. The default value is the definition of the cluster nodes like in the role `sap_ha_pacemaker_cluster`. If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined the role creates a default value from `ansible_facts`. - -Caution: If you want to use this role to remove entries from /etc/hosts it is a good practise to do this before adding entries. The adding/removal is done in the order the entries are listed. - -### sap_maintain_etc_hosts_list - -- _Type:_ `list` - - List of nodes to be added or removed in /etc/hosts - possible list options: - -#### node_ip - -- _Type:_ `string` - - IP address of the node. - It is required for adding a node. - When deleting a node use only when node_name and node_domain are not defined - -#### node_name - -- _Type:_ `string` - - Hostname of the node - It is required for adding a node. - When deleting a node use only when node_ip is not defined - -#### node_domain - -- _Type:_ `string` - - Domainname of the node - Defaults to sap_domain, if set, otherwise ansible_domain is the default - When deleting a node use only when node_name is defined - -#### aliases - -- _Type:_ `list` - - List of aliases for the node - Not used when state is absent - -#### alias_mode - -- _Type:_ `string` - - Options: - - - `merge` : merges the list of aliases with the exiting aliases of the node. (default) - - `overwrite` : overwrites the aliases of the node. - - Not used when state is absent - -#### node_comment - -- _Type:_ `string` - - default: managed by ansible sap_maintain_etc_hosts role` - String which is appended to line in hosts after comment string - Not used when state is absent - -#### hana_site - -- _Type:_ `string` - - if set (e.g. for configuring cluster) it is appended to the comment - Not used when state is absent - -#### node_role - - Not used. For compatibility reason only. - -#### state - -- _Type:_ `string` - - Options: - - - `present` : creates a host entry (default)` - - `absent` : removes a host entry by ip or hostname - - - -Example Playbook ----------------- - -If you want to setup/add entries your etc hosts you can use this snippet - -```[yaml] -- name: Ensure /etc/hosts is updated - include_role: sap_sap_maintain_etc_hosts - var: + +# sap_maintain_etc_hosts Ansible Role + + +## Description + +Ansible Role `sap_maintain_etc_hosts` is used to maintain `/etc/hosts` file. + + + + + + + + +## Execution + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Verify duplicate entries and conflicts; +3. Update `/etc/hosts` file. + + +### Example + +Example playbook will update `/etc/hosts`: +- Remove node with IP `10.10.10.10`. +- Remove node with name `host2`. +- Add node with IP `10.10.10.11`, name `host1`, aliases `alias1, alias2` and comment `host1 comment`. +```yaml +- name: Ansible Play for add entry in /etc/hosts + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_sap_maintain_etc_hosts + ansible.builtin.include_role: + name: community.sap_install.sap_sap_maintain_etc_hosts + vars: sap_maintain_etc_hosts_list: - - node_ip: 1.2.3.5 - state: absent - - node_name: host2 - state: absent - - node_ip: 1.2.3.4 - node_name: host1 - aliases: - - alias1 - - anotheralias2 - node_comment: "Here comes text after hashsign" (defaults to hana_site) - state: present + - node_ip: 10.10.10.10 + state: absent + - node_name: host2 + state: absent + - node_ip: 10.10.10.11 + node_name: host1 + aliases: + - alias1 + - alias2 + node_comment: "host1 comment" # Comment is created after hash sign (defaults to hana_site) + state: present ``` -If you have defined a cluster and the variable `sap_ha_pacemaker_cluster_cluster_nodes` or `sap_hana_cluster_nodes` is set, you can use the following play: - -```[yaml] -- name: ensure all cluster nodes are in /etc/hosts - include_role: sap_maintain_etc_hosts - var: - sap_maintain_etc_hosts_list: "{{ sap_hana_cluster_nodes }}" +Example playbook when executed together with [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role which uses either `sap_ha_pacemaker_cluster_cluster_nodes` or `sap_hana_cluster_nodes`. +```yaml +- name: Ansible Play for add entry in /etc/hosts + hosts: all + become: true + tasks: + - name: Execute Ansible Role sap_sap_maintain_etc_hosts + ansible.builtin.include_role: + name: community.sap_install.sap_sap_maintain_etc_hosts + vars: + sap_maintain_etc_hosts_list: "{{ sap_ha_pacemaker_cluster_cluster_nodes }}" ``` + -License -------- + + -Apache-2.0 + + -Author Information ------------------- +## License + +Apache 2.0 + -@rhmk 10/10/23 +## Maintainers + +- [Markus Koch](https://github.com/rhmk) +- [Bernd Finger](https://github.com/berndfinger) + + +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_sap_maintain_etc_hosts/INPUT_PARAMETERS.md) diff --git a/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md b/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md new file mode 100644 index 000000000..bdaf4cdf6 --- /dev/null +++ b/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md @@ -0,0 +1,92 @@ +## Input Parameters for sap_netweaver_preconfigure Ansible Role + +## Role Input Parameters + +Minimum required parameters: +This role does not require any parameter to be set in the playbook or inventory. + + +### sap_netweaver_preconfigure_config_all +- _Type:_ `bool` +- _Default:_ `true` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_netweaver_preconfigure_installation +- _Type:_ `bool` +- _Default:_ `false` + +If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_netweaver_preconfigure_configuration +- _Type:_ `bool` +- _Default:_ `false` + +If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes.
+ +### sap_netweaver_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_netweaver_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_netweaver_preconfigure_min_swap_space_mb +- _Type:_ `str` +- _Default:_ `20480` + +Specifies the minimum amount of swap space on the system required by SAP NetWeaver.
+If this requirement is not met, the role will abort.
+Set your own value to override the default of `20480`.
+ +### sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured +- _Type:_ `bool` +- _Default:_ `true` + +If the system does not have the minimum amount of swap space configured as defined
+in parameter `sap_netweaver_preconfigure_min_swap_space_mb`, the role will abort.
+By setting this parameter to `false`, the role will not abort in such cases.
+ +### sap_netweaver_preconfigure_rpath +- _Type:_ `str` +- _Default:_ `/usr/sap/lib` + +Specifies the SAP kernel's `RPATH`. This is where the SAP kernel is searching for libraries, and where the role
+is creating a link named `libstdc++.so.6` pointing to `/opt/rh/SAP/lib64/compat-sap-c++-10.so`,
+so that newer SAP kernels which are built with GCC10 can find the required symbols.
+ +### sap_netweaver_preconfigure_use_adobe_doc_services +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` when using Adobe Document Services, to ensure all required packages are installed.
+ +### sap_netweaver_preconfigure_saptune_version +- _Type:_ `str` +- _Default:_ `3.0.2` + +On SLES systems, specifies the saptune version
+ +### sap_netweaver_preconfigure_saptune_solution +- _Type:_ `str` +- _Default:_ `NETWEAVER` +- _Possible Values:_
+ - `NETWEAVER` + - `NETWEAVER+HANA` + - `S4HANA-APP+DB` + - `S4HANA-APPSERVER` + - `S4HANA-DBSERVER` + +On SLES systems, specifies the saptune solution to apply.
+ + \ No newline at end of file diff --git a/roles/sap_netweaver_preconfigure/README.md b/roles/sap_netweaver_preconfigure/README.md index ae666ccd8..4375bfeca 100644 --- a/roles/sap_netweaver_preconfigure/README.md +++ b/roles/sap_netweaver_preconfigure/README.md @@ -1,191 +1,84 @@ + # sap_netweaver_preconfigure Ansible Role - -This role installs additional required packages and performs additional configuration steps for installing and running SAP NetWeaver. -If you want to configure a RHEL system for the installation and later usage of SAP NetWeaver, you have to first run role `sap_general_preconfigure` and then role sap_netweaver_preconfigure. -For SLES, running the `sap_general_preconfigure` role is not necessary. - -## Requirements - -To use this role, your system needs to be configured with the basic requirements for SAP NetWeaver or SAP HANA. This is typically done by -running role sap_general_preconfigure (for RHEL managed nodes before RHEL 7.6, community maintained role sap-base-settings can be used). -It is also strongly recommended to run role linux-system-roles.timesync for all systems running SAP NetWeaver, to maintain an identical -system time, before or after running role sap_netweaver_preconfigure. - -Note ----- -On RHEL, as per SAP notes 2002167, 2772999, and 3108316, the role will switch to tuned profile sap-netweaver no matter if another tuned profile -(e.g. virtual-guest) had been active before or not. - -On SLES, this role will switch the saptune solution to the one specified by the configuration and will override any previously set solution. -The default solution is `NETWEAVER`. - -The role can check if enough swap space - as per the prerequisite checker in sapinst - has been configured on the managed node. -Please check the SAP NetWeaver installation guide for swap space requirements. - -Do not run this role against an SAP NetWeaver or other production system. The role will enforce a certain configuration on the managed -node(s), which might not be intended. - - -## Role Input Parameters - -Minimum required parameters: -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_netweaver_preconfigure_config_all -- _Type:_ `bool` -- _Default:_ `true` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_netweaver_preconfigure_installation -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_netweaver_preconfigure_configuration -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes.
- -### sap_netweaver_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_netweaver_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_netweaver_preconfigure_min_swap_space_mb -- _Type:_ `str` -- _Default:_ `20480` - -Specifies the minimum amount of swap space on the system required by SAP NetWeaver.
-If this requirement is not met, the role will abort.
-Set your own value to override the default of `20480`.
- -### sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured -- _Type:_ `bool` -- _Default:_ `true` - -If the system does not have the minimum amount of swap space configured as defined
-in parameter `sap_netweaver_preconfigure_min_swap_space_mb`, the role will abort.
-By setting this parameter to `false`, the role will not abort in such cases.
- -### sap_netweaver_preconfigure_rpath -- _Type:_ `str` -- _Default:_ `/usr/sap/lib` - -Specifies the SAP kernel's `RPATH`. This is where the SAP kernel is searching for libraries, and where the role
-is creating a link named `libstdc++.so.6` pointing to `/opt/rh/SAP/lib64/compat-sap-c++-10.so`,
-so that newer SAP kernels which are built with GCC10 can find the required symbols.
- -### sap_netweaver_preconfigure_use_adobe_doc_services -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` when using Adobe Document Services, to ensure all required packages are installed.
- -### sap_netweaver_preconfigure_saptune_version -- _Type:_ `str` -- _Default:_ `3.0.2` - -On SLES systems, specifies the saptune version
- -### sap_netweaver_preconfigure_saptune_solution -- _Type:_ `str` -- _Default:_ `NETWEAVER` -- _Possible Values:_
- - `NETWEAVER` - - `NETWEAVER+HANA` - - `S4HANA-APP+DB` - - `S4HANA-APPSERVER` - - `S4HANA-DBSERVER` - -On SLES systems, specifies the saptune solution to apply.
- - - -## Example Playbook - -Simple playbook, named sap+netweaver.yml: -```yaml ---- -- hosts: all - roles: - - role: sap_general_preconfigure - - role: sap_netweaver_preconfigure -``` - -Simple playbook for an extended check (assert) run, named sap+netweaver-assert.yml: + + +## Description + +Ansible Role `sap_netweaver_preconfigure` is used to ensure that Managed nodes are configured to host SAP Netweaver systems according to SAP Notes after [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) role was executed. + +This role performs installation of required packages for running SAP Netweaver systems and configuration of Operating system parameters. + + + + + + +## Prerequisites +Managed nodes: +- Ensure that general operating system configuration for SAP is performed by [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure). See [Recommended](#recommended) section. + + +## Execution + +**:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** + +**NOTE: It is recommended to execute `timesync` role from Ansible Collection `fedora.linux_system_roles` before or after executing this role.** + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + + + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. *`sap_netweaver_preconfigure`* + + +### Execution Flow + +1. Assert that required inputs were provided. +2. Install required packages +3. Apply configurations + - Execute configuration tasks based on SAP Notes + - (SUSE) Execute saptune with solution `sap_netweaver_preconfigure_saptune_solution` (Default: `NETWEAVER`) + +**Note: (Red Hat) Due to SAP notes 2002167, 2772999, and 3108316, the role will switch to tuned profile sap-netweaver no matter if another tuned profile (e.g. virtual-guest) had been active before or not.** + + +### Example + +Example of execution together with prerequisite role [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) ```yaml --- -- hosts: all - vars: - sap_preconfigure_assert: yes - sap_preconfigure_assert_ignore_errors: yes - sap_netweaver_preconfigure_assert: yes - sap_netweaver_preconfigure_assert_ignore_errors: yes - roles: - - role: sap_general_preconfigure - - role: sap_netweaver_preconfigure +- name: Ansible Play for SAP Netweaver preconfigure + hosts: nwas_ascs, nwas_ers + become: true + tasks: + - name: Execute Ansible Role sap_general_preconfigure + ansible.builtin.include_role: + name: community.sap_install.sap_general_preconfigure + + - name: Execute Ansible Role sap_netweaver_preconfigure + ansible.builtin.include_role: + name: community.sap_install.sap_netweaver_preconfigure ``` + -## Example Usage -Normal run, for configuring server host_1 for SAP NetWeaver: -```yaml -ansible-playbook sap+netweaver.yml -l host_1 -``` + + -Extended Check (assert) run, not aborting if an error has been found: -```yaml -ansible-playbook sap+netweaver-assert.yml -l host_1 -``` - -Same as above, with a nice compact and colored output, this time for two hosts: -```yaml -ansible-playbook sap+netweaver-assert.yml -l host_1,host_2 | -awk '{sub (" \"msg\": ", "")} - /TASK/{task_line=$0} - /fatal:/{fatal_line=$0; nfatal[host]++} - /...ignoring/{nfatal[host]--; if (nfatal[host]<0) nfatal[host]=0} - /^[a-z]/&&/: \[/{gsub ("\\[", ""); gsub ("]", ""); gsub (":", ""); host=$2} - /SAP note/{print "\033[30m[" host"] "$0} - /FAIL:/{nfail[host]++; print "\033[31m[" host"] "$0} - /WARN:/{nwarn[host]++; print "\033[33m[" host"] "$0} - /PASS:/{npass[host]++; print "\033[32m[" host"] "$0} - /INFO:/{print "\033[34m[" host"] "$0} - /changed/&&/unreachable/{print "\033[30m[" host"] "$0} - END{print ("---"); for (var in npass) {printf ("[%s] ", var); if (nfatal[var]>0) { - printf ("\033[31mFATAL ERROR!!! Playbook might have been aborted!!!\033[30m Last TASK and fatal output:\n"); print task_line, fatal_line - } - else printf ("\033[31mFAIL: %d \033[33mWARN: %d \033[32mPASS: %d\033[30m\n", nfail[var], nwarn[var], npass[var])}}' -``` -Note: For terminals with dark background, replace the color code `30m` by `37m`. -In case you need to make an invisible font readable on a terminal with dark background, run the following command in the terminal: -```yaml -printf "\033[37mreadable font\n" -``` -In case you need to make an invisible font readable on a terminal with bright background, run the following command in the terminal: -```yaml -printf "\033[30mreadable font\n" -``` + + ## License + +Apache 2.0 + -Apache license 2.0 - -## Author Information +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) + -Red Hat for SAP Community of Practice, Bernd Finger, Rainer Leber +## Role Input Parameters +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md) diff --git a/roles/sap_storage_setup/INPUT_PARAMETERS.md b/roles/sap_storage_setup/INPUT_PARAMETERS.md new file mode 100644 index 000000000..f4de99ad2 --- /dev/null +++ b/roles/sap_storage_setup/INPUT_PARAMETERS.md @@ -0,0 +1,140 @@ + +## Input Parameters for sap_netweaver_preconfigure Ansible Role + + +Minimum required parameters: + +- [sap_storage_setup_definition](#sap_storage_setup_definition-required) +- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) +- [sap_storage_setup_sid](#sap_storage_setup_sid-required) + + +### sap_storage_setup_definition required + +- _Type:_ `list` + +Describes list of the filesystems to be configured.
+ +- **disk_size**
+ Size of the disk device that is used for the filesystem.
For filesystems with no LVM logical volume striping, this is the total size of the filesystem.
For filesystems with LVM LV striping defined (`lvm_lv_stripes`), this is the size of each disk. The resulting filesystem size will be `disk_size` multiplied by `lvm_lv_stripes` (=disks). + + - _Type:_ `int` + +- **filesystem_type**
+ The type of filesystem that will be created on the logical volume. + + - _Type:_ `str` + - _Default:_ `xfs` + +- **lvm_lv_name**
+ The name of the LVM volume.
The default name is derived from the name value of the filesystem definition entry, for example 'lv_hanalog'. + + - _Type:_ `str` + +- **lvm_lv_stripe_size**
+ When setting up a striped volume, the stripe size can be defined.
Example format - "128K". + + - _Type:_ `str` + +- **lvm_lv_stripes**
+ Number of disks that will be configured in a striped volume.
This requires the availability of the same amount of unused disks, which must be of the size defined in `disk_size`. + + - _Type:_ `int` + _Default:_ `1` + +- **lvm_vg_name**
+ The name of the LVM volume group.
The default name is derived from the name value of the filesystem definition entry, for example 'vg_hanalog'. + + - _Type:_ `str` + +- **lvm_vg_physical_extent_size**
+ Adjustable size of the physical extents of the volume group in LVM. + + - _Type:_ `int` + - _Default:_ `4` + +- **mountpoint**
+ The path to where the filesystem will be mounted.
This can be left out for the definition of a swap volume. + + - _Type:_ `str` + +- **name**
+ A name of the filesystem definition entry.
This name is used to generate volume group name and logical volume name. + + - _Type:_ `str` + +- **nfs_filesystem_type**
+ The type of the NFS filesystem, for example `nfs`, `nfs4`. + + - _Type:_ `str` + - _Default:_ `nfs4` + +- **nfs_mount_options**
+ Mount options to use for the NFS mount.
Generic default is `hard,acl`.
Defaults depend on the specific platform detected by the role or defined explicitly. + + - _Type:_ `str` + - _Default:_ `hard,acl` + +- **nfs_path**
+ When defining an NFS filesystem, this is the directory path of the filesystem to be mounted. + + - _Type:_ `str` + +- **nfs_server**
+ When defining an NFS filesystem, this is the address of the NFS server.
The address must contain the root path, in which the mount directories exist or will be created.
For example, `192.168.1.100:/`. + + - _Type:_ `str` + +- **swap_path**
+ The path to the swap file.
When this option is defined for a swap filesystem definition, it will create a swap file on an existing filesystem. + + - _Type:_ `str` + +Example: + +```yaml +sap_storage_setup_definition: + + # Block Storage volume + - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name + mountpoint: /hana/data # required: string, directory path where the filesystem is mounted + disk_size: 100 # required: integer, size in GB + filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem + + # File Storage volume + - name: hana_shared # required: string, reference name + mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted + nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server + + # Swap as file instead of Block Storage volume + # See SAP Note 1597355 - Swap-space recommendation for Linux + - name: swap # required: string, reference name + swap_path: /swapfile # required: string, directory path where swap file is created + disk_size: 4 # required: integer, size in GB of swap file + filesystem_type: swap # required: string, must be value 'swap' +``` + +### sap_storage_setup_host_type required + +- _Type:_ `list` + +The type of service the target system is going to be configured for.
+This can be a list of multiple types which apply to a single host.
+If not defined, the default will be inherited from the global parameter `sap_host_type`. One of these parameters must be defined.
+Available values: `hana_primary`, `hana_secondary`, `nwas_abap_ascs`, `nwas_abap_ers`, `nwas_abap_pas`, `nwas_abap_aas`, `nwas_java_scs`, `nwas_java_ers` + +### sap_storage_setup_multipath_enable_and_detect + +- _Type:_ `bool` +- _Default:_ `False` + +Define if multipathing should be enabled and dynamic multipath devices detected and used for the filesystem setup.
+ +### sap_storage_setup_sid required + +- _Type:_ `str` + +SID of the SAP service.
+If not defined, the default will be inherited from the global parameter `sap_system_sid`. One of these parameters must be defined.
+ + \ No newline at end of file diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index d5e5ff23c..55231f601 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -1,161 +1,126 @@ + # sap_storage_setup Ansible Role + +![Ansible Lint for sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_storage_setup.yml/badge.svg) -Ansible Role for preparing a host with the storage requirements of an SAP System (prior to software installation) +## Description + +Ansible Role `sap_storage_setup` is used to prepare a host with the storage requirements of an SAP System (prior to software installation). -## Scope - -This Ansible Role provides: -- local/block storage volumes setup as LVM Logical Volumes, Filesystem formatting and mount to defined directory path -- remote/file storage mount (and subdirectories as required) -- swap file or swap partition - -This Ansible Role has been tested for the following SAP software deployment types: -- SAP HANA Scale-up, Scale-out and Scale-up High Availability -- SAP NetWeaver AS in Sandbox (Two-Tier/OneHost), Standard (Three-Tier/DualHost), Distributed (Multi-Tier) and Distributed High Availability +This role can prepare host with: +- Local block storage volume setup as LVM Logical Volumes, Filesystem formatting and mount to defined directory path +- Remote file storage mount (and subdirectories as required) +- SWAP file or SWAP partition This Ansible Role is agnostic, and will run on any Infrastructure Platform. Only LVM is used for local/block storage, to allow for further expansion if the SAP System requires further storage space in the future. - -Please note, while this Ansible Role has protection against overwrite of existing disks and filesystems - sensible review and care is required for any automation of disk storage. Please review the documentation and samples/examples carefully. It is strongly suggested to initially execute the Ansible Playbook calling this Ansible Role, with `ansible-playbook --check` for Check Mode - this will perform no changes to the host and show which changes would be made. - -In addition, this Ansible Role: - -- Does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. -- Enforces 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). - - For granular control of LVM setup, the suggestion is to instead use Ansible Role `storage` from the `fedora.linux_system_roles` Ansible Collection or the Ansible Roles `lvg/lvol/filesystem` from `community.general` Ansible Collection - - -## Requirements - -The Ansible Role requires the `community.general` Ansible Collection (uses the `lvg`, `lvol` and `filesystem` Ansible Modules). - -Before using this Ansible Role, please make sure that the required collections are installed; for example, by using the command `ansible-galaxy install community.general` - + + + +## Dependencies +- `community.general` + - Modules: + - `lvg` + - `lvol` + - `filesystem` +Install required collection by `ansible-galaxy install community.general`. + + + ## Prerequisites +Managed nodes: +- All local/block storage volumes must be attached to the host +- All remote/file storage mounts must be available with host accessibility (e.g. port 2049). + + +## Execution + +**:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.**
+:warning: While this Ansible Role has protection against overwrite of existing disks and filesystems - sensible review and care is required for any automation of disk storage. Please review the documentation and samples/examples carefully. It is strongly suggested to initially execute the Ansible Playbook calling this Ansible Role, with `ansible-playbook --check` for Check Mode - this will perform no changes to the host and show which changes would be made. + +Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + +**Considerations** +- This role does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. +- This role enforces that 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). + - Following roles and modules offer alternative for more granular control of LVM setup: + - Role `storage` from [fedora.linux_system_roles](https://github.com/linux-system-roles/storage) + - Modules `filesystem`, `lvg`, `lvol` from [community.general](https://galaxy.ansible.com/ui/repo/published/community/general/) + + + + + +### Execution Flow + +1. Gather facts about hosts. +2. Create list of unused disk devices +3. Match/Map unused disk devices to the `sap_storage_setup_definition` +4. Create LVM Logical Volumes (and prerequisite LVM Volume Groups and LVM Physical Volumes) +5. Create swap file or swap partition +6. Mount NFS temporarily, create required subdirectories, unmount and mount subdirectory on the NFS share + + + +Example playbook to configure SAP HANA OneHost node on AWS that includes: +- 3 disks for `/hana/data`, `/hana/log` and ` /hana/shared` +- Remote filesystem for `/software` +- SWAP +```yaml +--- +- name: Ansible Play for SAP HANA HA storage setup + hosts: hana_primary + become: true + tasks: + - name: Execute Ansible Role sap_storage_setup + ansible.builtin.include_role: + name: community.sap_install.sap_storage_setup + vars: + sap_storage_setup_sid: "H01" + sap_storage_setup_host_type: "hana_primary" + sap_storage_setup_definition: + - name: hana_data + mountpoint: /hana/data + disk_size: 150 + filesystem_type: xfs + + - name: hana_log + mountpoint: /hana/log + disk_size: 100 + filesystem_type: xfs + + - name: hana_shared + mountpoint: /hana/shared + disk_size: 200 + filesystem_type: xfs + + - name: software + mountpoint: /software + nfs_path: /software + nfs_server: "fs-00000000000000000.efs.eu-central-1.amazonaws.com:/software" + nfs_filesystem_type: "nfs4" + nfs_mount_options: "vers=4.1,hard,timeo=600,retrans=2,acl" + + - name: swap + disk_size: 96 + filesystem_type: swap +``` + -All local/block storage volumes must be attached to the host, and all remote/file storage mounts must be available with host accessibility (e.g. port 2049). - -## Variables and Parameters - -The 3 critical variables are: -- `sap_storage_setup_definition` - a list with a dictionary for each mountpoint (e.g. /hana/data) for the host -- `sap_storage_setup_host_type` - a list which defines SAP Software on the host (e.g. list containing both hana_primary and nwas_abap_ascs values if creating a Sandbox Two-Tier/OneHost) -- `sap_storage_setup_sid` - a string with the SAP System ID of the logical system (e.g. D01) - -## Execution Flow - -The Ansible Role is sequential: -- Get host facts -- Create list of unused disk devices -- Match/Map unused disk devices to the `sap_storage_setup_definition` -- Create LVM Logical Volumes (and prerequisite LVM Volume Groups and LVM Physical Volumes) -- Create swap file or swap partition -- Mount NFS temporarily, create required subdirectories, unmount and mount subdictory on the NFS share - -## Sample + + -Please see a full sample using multiple hosts to create an SAP S/4HANA Distributed deployment in the [/playbooks](../../playbooks/) directory of the Ansible Collection `sap_install`. + + ## License - + Apache 2.0 + -## Author Information - -Red Hat for SAP Community of Practice, Janine Fuchs, IBM Lab for SAP Solutions +## Maintainers + +- [Janine Fuchs](https://github.com/ja9fuchs) + ---- - ## Role Input Parameters - -Minimum required parameters: - -- [sap_storage_setup_definition](#sap_storage_setup_definition-required) -- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) -- [sap_storage_setup_sid](#sap_storage_setup_sid-required) - - -### sap_storage_setup_definition required - -- _Type:_ `list` - -Describes the filesystems to be configured.
- -- **disk_size**
- Size of the disk device that is used for the filesystem.
For filesystems with no LVM logical volume striping, this is the total size of the filesystem.
For filesystems with LVM LV striping defined (`lvm_lv_stripes`), this is the size of each disk. The resulting filesystem size will be `disk_size` multiplied by `lvm_lv_stripes` (=disks). -- **filesystem_type**
- _Default:_ `xfs`
- The type of filesystem that will be created on the logical volume. -- **lvm_lv_name**
- The name of the LVM volume.
The default name is derived from the name value of the filesystem definition entry, for example 'lv_hanalog'. -- **lvm_lv_stripe_size**
- When setting up a striped volume, the stripe size can be defined.
Example format - "128K". -- **lvm_lv_stripes**
- _Default:_ `1`
- Number of disks that will be configured in a striped volume.
This requires the availability of the same amount of unused disks, which must be of the size defined in `disk_size`. -- **lvm_vg_name**
- The name of the LVM volume group.
The default name is derived from the name value of the filesystem definition entry, for example 'vg_hanalog'. -- **lvm_vg_physical_extent_size**
- _Default:_ `4`
- Adjustable size of the physical extents of the volume group in LVM. -- **mountpoint**
- The path to where the filesystem will be mounted.
This can be left out for the definition of a swap volume. -- **name**
- A name of the filesystem definition entry.
This name is used to generate volume group name and logical volume name. -- **nfs_filesystem_type**
- _Default:_ `nfs4`
- The type of the NFS filesystem, for example `nfs`, `nfs4`. -- **nfs_mount_options**
- Mount options to use for the NFS mount.
Generic default is `hard,acl`.
Defaults depend on the specific platform detected by the role or defined explicitly. -- **nfs_path**
- When defining an NFS filesystem, this is the directory path of the filesystem to be mounted. -- **nfs_server**
- When defining an NFS filesystem, this is the address of the NFS server.
The address must contain the root path, in which the mount directories exist or will be created.
For example, `192.168.1.100:/`. -- **swap_path**
- The path to the swap file.
When this option is defined for a swap filesystem definition, it will create a swap file on an existing filesystem. - -Example: - -```yaml -sap_storage_setup_definition: - - # Block Storage volume - - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name - mountpoint: /hana/data # required: string, directory path where the filesystem is mounted - disk_size: 100 # required: integer, size in GB - filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem - - # File Storage volume - - name: hana_shared # required: string, reference name - mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted - nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server - - # Swap as file instead of Block Storage volume - # See SAP Note 1597355 - Swap-space recommendation for Linux - - name: swap # required: string, reference name - swap_path: /swapfile # required: string, directory path where swap file is created - disk_size: 4 # required: integer, size in GB of swap file - filesystem_type: swap # required: string, must be value 'swap' -``` - -### sap_storage_setup_host_type required - - -The type of service the target system is going to be configured for.
-This can be a list of multiple types which apply to a single host.
-If not defined, the default will be inherited from the global parameter `sap_host_type`. One of these parameters must be defined.
- -### sap_storage_setup_multipath_enable_and_detect - -- _Type:_ `bool` -- _Default:_ `False` - -Define if multipathing should be enabled and dynamic multipath devices detected and used for the filesystem setup.
- -### sap_storage_setup_sid required - -- _Type:_ `str` - -SID of the SAP service.
-If not defined, the default will be inherited from the global parameter `sap_system_sid`. One of these parameters must be defined.
- - +All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_storage_setup/INPUT_PARAMETERS.md) From a4ba1005ea9064c165a08c7d61a50e9568368e0a Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 27 Sep 2024 16:26:38 +0200 Subject: [PATCH 166/210] sap_swpm: Adapt README.md to new standard Note: This is WIP. Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 247 +++++++++++++++------------------------ 1 file changed, 97 insertions(+), 150 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 69acdc4da..6d1faf5fa 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -1,51 +1,40 @@ + # sap_swpm Ansible Role - -Ansible role for SAP software installation using SWPM - -## Requirements - -The role requires additional collections which are specified in `meta/collection-requirements.yml`. Before using this role, -make sure that the required collections are installed, for example by using the following command: - -`ansible-galaxy install -vv -r meta/collection-requirements.yml` - -## Scope - -This role has been tested and working for the following scenarios -- One Host Installation -- Dual Host Installation -- Distributed Installation -- System Restore -- High Availability Installation - -This role has been tested and working for the following SAP products -- SAP S/4HANA 1809, 1909, 2020, 2021 -- SAP BW/4HANA -- SAP Solution Manager 7.2 -- SAP Netweaver Business Suite Applications (ECC, GRC, etc) -- SAP Web Dispatcher - -> The general rule is - if the installation uses SAP SWPM then this Ansible Role can be used. - -### SAP Preconfigure - -- Ensure the required volumes and filesystems are configured in the host. You can use the role `sap_storage_setup` to configure this. More info [here](/roles/sap_storage_setup) - -- Please run the RHEL SAP System Role `sap_general_preconfigure` for initial host configuration; as necessary, also use `sap_netweaver_preconfigure` and `sap_hana_preconfigure` - -- For further guidance on using SAP SWPM for different SAP Software installations, please see System Provisioning with Software Provisioning Manager (SWPM) - [User Guides for SAP SWPM 1.0](30839dda13b2485889466316ce5b39e9/c8ed609927fa4e45988200b153ac63d1.html?locale=en-US) and [User Guides for SAP SWPM 2.0](https://help.sap.com/docs/SOFTWARE_PROVISIONING_MANAGER/30839dda13b2485889466316ce5b39e9/6865029dacbe473fadd8eff339bfa568.html?locale=en-US) - -### SAP Software Installation .SAR Files - -1. SAPCAR executable - -2. Software Provisioning Manager .SAR file - - `SWPM*.SAR` - -3. SAP Installation files - - For New Installation - - Download appropriate software from SAP Software Download Center, Maintenance Planner, etc - - For Restore or New Installation + +![Ansible Lint for sap_swpm](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_swpm.yml/badge.svg) + +## Description + +The Ansible role `sap_swpm` installs the SAP ABAP Application Platform (formerly known as SAP NetWeaver) using the SAP Software Provisioning Manager (SWPM). + + + +## Dependencies +- `fedora.linux_system_roles` + - Roles: + - `selinux` + +Install required collections by `ansible-galaxy install -vv -r meta/collection-requirements.yml`. + + +## Prerequisites + +Managed nodes: +- Directory with SAP Installation media is present and `sap_install_media_detect_source_directory` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community). +- Ensure that servers are configured for SAP ABAP Application Platform. See [Recommended](#recommended) section. +- Ensure that volumes and filesystems are configured correctly. See [Recommended](#recommended) section. + +### Prepare SAP ABAP Application Platform installation media +Place a valid SAPCAR executable file in a directory specified by variable `sap_swpm_sapcar_path`, e.g. /software/sapcar. Example: + - SAPCAR_1300-70007716.EXE + +Place the following files in a directory specified by variable `sap_swpm_swpm_path`, e.g. /software/sap_swpm: + - SWPM20SP18_3-80003424.SAR + +Place the following files in a directory specified by variable `sap_swpm_software_path`, e.g. /software/abap_application_platform: + - For a new installation + - Download the appropriate software from SAP Software Download Center, Maintenance Planner, etc + - For a restore or new installation - SAP IGS - `igs*.sar` - SAP IGS HELPER - `igshelper*sar` - SAP Host Agent - `SAPHOSTAGENT*SAR` @@ -53,108 +42,27 @@ This role has been tested and working for the following SAP products - SAP Kernel DB Independent - `SAPEXE_*SAR` - SAP HANA Client - `IMDB_CLIENT*SAR` -4. SAP HANA Database MDC DB Tenant Backup (for restore) - - stored on the local disk of the machine where the SAP HANA database server will reside - - NOTE: Specific media requirements will use format `SAPINST.CD.PACKAGE. = `, and the media names can be discovered by using this command on the SWPM directory `grep -rwh " sap_swpm_inifile_sections_list - -**Previous name**: `sap_swpm_inifile_list`\ -**New name**: `sap_swpm_inifile_sections_list`\ -**Reason**: This variable contains sections of the sapinst input file, `inifile.params`. -The new variable name is reflecting this purpose. - -#### sap_swpm_inifile_custom_values_dictionary -> sap_swpm_inifile_parameters_dict - -**Previous name**: `sap_swpm_inifile_custom_values_dictionary`\ -**New name**: `sap_swpm_inifile_parameters_dict`\ -**Reason**: This variable contains parameter names and values of the -sapinst input file, `inifile.params`. The new variable name is reflecting this purpose. - -#### sap_swpm_inifile_dictionary -> sap_swpm_role_parameters_dict - -**Previous name**: `sap_swpm_inifile_dictionary`\ -**New name**: `sap_swpm_role_parameters_dict`\ -**Reason**: This dictionary contains parameter names and values of the role `sap_swpm`. -The new variable name is reflecting this purpose.\ -**Note**: This variable was only used as a member of `sap_swpm_templates_install_dictionary`, in the -previous `default_templates` mode. - -#### Using sap_swpm_templates_install_dictionary - -The dictionary named `sap_swpm_templates_install_dictionary` can hold all necessary variables -needed by the role `sap_swpm` for different SAP products. See the `Ansible Playbooks for SAP` for examples. - -The role `sap_swpm` defines top level variables from low level members of this dictionary. -The dictionary may contain either the definitions for the previous version of the role -(used in the previous role modes `default_templates` and `advanced_templates`), -or an updated definition of the dictionary containing the new variable names. -The role will fail if both old and new variable names are defined in the dictionary. -Variables on the top level will be overridden by members of `sap_swpm_templates_install_dictionary` with the same name. - -Following is the complete list of conversions of members of the dictionary `sap_swpm_templates_install_dictionary`, where `sap_prod` is an -example entry for `sap_swpm_templates_product_input`: -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_product_catalog_id']` -> `sap_swpm_product_catalog_id` -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_sections_list']` -> `sap_swpm_inifile_sections_list` -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_parameters_dict']` -> `sap_swpm_inifile_parameters_dict` -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_role_parameters_dict']` -> `sap_swpm_role_parameters_dict` -> top level role variables\ - Example: `sap_swpm_install_saphostagent: 'true'` - -Former `default_templates` mode: -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_list']` -> `sap_swpm_inifile_sections_list` -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_dictionary']` -> top level role variables\ - Example: `sap_swpm_install_saphostagent: 'true'` - -Former `advanced_templates` mode: -- `sap_swpm_templates_install_dictionary[sap_prod]['sap_swpm_inifile_custom_values_dictionary']` -> `sap_swpm_inifile_parameters_dict` + ## Execution + + -Sample Ansible Playbook Execution + +### Recommended +It is recommended to execute this role together with other roles in this collection, in the following order:
+1. [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) +2. [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) +3. [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) +4. *`sap_swpm`* -- Local Host Installation - - `ansible-playbook --connection=local --limit localhost -i "localhost," sap-swpm.yml -e "@inputs/S4H.install"` +Note: For most scenarios, a database like SAP HANA must be available. Use the role [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) for installing the SAP HANA database. + -- Target Host Installation - - `ansible-playbook -i "" sap-swpm.yml -e "@inputs/S4H.install"` - -### Sample Playbook - -```yaml ---- -- hosts: all - become: true - roles: - - sap_swpm -``` - -## Execution Flow +### Execution Flow + ### Pre-Install @@ -205,9 +113,44 @@ It is also possible to use method 1 for creating the inifile and then replace or - Set expiry of Unix created users to 'never' - Apply firewall rules for SAP NW (optional - false by default) + -## Tags +### Example + +#### Playbook for installing a Primary Application Server (PAS) instance + +```yaml +--- +- name: Ansible Play for SAP NetWeaver Application Server - Primary Application Server (PAS) + hosts: nwas_pas + become: true + any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts + max_fail_percentage: 0 + tasks: + + - name: Execute Ansible Role sap_install_media_detect + ansible.builtin.include_role: + name: community.sap_install.sap_install_media_detect + vars: + sap_install_media_detect_swpm: true + sap_install_media_detect_hostagent: true + sap_install_media_detect_igs: true + sap_install_media_detect_kernel: true + sap_install_media_detect_webdisp: false + sap_install_media_detect_db_client: "saphana" + + # Install SAP NetWeaver PAS via Ansible Role sap_swpm + - name: Execute Ansible Role sap_swpm + ansible.builtin.include_role: + name: community.sap_install.sap_swpm + vars: + *** TODO: Fill in variables *** +``` + + + +### Role Tags With the following tags, the role can be called to perform certain activities only: - tag `sap_swpm_generate_inifile`: Only create the sapinst inifile, without running most of the preinstall steps. This can be useful for checking if the inifile is created as desired. @@ -215,11 +158,15 @@ With the following tags, the role can be called to perform certain activities on - tag `sap_swpm_pre_install`: Perform all preinstallation steps, then exit. - tag `sap_swpm_setup_firewall`: Only perform the firewall preinstallation settings (but only if variable `sap_swpm_setup_firewall` is set to `true`). - tag `sap_swpm_update_etchosts`: Only update file `/etc/hosts` (but only if variable `sap_swpm_update_etchosts` is set to `true`). +!-- END Role Tags --> ## License - -Apache license 2.0 - -## Author Information - -IBM Lab for SAP Solutions, Red Hat for SAP Community of Practice, Jason Masipiquena, Sean Freeman, Bernd Finger, Markus Koch + +Apache 2.0 + + +## Maintainers + +- [Bernd Finger](https://github.com/berndfinger) +- [Sean Freeman](https://github.com/seanfreeman) + From 0942046f772fcbc8c40ae9cf51258d42384a0958 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 27 Sep 2024 16:35:50 +0200 Subject: [PATCH 167/210] First round of adjustments after review --- .../INPUT_PARAMETERS.md | 91 -- roles/sap_anydb_install_oracle/README.md | 98 +- .../INPUT_PARAMETERS.md | 311 ----- roles/sap_general_preconfigure/README.md | 320 ++++- .../INPUT_PARAMETERS.md | 27 - roles/sap_ha_install_anydb_ibmdb2/README.md | 33 +- .../INPUT_PARAMETERS.md | 90 -- roles/sap_ha_install_hana_hsr/README.md | 96 +- .../INPUT_PARAMETERS.md | 1020 ---------------- roles/sap_ha_pacemaker_cluster/README.md | 1029 ++++++++++++++++- roles/sap_hana_install/INPUT_PARAMETERS.md | 59 - roles/sap_hana_install/README.md | 61 +- .../sap_hana_preconfigure/INPUT_PARAMETERS.md | 324 ------ roles/sap_hana_preconfigure/README.md | 320 ++++- roles/sap_hostagent/INPUT_PARAMETERS.md | 130 --- roles/sap_hostagent/README.md | 138 ++- .../INPUT_PARAMETERS.md | 181 --- roles/sap_install_media_detect/README.md | 196 +++- .../INPUT_PARAMETERS.md | 78 -- roles/sap_maintain_etc_hosts/README.md | 86 +- .../INPUT_PARAMETERS.md | 92 -- roles/sap_netweaver_preconfigure/README.md | 89 +- roles/sap_storage_setup/INPUT_PARAMETERS.md | 140 --- roles/sap_storage_setup/README.md | 146 ++- 24 files changed, 2549 insertions(+), 2606 deletions(-) delete mode 100644 roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md delete mode 100644 roles/sap_general_preconfigure/INPUT_PARAMETERS.md delete mode 100644 roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md delete mode 100644 roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md delete mode 100644 roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md delete mode 100644 roles/sap_hana_install/INPUT_PARAMETERS.md delete mode 100644 roles/sap_hana_preconfigure/INPUT_PARAMETERS.md delete mode 100644 roles/sap_hostagent/INPUT_PARAMETERS.md delete mode 100644 roles/sap_install_media_detect/INPUT_PARAMETERS.md delete mode 100644 roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md delete mode 100644 roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md delete mode 100644 roles/sap_storage_setup/INPUT_PARAMETERS.md diff --git a/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md b/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md deleted file mode 100644 index 70c6424b0..000000000 --- a/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md +++ /dev/null @@ -1,91 +0,0 @@ -## Input Parameters for sap_anydb_install_oracle Ansible Role - - -### sap_anydb_install_oracle_prep_reboot_ok - -- _Type:_ `bool` -- _Default:_ `True` - -Allows reboot of Managed node after packages are installed during pre-steps tasks. - -### sap_anydb_install_oracle_prep_fail_if_reboot_required - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to fail execution if packages are installed during pre-steps tasks, but you don't want to proceed with reboot. - -### sap_anydb_install_oracle_prep_precheck - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to execute installation in Check mode to verify all inputs. This is extra validation and it does not disable installation. - -### sap_anydb_install_oracle_method - -- _Type:_ `string` -- _Default:_ `minimal` - -Select installation method out of available: `minimal` or `responsefile`. - -### sap_anydb_install_oracle_sid: - -- _Type:_ `string` -- _Default:_ `OR1` - -Enter Oracle Database SID. - -### sap_anydb_install_oracle_base - -- _Type:_ `string` -- _Default:_ `/oracle` - -Enter base folder for Oracle Database installation. - -### sap_anydb_install_oracle_filesystem_storage - -- _Type:_ `string` -- _Default:_ `/oradata` - -Enter path for `oracle.install.db.config.starterdb.fileSystemStorage.dataLocation` - -### sap_anydb_install_oracle_inventory_central - -- _Type:_ `string` -- _Default:_ `/oraInventory` - -Enter path for `INVENTORY_LOCATION` - -### sap_anydb_install_oracle_system_password - -- _Type:_ `string` - -Enter password for Oracle SYSTEM user. - -### sap_anydb_install_oracle_extract_path - -- _Type:_ `string` - -Enter path of Installation media, for example: `/software`. - -### sap_anydb_install_oracle_patch_opatch_zip - -- _Type:_ `string` - -Enter name of Oracle opatch file, for example: `OPATCH19P_2308-70004508.ZIP` - -### sap_anydb_install_oracle_patch_sap_zip - -- _Type:_ `string` - -Enter name of Oracle SAP patch file, for example: `SAP19P_2311-70004508.ZIP` - -### sap_anydb_install_oracle_patch_enable - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to allow post-installation patching. - - \ No newline at end of file diff --git a/roles/sap_anydb_install_oracle/README.md b/roles/sap_anydb_install_oracle/README.md index 027615e3c..c7e0cdd2c 100644 --- a/roles/sap_anydb_install_oracle/README.md +++ b/roles/sap_anydb_install_oracle/README.md @@ -4,7 +4,7 @@ ## Description -Ansible role `sap_anydb_install_oracle` is used to install Oracle Database 19.x for SAP system. +The Ansible role `sap_anydb_install_oracle` is used to install Oracle Database 19.x for SAP system. @@ -12,8 +12,9 @@ Ansible role `sap_anydb_install_oracle` is used to install Oracle Database 19.x ## Prerequisites -Managed nodes: -- Directory with installation media is present and `sap_anydb_install_oracle_extract_path` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. +Managed Nodes: +- Directory with installation media is present and `sap_anydb_install_oracle_extract_path` updated.
+ Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community.sap_launchpad) Ansible Collection. ## Execution @@ -67,5 +68,92 @@ Apache 2.0 - [Sean Freeman](https://github.com/sean-freeman) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_anydb_install_oracle/INPUT_PARAMETERS.md) +## Role Variables + +### sap_anydb_install_oracle_prep_reboot_ok + +- _Type:_ `bool` +- _Default:_ `True` + +Allows reboot of Managed node after packages are installed during pre-steps tasks. + +### sap_anydb_install_oracle_prep_fail_if_reboot_required + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to fail execution if packages are installed during pre-steps tasks, but you don't want to proceed with reboot. + +### sap_anydb_install_oracle_prep_precheck + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to execute installation in Check mode to verify all inputs. This is extra validation and it does not disable installation. + +### sap_anydb_install_oracle_method + +- _Type:_ `string` +- _Default:_ `minimal` + +Select installation method out of available: `minimal` or `responsefile`. + +### sap_anydb_install_oracle_sid: + +- _Type:_ `string` +- _Default:_ `OR1` + +Enter Oracle Database SID. + +### sap_anydb_install_oracle_base + +- _Type:_ `string` +- _Default:_ `/oracle` + +Enter base folder for Oracle Database installation. + +### sap_anydb_install_oracle_filesystem_storage + +- _Type:_ `string` +- _Default:_ `/oradata` + +Enter path for `oracle.install.db.config.starterdb.fileSystemStorage.dataLocation` + +### sap_anydb_install_oracle_inventory_central + +- _Type:_ `string` +- _Default:_ `/oraInventory` + +Enter path for `INVENTORY_LOCATION` + +### sap_anydb_install_oracle_system_password + +- _Type:_ `string` + +Enter password for Oracle SYSTEM user. + +### sap_anydb_install_oracle_extract_path + +- _Type:_ `string` + +Enter path of Installation media, for example: `/software`. + +### sap_anydb_install_oracle_patch_opatch_zip + +- _Type:_ `string` + +Enter name of Oracle opatch file, for example: `OPATCH19P_2308-70004508.ZIP` + +### sap_anydb_install_oracle_patch_sap_zip + +- _Type:_ `string` + +Enter name of Oracle SAP patch file, for example: `SAP19P_2311-70004508.ZIP` + +### sap_anydb_install_oracle_patch_enable + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to allow post-installation patching. + \ No newline at end of file diff --git a/roles/sap_general_preconfigure/INPUT_PARAMETERS.md b/roles/sap_general_preconfigure/INPUT_PARAMETERS.md deleted file mode 100644 index 364683233..000000000 --- a/roles/sap_general_preconfigure/INPUT_PARAMETERS.md +++ /dev/null @@ -1,311 +0,0 @@ -## Input Parameters for sap_general_preconfigure Ansible Role - -#### Minimum required parameters: - -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_general_preconfigure_config_all -- _Type:_ `bool` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_general_preconfigure_installation -- _Type:_ `bool` - -If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_general_preconfigure_configuration -- _Type:_ `bool` - -If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
- -Example: - -```yaml -sap_general_preconfigure_config_all: false -sap_general_preconfigure_configuration: true -sap_general_preconfigure_2002167_02: true -sap_general_preconfigure_1391070: true -``` - -### sap_general_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_general_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_general_preconfigure_system_roles_collection -- _Type:_ `str` -- _Default:_ `'fedora.linux_system_roles'` -- _Possible Values:_
- - `fedora.linux_system_roles` - - `redhat.rhel_system_roles` - -Set which Ansible Collection to use for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'
-For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
- -### sap_general_preconfigure_enable_repos -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want the role to enable the repos as configured by the following repo related parameters.
-The default is `false`, meaning that the role will not enable repos.
- -### sap_general_preconfigure_use_netweaver_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the SAP NetWeaver repo(s).
-The default is `true`, meaning that the role will enable the SAP NetWeaver repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_use_hana_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the SAP HANA repo(s).
-The default is `true`, meaning that the role will enable the SAP HANA repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_use_ha_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not enable the high availability repo(s).
-The default is `true`, meaning that the role will enable the high availability repo(s).
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_disable_all_other_repos -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you want the role to not disable all repos before enabling the desired ones as configured above.
-The default is `true`, meaning that the role will disable all repos before enabling the desired ones.
-Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
- -### sap_general_preconfigure_req_repos -- _Type:_ `list` with elements of type `str` - -If you want to provide your own list of repos (e.g. on cloud systems), set this variable accordingly.
-Otherwise, the RHEL default repo names with the maximum support duration for the RHEL minor release are chosen automatically
-(e.g. normal repos for RHEL 8.3, e4s repos for RHEL 8.4).
- -Example: - -```yaml -sap_general_preconfigure_req_repos: -- rhel-8-for-x86_64-baseos-eus-rpms -- rhel-8-for-x86_64-appstream-eus-rpms -- rhel-8-for-x86_64-sap-solutions-eus-rpms -- rhel-8-for-x86_64-sap-netweaver-eus-rpms -- rhel-8-for-x86_64-highavailability-eus-rpms -``` - -### sap_general_preconfigure_set_minor_release -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want the role to set the RHEL minor release, which is required for SAP HANA. Default is `false`.
-If you set the RHEL minor release, then you must also use the `eus` or `e4s` repos.
- -### sap_general_preconfigure_packagegroups -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -The name of the software package group to install.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -'@minimal-environment' -``` - -### sap_general_preconfigure_envgroups -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -The name of the software environment group to check.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -'@minimal-environment' -``` - -### sap_general_preconfigure_packages -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -The list of packages to install.
-The default for this variable is set in the vars file which corresponds to the detected OS version.
- -### sap_general_preconfigure_min_package_check -- _Type:_ `bool` -- _Default:_ `true` - -The default is to install or check if the minimum package versions are installed as defined in the vars files.
-Set to `false` if you do not install or check these minimum package versions.
- -### sap_general_preconfigure_install_ibm_power_tools -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
-See also SAP note 2679703.
- -### sap_general_preconfigure_add_ibm_power_repo -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
-are already available on the local network). The IBM Power Systems service and productivity tools will only
-be installed if the variable `sap_general_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
- -### sap_general_preconfigure_ibm_power_repo_url -- _Type:_ `str` -- _Default:_ `'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm'` - -URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools
- -### sap_general_preconfigure_update -- _Type:_ `bool` -- _Default:_ `false` - -By default, the role will not update the system, for avoiding an unintentional minor OS release update.
-Set this parameter to `true` if you want to update your system to the latest package versions.
-When using SAP HANA, make sure to set the release lock properly so the minor OS release will be one of
-those for which SAP HANA is supported. See also `sap_general_preconfigure_set_minor_release`.
- -### sap_general_preconfigure_reboot_ok -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want to perform a reboot at the end of the role, if necessary.
- -### sap_general_preconfigure_fail_if_reboot_required -- _Type:_ `bool` -- _Default:_ `true` - -If `sap_general_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
-remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
-Can be useful if you want to implement your own reboot handling.
- -### sap_general_preconfigure_selinux_state -- _Type:_ `str` -- _Default:_ `'permissive'` -- _Possible Values:_
- - `enforcing` - - `permissive` - - `disabled` - -One of the SELinux states to be set on the system.
- -### sap_general_preconfigure_create_directories -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the SAP directories to be created by the role.
-The SAP directories will always be created if `sap_general_preconfigure_modify_selinux_labels`
-(see below) is set to `true`, no matter how `sap_general_preconfigure_create_directories` is set.
- -### sap_general_preconfigure_sap_directories -- _Type:_ `list` with elements of type `str` -- _Default:_ - - /usr/sap - -List of SAP directories to be created.
- -### sap_general_preconfigure_modify_selinux_labels -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want to modify the SELinux labels for the SAP directories set
-in variable `sap_general_preconfigure_sap_directories`.
- -### sap_general_preconfigure_size_of_tmpfs_gb -- _Type:_ `str` -- _Default:_ `"{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}"` - -The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735.
- -### sap_general_preconfigure_modify_etc_hosts -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the role to modify the `/etc/hosts` file.
- -### sap_general_preconfigure_etc_sysctl_sap_conf -- _Type:_ `str` -- _Default:_ `'/etc/sysctl.d/sap.conf'` - -The file name of the sysctl config file to be used
- -### sap_general_preconfigure_kernel_parameters -- _Type:_ `list` with elements of type `dict` -- _Default:_ (set by platform/environment specific variables) - -The Linux kernel parameters to use. By default, these are taken from the vars file.
-The default for this parameter is set in the vars file which corresponds to the detected OS version.
- -Example: - -```yaml -sap_general_preconfigure_kernel_parameters: -- name: vm.max_map_count - value: '2147483647' -- name: fs.aio-max-nr - value: '18446744073709551615' -``` - -### sap_general_preconfigure_max_hostname_length -- _Type:_ `str` -- _Default:_ `'13'` - -The maximum length of the hostname. See SAP note 611361.
- -### sap_hostname -- _Type:_ `str` -- _Default:_ `"{{ ansible_hostname }}"` - -The hostname to be used for updating or checking `/etc/hosts` entries.
- -### sap_domain -- _Type:_ `str` -- _Default:_ `"{{ ansible_domain }}"` - -The DNS domain name to be used for updating or checking `/etc/hosts` entries.
- -### sap_ip -- _Type:_ `str` -- _Default:_ `"{{ ansible_default_ipv4.address }}"` - -The IPV4 address to be used for updating or checking `/etc/hosts` entries.
- -### sap_general_preconfigure_db_group_name -- _Type:_ `str` - -Use this variable to specify the name of the RHEL group which is used for the database processes.
-If defined, it will be used to configure process limits as per step
-Configuring Process Resource Limits
- -Example: - -```yaml -sap_general_preconfigure_db_group_name: dba -``` - \ No newline at end of file diff --git a/roles/sap_general_preconfigure/README.md b/roles/sap_general_preconfigure/README.md index d2e05c7be..3511e61e9 100644 --- a/roles/sap_general_preconfigure/README.md +++ b/roles/sap_general_preconfigure/README.md @@ -5,11 +5,9 @@ ## Description -Ansible Role `sap_general_preconfigure` is used to ensure that Managed nodes are configured to host SAP systems according to SAP Notes. +The Ansible role `sap_general_preconfigure` installs required packages and performs basic OS configuration steps according to applicable SAP notes for installing and running SAP HANA or SAP ABAP Application Platform (formerly known as SAP NetWeaver). -This role performs installation of required packages for running SAP systems and configuration of Operating system parameters. - -This is general preconfigure role that used for both SAP Netweaver and SAP HANA, which have separate follow-up roles [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) and [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure). +Specific installation and configuration steps then have to be performed with the roles [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) and [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure). @@ -28,7 +26,6 @@ Install required collections by `ansible-galaxy install -vv -r meta/collection-r ## Prerequisites (Red Hat specific) Ensure system is installed according to: -- RHEL 7: SAP note 2002167, Red Hat Enterprise Linux 7.x: Installation and Upgrade, section `Installing Red Hat Enterprise Linux 7`. - RHEL 8: SAP note 2772999, Red Hat Enterprise Linux 8.x: Installation and Configuration, section `Installing Red Hat Enterprise Linux 8`. - RHEL 9: SAP note 3108316, Red Hat Enterprise Linux 9.x: Installation and Configuration, section `Installing Red Hat Enterprise Linux 9`. @@ -37,8 +34,6 @@ Install required collections by `ansible-galaxy install -vv -r meta/collection-r ## Execution **:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** - -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -117,8 +112,9 @@ With the following tags, the role can be called to perform certain activities on - +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -131,9 +127,8 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_general_preconfigure/INPUT_PARAMETERS.md) - +## Role Variables + ### Controlling execution with input parameters Extended Check (assert) run, aborting for any error which has been found: ```yaml @@ -144,3 +139,306 @@ Extended Check (assert) run, not aborting even if an error has been found: ```yaml ansible-playbook sap.yml -l remote_host -e "{sap_general_preconfigure_assert: yes,sap_general_preconfigure_assert_ignore_errors: no}" ``` + +### sap_general_preconfigure_config_all +- _Type:_ `bool` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_general_preconfigure_installation +- _Type:_ `bool` + +If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_general_preconfigure_configuration +- _Type:_ `bool` + +If `sap_general_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
+ +Example: + +```yaml +sap_general_preconfigure_config_all: false +sap_general_preconfigure_configuration: true +sap_general_preconfigure_2002167_02: true +sap_general_preconfigure_1391070: true +``` + +### sap_general_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_general_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_general_preconfigure_system_roles_collection +- _Type:_ `str` +- _Default:_ `'fedora.linux_system_roles'` + +Set which Ansible Collection to use for the Linux System Roles.
+Available values: +- `fedora.linux_system_roles` - for community/upstream.
+- `redhat.rhel_system_roles` - for the RHEL System Roles for SAP, or for Red Hat Automation Hub.
+ +### sap_general_preconfigure_enable_repos +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want the role to enable the repos as configured by the following repo related parameters.
+The default is `false`, meaning that the role will not enable repos.
+ +### sap_general_preconfigure_use_netweaver_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the SAP NetWeaver repo(s).
+The default is `true`, meaning that the role will enable the SAP NetWeaver repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_use_hana_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the SAP HANA repo(s).
+The default is `true`, meaning that the role will enable the SAP HANA repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_use_ha_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not enable the high availability repo(s).
+The default is `true`, meaning that the role will enable the high availability repo(s).
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_disable_all_other_repos +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you want the role to not disable all repos before enabling the desired ones as configured above.
+The default is `true`, meaning that the role will disable all repos before enabling the desired ones.
+Only valid if `sap_general_preconfigure_enable_repos` is set to `true`.
+ +### sap_general_preconfigure_req_repos +- _Type:_ `list` with elements of type `str` + +If you want to provide your own list of repos (e.g. on cloud systems), set this variable accordingly.
+Otherwise, the RHEL default repo names with the maximum support duration for the RHEL minor release are chosen automatically
+(e.g. normal repos for RHEL 8.3, e4s repos for RHEL 8.4).
+ +Example: + +```yaml +sap_general_preconfigure_req_repos: +- rhel-8-for-x86_64-baseos-eus-rpms +- rhel-8-for-x86_64-appstream-eus-rpms +- rhel-8-for-x86_64-sap-solutions-eus-rpms +- rhel-8-for-x86_64-sap-netweaver-eus-rpms +- rhel-8-for-x86_64-highavailability-eus-rpms +``` + +### sap_general_preconfigure_set_minor_release +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want the role to set the RHEL minor release, which is required for SAP HANA. Default is `false`.
+If you set the RHEL minor release, then you must also use the `eus` or `e4s` repos.
+ +### sap_general_preconfigure_packagegroups +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +The name of the software package group to install.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +'@minimal-environment' +``` + +### sap_general_preconfigure_envgroups +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +The name of the software environment group to check.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +'@minimal-environment' +``` + +### sap_general_preconfigure_packages +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +The list of packages to install.
+The default for this variable is set in the vars file which corresponds to the detected OS version.
+ +### sap_general_preconfigure_min_package_check +- _Type:_ `bool` +- _Default:_ `true` + +The default is to install or check if the minimum package versions are installed as defined in the vars files.
+Set to `false` if you do not install or check these minimum package versions.
+ +### sap_general_preconfigure_install_ibm_power_tools +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
+See also SAP note 2679703.
+ +### sap_general_preconfigure_add_ibm_power_repo +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
+are already available on the local network). The IBM Power Systems service and productivity tools will only
+be installed if the variable `sap_general_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
+ +### sap_general_preconfigure_ibm_power_repo_url +- _Type:_ `str` +- _Default:_ `'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm'` + +URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools
+ +### sap_general_preconfigure_update +- _Type:_ `bool` +- _Default:_ `false` + +By default, the role will not update the system, for avoiding an unintentional minor OS release update.
+Set this parameter to `true` if you want to update your system to the latest package versions.
+When using SAP HANA, make sure to set the release lock properly so the minor OS release will be one of
+those for which SAP HANA is supported. See also `sap_general_preconfigure_set_minor_release`.
+ +### sap_general_preconfigure_reboot_ok +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want to perform a reboot at the end of the role, if necessary.
+ +### sap_general_preconfigure_fail_if_reboot_required +- _Type:_ `bool` +- _Default:_ `true` + +If `sap_general_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
+remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
+Can be useful if you want to implement your own reboot handling.
+ +### sap_general_preconfigure_selinux_state +- _Type:_ `str` +- _Default:_ `'permissive'` +- _Possible Values:_
+ - `enforcing` + - `permissive` + - `disabled` + +One of the SELinux states to be set on the system.
+ +### sap_general_preconfigure_create_directories +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the SAP directories to be created by the role.
+The SAP directories will always be created if `sap_general_preconfigure_modify_selinux_labels`
+(see below) is set to `true`, no matter how `sap_general_preconfigure_create_directories` is set.
+ +### sap_general_preconfigure_sap_directories +- _Type:_ `list` with elements of type `str` +- _Default:_ + - /usr/sap + +List of SAP directories to be created.
+ +### sap_general_preconfigure_modify_selinux_labels +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want to modify the SELinux labels for the SAP directories set
+in variable `sap_general_preconfigure_sap_directories`.
+ +### sap_general_preconfigure_size_of_tmpfs_gb +- _Type:_ `str` +- _Default:_ `"{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}"` + +The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735.
+ +### sap_general_preconfigure_modify_etc_hosts +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the role to modify the `/etc/hosts` file.
+ +### sap_general_preconfigure_etc_sysctl_sap_conf +- _Type:_ `str` +- _Default:_ `'/etc/sysctl.d/sap.conf'` + +The file name of the sysctl config file to be used
+ +### sap_general_preconfigure_kernel_parameters +- _Type:_ `list` with elements of type `dict` +- _Default:_ (set by platform/environment specific variables) + +The Linux kernel parameters to use. By default, these are taken from the vars file.
+The default for this parameter is set in the vars file which corresponds to the detected OS version.
+ +Example: + +```yaml +sap_general_preconfigure_kernel_parameters: +- name: vm.max_map_count + value: '2147483647' +- name: fs.aio-max-nr + value: '18446744073709551615' +``` + +### sap_general_preconfigure_max_hostname_length +- _Type:_ `str` +- _Default:_ `'13'` + +The maximum length of the hostname. See SAP note 611361.
+ +### sap_hostname +- _Type:_ `str` +- _Default:_ `"{{ ansible_hostname }}"` + +The hostname to be used for updating or checking `/etc/hosts` entries.
+ +### sap_domain +- _Type:_ `str` +- _Default:_ `"{{ ansible_domain }}"` + +The DNS domain name to be used for updating or checking `/etc/hosts` entries.
+ +### sap_ip +- _Type:_ `str` +- _Default:_ `"{{ ansible_default_ipv4.address }}"` + +The IPV4 address to be used for updating or checking `/etc/hosts` entries.
+ +### sap_general_preconfigure_db_group_name +- _Type:_ `str` + +Use this variable to specify the name of the RHEL group which is used for the database processes.
+If defined, it will be used to configure process limits as per step
+Configuring Process Resource Limits
+ +Example: + +```yaml +sap_general_preconfigure_db_group_name: dba +``` + \ No newline at end of file diff --git a/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md b/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md deleted file mode 100644 index 7bc555e10..000000000 --- a/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md +++ /dev/null @@ -1,27 +0,0 @@ -## Input Parameters for sap_ha_install_anydb_ibmdb2 Ansible Role - -### sap_ha_install_anydb_ibmdb2_hostname_primary - -- _Type:_ `string` - -Enter IBM Db2 Primary node hostname - - -### sap_ha_install_anydb_ibmdb2_hostname_secondary - -- _Type:_ `string` - -Enter IBM Db2 Secondary node hostname - -### sap_ha_install_anydb_ibmdb2_sid - -- _Type:_ `string` - -Enter IBM Db2 System ID - -### sap_ha_install_anydb_ibmdb2_software_directory - -- _Type:_ `string` - -Enter IBM Db2 installation media path - \ No newline at end of file diff --git a/roles/sap_ha_install_anydb_ibmdb2/README.md b/roles/sap_ha_install_anydb_ibmdb2/README.md index a87751e6a..92e604b03 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/README.md +++ b/roles/sap_ha_install_anydb_ibmdb2/README.md @@ -5,9 +5,9 @@ ## Description -Ansible Role for instantiation of IBM Db2 'Integrated Linux Pacemaker' HADR cluster +The Ansible Role for instantiation of IBM Db2 'Integrated Linux Pacemaker' HADR cluster. -Note: IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models: +**NOTE:** IBM Db2 with 'Integrated Linux Pacemaker' can use two deployment models: - Mutual Failover option, **not** covered by this Ansible Role - High Availability and Disaster Recovery (HADR) option for Idle Standby, initialized by this Ansible Role @@ -82,5 +82,30 @@ Apache 2.0 - [Sean Freeman](https://github.com/sean-freeman) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_install_anydb_ibmdb2/INPUT_PARAMETERS.md) +## Role Variables + +### sap_ha_install_anydb_ibmdb2_hostname_primary + +- _Type:_ `string` + +Enter IBM Db2 Primary node hostname + + +### sap_ha_install_anydb_ibmdb2_hostname_secondary + +- _Type:_ `string` + +Enter IBM Db2 Secondary node hostname + +### sap_ha_install_anydb_ibmdb2_sid + +- _Type:_ `string` + +Enter IBM Db2 System ID + +### sap_ha_install_anydb_ibmdb2_software_directory + +- _Type:_ `string` + +Enter IBM Db2 installation media path + \ No newline at end of file diff --git a/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md b/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md deleted file mode 100644 index a9bab4b21..000000000 --- a/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md +++ /dev/null @@ -1,90 +0,0 @@ -## Input Parameters for sap_ha_pacemaker_cluster Ansible Role - - -### sap_ha_install_hana_hsr_sid - -- _Type:_ `string` -- _Default:_ `{{ sap_hana_sid }}` - -Enter SID of SAP HANA database. - -### sap_ha_install_hana_hsr_instance_number - -- _Type:_ `string` -- _Default:_ `{{ sap_hana_instance_number }}` - -Enter string value of SAP HANA SID. - -### sap_ha_install_hana_hsr_cluster_nodes - -- _Type:_ `list` -- _Default:_ `{{ sap_hana_cluster_nodes }}` - -List of cluster nodes and associated attributes to describe the target SAP HA environment.
-This is required for the HANA System Replication configuration.
- -- **hana_site**
- Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). -- **node_ip**
- IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ -- **node_name**
- Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ -- **node_role**
- Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ - -Example: - -```yaml -sap_ha_install_hana_hsr_cluster_nodes: - - node_name: node1 - node_ip: 192.168.1.11 - node_role: primary - hana_site: DC01 - - - node_name: node2 - node_ip: 192.168.1.12 - node_role: secondary - hana_site: DC02 -``` - -### sap_ha_install_hana_hsr_hdbuserstore_system_backup_user - -- _Type:_ `string` -- _Default:_ `HDB_SYSTEMDB` - -Enter name of SYSTEM user for backup execution. - -### sap_ha_install_hana_hsr_db_system_password - -- _Type:_ `string` -- _Default:_ `{{ sap_hana_install_master_password }}` - -Enter password of SYSTEM user for backup execution. - -### sap_ha_install_hana_hsr_fqdn - -- _Type:_ `string` -- _Default:_ {{ sap_domain }} - -Enter domain of SAP system, for example `example.com`. - -### sap_ha_install_hana_hsr_rep_mode - -- _Type:_ `string` -- _Default:_ `sync` - -Enter SAP HANA System Replication mode. - -### sap_ha_install_hana_hsr_oper_mode - -- _Type:_ `string` -- _Default:_ `logreplay` - -Enter SAP HANA System Replication operation mode. - -### sap_ha_install_hana_hsr_update_etchosts -- _Type:_ `bool` -- _Default:_ `True` - -Enable to update /etc/hosts file. - \ No newline at end of file diff --git a/roles/sap_ha_install_hana_hsr/README.md b/roles/sap_ha_install_hana_hsr/README.md index e16b11b8d..9d2a1ae21 100644 --- a/roles/sap_ha_install_hana_hsr/README.md +++ b/roles/sap_ha_install_hana_hsr/README.md @@ -5,7 +5,7 @@ ## Description -Ansible Role `sap_ha_install_hana_hsr` is used to configure and enable SAP HANA System Replication between 2 nodes. +The Ansible Role `sap_ha_install_hana_hsr` is used to configure and enable SAP HANA System Replication between 2 nodes. @@ -20,7 +20,6 @@ Managed nodes: ## Execution -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -77,6 +76,8 @@ It is recommended to execute this role together with other roles in this collect +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -89,5 +90,92 @@ Apache 2.0 - [Janine Fuchs](https://github.com/ja9fuchs) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_install_hana_hsr/INPUT_PARAMETERS.md) +## Role Variables + +### sap_ha_install_hana_hsr_sid + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_sid }}` + +Enter SID of SAP HANA database. + +### sap_ha_install_hana_hsr_instance_number + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_instance_number }}` + +Enter string value of SAP HANA SID. + +### sap_ha_install_hana_hsr_cluster_nodes + +- _Type:_ `list` +- _Default:_ `{{ sap_hana_cluster_nodes }}` + +List of cluster nodes and associated attributes to describe the target SAP HA environment.
+This is required for the HANA System Replication configuration.
+ +- **hana_site**
+ Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +- **node_ip**
+ IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +- **node_name**
+ Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +- **node_role**
+ Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ + +Example: + +```yaml +sap_ha_install_hana_hsr_cluster_nodes: + - node_name: node1 + node_ip: 192.168.1.11 + node_role: primary + hana_site: DC01 + + - node_name: node2 + node_ip: 192.168.1.12 + node_role: secondary + hana_site: DC02 +``` + +### sap_ha_install_hana_hsr_hdbuserstore_system_backup_user + +- _Type:_ `string` +- _Default:_ `HDB_SYSTEMDB` + +Enter name of SYSTEM user for backup execution. + +### sap_ha_install_hana_hsr_db_system_password + +- _Type:_ `string` +- _Default:_ `{{ sap_hana_install_master_password }}` + +Enter password of SYSTEM user for backup execution. + +### sap_ha_install_hana_hsr_fqdn + +- _Type:_ `string` +- _Default:_ {{ sap_domain }} + +Enter domain of SAP system, for example `example.com`. + +### sap_ha_install_hana_hsr_rep_mode + +- _Type:_ `string` +- _Default:_ `sync` + +Enter SAP HANA System Replication mode. + +### sap_ha_install_hana_hsr_oper_mode + +- _Type:_ `string` +- _Default:_ `logreplay` + +Enter SAP HANA System Replication operation mode. + +### sap_ha_install_hana_hsr_update_etchosts +- _Type:_ `bool` +- _Default:_ `True` + +Enable to update /etc/hosts file. + \ No newline at end of file diff --git a/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md b/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md deleted file mode 100644 index 564cb3cf7..000000000 --- a/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md +++ /dev/null @@ -1,1020 +0,0 @@ -## Input Parameters for sap_ha_pacemaker_cluster Ansible Role - -Minimum required parameters for all clusters: - -- [sap_ha_pacemaker_cluster_hacluster_user_password](#sap_ha_pacemaker_cluster_hacluster_user_password) - -Additional minimum requirements depend on the type of cluster setup and on the target platform. - -### sap_ha_pacemaker_cluster_hacluster_user_password - -- _Type:_ `string` - -**Mandatory Input Parameter.**
-The password of the `hacluster` user which is created during pacemaker installation.
-Inherits the value of `ha_cluster_hacluster_password`, when defined.
- - -### sap_ha_pacemaker_cluster_aws_access_key_id - -- _Type:_ `string` - -AWS access key to allow control of instances (for example for fencing operations).
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
-2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
- -### sap_ha_pacemaker_cluster_aws_credentials_setup - -- _Type:_ `string` - -Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
-Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
- -### sap_ha_pacemaker_cluster_aws_region - -- _Type:_ `string` - -The AWS region in which the instances to be used for the cluster setup are located.
-Mandatory for cluster nodes setup on AWS EC2 instances.
- -### sap_ha_pacemaker_cluster_aws_secret_access_key - -- _Type:_ `string` - -AWS secret key, paired with the access key for instance control.
-Mandatory for the cluster nodes setup on AWS EC2 instances, when:
-1. IAM Role or Instance profile is not attached to EC2 instance.
-2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
- -### sap_ha_pacemaker_cluster_aws_vip_update_rt - -- _Type:_ `string` - -List one more routing table IDs for managing Virtual IP failover through routing table changes.
-Multiple routing tables must be defined as a comma-separated string (no spaces).
-Mandatory for the VIP resource configuration in AWS EC2 environments.
- -### sap_ha_pacemaker_cluster_cluster_name - -- _Type:_ `string` - -The name of the pacemaker cluster.
-Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
-If not defined, the `ha_cluster` Linux System Role default will be used.
- -### sap_ha_pacemaker_cluster_cluster_nodes - -- _Type:_ `list` - -List of cluster nodes and associated attributes to describe the target SAP HA environment.
-This is required for the HANA System Replication configuration.
-Synonym for this parameter is `sap_hana_cluster_nodes`.
-Mandatory to be defined for HANA clusters.
- -- **hana_site**
- Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). -- **node_ip**
- IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ -- **node_name**
- Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ -- **node_role**
- Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ - -Example: - -```yaml -sap_ha_pacemaker_cluster_cluster_nodes: -- hana_site: DC01 - node_ip: 192.168.5.1 - node_name: nodeA - node_role: primary -- hana_site: DC02 -``` - -### sap_ha_pacemaker_cluster_cluster_properties - -- _Type:_ `dict` -- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` - -Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
-When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_cluster_properties: - concurrent-fencing: true - stonith-enabled: true - stonith-timeout: 900 -``` - -### sap_ha_pacemaker_cluster_create_config_dest - -- _Type:_ `string` -- _Default:_ `review_resource_config.yml` - -The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
-Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file.
-Specify a path/filename to save the file in a custom location.
-The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role.
- -### sap_ha_pacemaker_cluster_create_config_varfile - -- _Type:_ `bool` -- _Default:_ `False` - -When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format.
-This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role.
-When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes.
-WARNING! This report may include sensitive details like secrets required for certain cluster resources!
- -### sap_ha_pacemaker_cluster_enable_cluster_connector - -- _Type:_ `bool` -- _Default:_ `True` - -Enables/Disables the SAP HA Interface for SAP ABAP application server instances, also known as `sap_cluster_connector`.
-Set this parameter to 'false' if the SAP HA interface should not be installed and configured.
- -### sap_ha_pacemaker_cluster_extra_packages - -- _Type:_ `list` - -Additional extra packages to be installed, for instance specific resource packages.
-For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
- -### sap_ha_pacemaker_cluster_fence_agent_packages - -- _Type:_ `list` - -Additional fence agent packages to be installed.
-This is automatically combined with default packages in:
-`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`
-`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
- -### sap_ha_pacemaker_cluster_gcp_project - -- _Type:_ `string` - -Google Cloud project name in which the target instances are installed.
-Mandatory for the cluster setup on GCP instances.
- -### sap_ha_pacemaker_cluster_gcp_region_zone - -- _Type:_ `string` - -Google Cloud Platform region zone ID.
-Mandatory for the cluster setup on GCP instances.
- -### sap_ha_pacemaker_cluster_ha_cluster - -- _Type:_ `dict` - -The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
-Optional _**host_vars**_ parameter - if defined it must be set for each node.
-Dictionary that can contain various node options for the pacemaker cluster configuration.
-Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
-If not defined, the `ha_cluster` Linux System Role default will be used.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_ha_cluster: - corosync_addresses: - - 192.168.1.10 - - 192.168.2.10 - node_name: nodeA -``` - -### sap_ha_pacemaker_cluster_hana_automated_register - -- _Type:_ `bool` -- _Default:_ `True` - -Parameter for the 'SAPHana' cluster resource.
-Define if a former primary should be re-registered automatically as secondary.
- -### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_primary` - -Customize the cluster constraint name for VIP and SAPHana primary clone colocation.
- -### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_readonly` - -Customize the cluster constraint name for VIP and SAPHana secondary clone colocation.
- -### sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout - -- _Type:_ `int` -- _Default:_ `7200` - -Parameter for the 'SAPHana' cluster resource.
-Time difference needed between to primary time stamps, if a dual-primary situation occurs.
-If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status.
-This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
- -### sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaFil__HDB` - -Customize the cluster resource name of the SAP HANA Filesystem clone.
- -### sap_ha_pacemaker_cluster_hana_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaFil__HDB` - -Customize the cluster resource name of the SAP HANA Filesystem.
- -### sap_ha_pacemaker_cluster_hana_global_ini_path - -- _Type:_ `string` -- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini` - -Path with location of global.ini for srHook update
- -### sap_ha_pacemaker_cluster_hana_hook_chksrv - -- _Type:_ `bool` -- _Default:_ `False` - -Controls if ChkSrv srHook is enabled during srHook creation.
-It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
- -### sap_ha_pacemaker_cluster_hana_hook_tkover - -- _Type:_ `bool` -- _Default:_ `False` - -Controls if TkOver srHook is enabled during srHook creation.
-It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
- -### sap_ha_pacemaker_cluster_hana_hooks - -- _Type:_ `list` -- _Default:_ `[]` - -Customize required list of SAP HANA Hooks
-Mandatory to include SAPHanaSR srHook in list.
-Mandatory attributes are provider and path.
-Example below shows mandatory SAPHanaSR, TkOver and ChkSrv hooks.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_hana_hooks: -- options: - - name: execution_order - value: 1 - path: /usr/share/SAPHanaSR/ - provider: SAPHanaSR -- options: - - name: execution_order - value: 2 - path: /usr/share/SAPHanaSR/ - provider: susTkOver -- options: - - name: execution_order - value: 3 - - name: action_on_lost - value: stop - path: /usr/share/SAPHanaSR/ - provider: susChkSrv -``` - -### sap_ha_pacemaker_cluster_hana_instance_nr - -- _Type:_ `string` - -The instance number of the SAP HANA database which this role will configure in the cluster.
-Inherits the value of `sap_hana_instance_number`, when defined.
-Mandatory for SAP HANA cluster setups.
- -### sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_primary` - -Customize the cluster constraint name for VIP and SAPHana primary clone order.
- -### sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_readonly` - -Customize the cluster constraint name for VIP and SAPHana secondary clone order.
- -### sap_ha_pacemaker_cluster_hana_order_topology_hana_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_saphanatop__HDB` - -Customize the cluster constraint name for SAPHana and Topology order.
- -### sap_ha_pacemaker_cluster_hana_prefer_site_takeover - -- _Type:_ `bool` -- _Default:_ `True` - -Parameter for the 'SAPHana' cluster resource.
-Set to "false" if the cluster should first attempt to restart the instance on the same node.
-When set to "true" (default) a failover to secondary will be initiated on resource failure.
- -### sap_ha_pacemaker_cluster_hana_resource_clone_msl_name - -- _Type:_ `string` -- _Default:_ `msl_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource master slave clone.
-Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
- -### sap_ha_pacemaker_cluster_hana_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource clone.
- -### sap_ha_pacemaker_cluster_hana_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHana__HDB` - -Customize the cluster resource name of the SAP HANA DB resource.
- -### sap_ha_pacemaker_cluster_hana_sid - -- _Type:_ `string` - -The SAP HANA SID of the instance that will be configured in the cluster.
-The SID must follow SAP specifications - see SAP Note 1979280.
-Inherits the value of `sap_hana_sid`, when defined.
-Mandatory for SAP HANA cluster setups.
- -### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaTop__HDB` - -Customize the cluster resource name of the SAP HANA Topology resource clone.
- -### sap_ha_pacemaker_cluster_hana_topology_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaTop__HDB` - -Customize the cluster resource name of the SAP HANA Topology resource.
- -### sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaCon__HDB` - -Customize the cluster resource name of the SAP HANA Controller clone.
- -### sap_ha_pacemaker_cluster_hanacontroller_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaCon__HDB` - -Customize the cluster resource name of the SAP HANA Controller.
- -### sap_ha_pacemaker_cluster_host_type - -- _Type:_ `list` -- _Default:_ `hana_scaleup_perf` - -The SAP landscape to for which the cluster is to be configured.
-The default is a 2-node SAP HANA scale-up cluster.
- -### sap_ha_pacemaker_cluster_ibmcloud_api_key - -- _Type:_ `string` - -The API key which is required to allow the control of instances (for example for fencing operations).
-Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type - -- _Type:_ `string` - -IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
-Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url - -- _Type:_ `string` - -IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
-When public network interface, can be ignored.
-When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn - -- _Type:_ `string` - -IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
-Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
- -### sap_ha_pacemaker_cluster_ibmcloud_region - -- _Type:_ `string` - -The IBM Cloud VS region name in which the instances are running.
-Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
- -### sap_ha_pacemaker_cluster_msazure_resource_group - -- _Type:_ `string` - -Resource group name/ID in which the target instances are defined.
-Mandatory for the cluster setup on MS Azure instances.
- -### sap_ha_pacemaker_cluster_msazure_subscription_id - -- _Type:_ `string` - -Subscription ID of the MS Azure environment containing the target instances.
-Mandatory for the cluster setup on MS Azure instances.
- -### sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP AAS instance.
-Mandatory for NetWeaver AAS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 - -- _Type:_ `bool` -- _Default:_ `False` - -The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
-Set this parameter to 'true' to configure it as ENSA1.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - -- _Type:_ `bool` -- _Default:_ `True` - -Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount
-Set this parameter to 'true' to configure ENSA2 Simple Mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__ASCS` - -Name of the filesystem resource for the ASCS instance.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness - -- _Type:_ `string` -- _Default:_ `3000` - -NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP ASCS instance.
-Mandatory for NetWeaver ASCS/ERS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool - -- _Type:_ `bool` -- _Default:_ `False` - -NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout - -- _Type:_ `string` -- _Default:_ `60` - -NetWeaver ASCS instance failure-timeout attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold - -- _Type:_ `string` -- _Default:_ `1` - -NetWeaver ASCS instance migration-threshold setting attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name - -- _Type:_ `string` - -The name of the ASCS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup
-Recommended format _ASCS_.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ASCS` - -Name of the ASCS instance resource.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness - -- _Type:_ `string` -- _Default:_ `5000` - -NetWeaver ASCS instance resource stickiness attribute.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string - -- _Type:_ `string` - -The full path and name of the ASCS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ASCS` - -Name of the ASCS SAPStartSrv resource for simple mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__ERS` - -Name of the filesystem resource for the ERS instance.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool - -- _Type:_ `bool` -- _Default:_ `False` - -NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name - -- _Type:_ `string` - -The name of the ERS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
-Recommended format _ERS_.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ERS` - -Name of the ERS instance resource.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string - -- _Type:_ `string` - -The full path and name of the ERS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ERS` - -Name of the ERS SAPstartSrv resource for simple mount.
- -### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr - -- _Type:_ `string` - -Instance number of the NetWeaver ABAP PAS instance.
-Mandatory for NetWeaver PAS cluster configuration.
- -### sap_ha_pacemaker_cluster_nwas_abap_sid - -- _Type:_ `string` - -SID of the NetWeaver instances.
-Mandatory for NetWeaver cluster configuration.
-Uses `sap_swpm_sid` if defined.
-Mandatory for NetWeaver cluster setups.
- -### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name - -- _Type:_ `string` -- _Default:_ `col_ascs_separate_` - -Customize the cluster constraint name for ASCS and ERS separation colocation.
- -### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name - -- _Type:_ `string` -- _Default:_ `ord_ascs_first_` - -Customize the cluster constraint name for ASCS starting before ERS order.
- -### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__sapmnt` - -Filesystem resource clone name for the shared filesystem /sapmnt.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__sapmnt` - -Filesystem resource name for the shared filesystem /sapmnt.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed - -- _Type:_ `bool` -- _Default:_ `False` - -Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
- -### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__sys` - -Filesystem resource clone name for the shared filesystem /usr/sap//SYS.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__sys` - -Filesystem resource name for the transports filesystem /usr/sap//SYS.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__trans` - -Filesystem resource clone name for the shared filesystem /usr/sap/trans.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__trans` - -Filesystem resource name for the transports filesystem /usr/sap/trans.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
- -### sap_ha_pacemaker_cluster_operation_defaults - -- _Type:_ `dict` -- _Default:_ `{'record-pending': True, 'timeout': 600}` - -Set default operation parameters that will be valid for all pacemaker resources.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_operation_defaults: - record-pending: true - timeout: 600 -``` - -### sap_ha_pacemaker_cluster_resource_defaults - -- _Type:_ `dict` -- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` - -Set default parameters that will be valid for all pacemaker resources.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_resource_defaults: - migration-threshold: 5000 - resource-stickiness: 1000 -``` - -### sap_ha_pacemaker_cluster_saphanasr_angi_detection - -- _Type:_ `string` -- _Default:_ `True` - -Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
- -### sap_ha_pacemaker_cluster_sbd_devices - -- _Type:_ `list` - -Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of block devices for Stonith SBD agent
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 -``` - -### sap_ha_pacemaker_cluster_sbd_enabled - -- _Type:_ `bool` - -Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
-Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
-Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 -sap_ha_pacemaker_cluster_sbd_enabled: true -sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:external/sbd - id: stonith_sbd - instance_attrs: - - attrs: - - name: pcmk_delay_max - value: 15 -``` - -### sap_ha_pacemaker_cluster_sbd_options - -- _Type:_ `list` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of SBD specific options that are added into SBD configuration file.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_options: -- name: startmode - value: clean -``` - -### sap_ha_pacemaker_cluster_sbd_watchdog - -- _Type:_ `str` -- _Default:_ `/dev/watchdog` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide watchdog name to override default /dev/watchdog
- -### sap_ha_pacemaker_cluster_sbd_watchdog_modules - -- _Type:_ `list` - -Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
-Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
- -Example: - -```yaml -sap_ha_pacemaker_cluster_sbd_watchdog_modules: -- softdog -``` - -### sap_ha_pacemaker_cluster_stonith_custom - -- _Type:_ `list` - -Custom list of STONITH resource(s) to be configured in the cluster.
-This definition override any defaults the role would apply otherwise.
-Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
- -- **agent**
- Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. -- **id**
- Parameter `id` is required.
Name that will be used as the resource ID (name). -- **instance_attrs**
- Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. -- **meta_attrs**
- Defines meta attributes as list of name/value pairs. -- **name**
- WARNING! This option will be removed in future release. -- **operations**
- Defines list of resource agent operations. -- **options**
- WARNING! This option will be removed in future release. - -Example: - -```yaml -sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:fence_rhevm - id: my-fence-resource - instance_attrs: - - attrs: - - name: ip - value: rhevm-server - - name: username - value: login-user - - name: password - value: login-user-password - - name: pcmk_host_list - value: node1,node2 - - name: power_wait - value: 3 - meta_attrs: - - attrs: - - name: target-role - value: Started - operations: - - action: start - attrs: - - name: interval - value: 0 - - name: timeout - value: 180 -``` - -### sap_ha_pacemaker_cluster_storage_definition - -- _Type:_ `list` - -List of filesystem definitions used for filesystem cluster resources.
-Options relevant, see example.
-Mandatory for SAP NetWeaver HA cluster configurations.
-Reuse `sap_storage_setup_definition` if defined.
-Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'.
-Reuse `sap_storage_setup_definition` all options are documented under Ansible Role `sap_storage_setup`.
-Note! For this variable, the argument specification does not list options, to avoid errors during reuse of `sap_storage_setup_definition` if defined.
- -Example: - -```yaml -sap_ha_pacemaker_cluster_storage_definition: -- mountpoint: /usr/sap - name: usr_sap - nfs_path: /usr/sap - nfs_server: nfs-server.example.com:/ -- mountpoint: /usr/sap/trans - name: usr_sap_trans - nfs_path: /usr/sap/trans - nfs_server: nfs-server.example.com:/ -- mountpoint: /sapmnt - name: sapmnt - nfs_filesystem_type: nfs - nfs_mount_options: defaults - nfs_path: /sapmnt - nfs_server: nfs-server.example.com:/ -``` - -### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type - -- _Type:_ `string` -- _Default:_ `nfs` - -Filesystem type of the NFS filesystems that are part of the cluster configuration.
- -### sap_ha_pacemaker_cluster_storage_nfs_mount_options - -- _Type:_ `string` -- _Default:_ `defaults` - -Mount options of the NFS filesystems that are part of the cluster configuration.
- -### sap_ha_pacemaker_cluster_storage_nfs_server - -- _Type:_ `string` - -Default address of the NFS server, if not defined individually by filesystem.
- -### sap_ha_pacemaker_cluster_system_roles_collection - -- _Type:_ `string` -- _Default:_ `fedora.linux_system_roles` - -Reference to the Ansible Collection used for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'.
-For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'.
- -### sap_ha_pacemaker_cluster_vip_client_interface - -- _Type:_ `string` - -OS device name of the network interface to use for the Virtual IP configuration.
-When there is only one interface on the system, its name will be used by default.
- -### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address - -- _Type:_ `string` - -The virtual IP of the primary HANA instance.
-Mandatory parameter for HANA clusters.
- -### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_primary` - -Customize the name of the resource managing the Virtual IP of the primary HANA instance.
- -### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address - -- _Type:_ `string` - -The virtual IP for read-only access to the secondary HANA instance.
-Optional parameter in HANA clusters.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver AAS instance.
-Mandatory for NetWeaver AAS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__AAS` - -Name of the SAPInstance resource for NetWeaver AAS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver ASCS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name - -- _Type:_ `string` -- _Default:_ `grp__ASCS` - -Name of the NetWeaver ASCS resource group.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__ASCS` - -Name of the SAPInstance resource for NetWeaver ASCS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name - -- _Type:_ `string` -- _Default:_ `grp__ERS` - -Name of the NetWeaver ERS resource group.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__ERS` - -Name of the SAPInstance resource for NetWeaver ERS.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver PAS instance.
-Mandatory for NetWeaver PAS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__PAS` - -Name of the SAPInstance resource for NetWeaver PAS.
- -### sap_ha_pacemaker_cluster_vip_secondary_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_readonly` - -Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
- \ No newline at end of file diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 2f0d9f3b3..97491599f 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -5,7 +5,7 @@ ## Description -Ansible Role `sap_ha_pacemaker_cluster` is used to install and configure Linux Pacemaker High Availability clusters for SAP HANA and SAP Netweaver systems on various infrastructure platforms. +The Ansible Role `sap_ha_pacemaker_cluster` is used to install and configure Linux Pacemaker High Availability clusters for SAP HANA and SAP Netweaver systems on various infrastructure platforms. @@ -50,8 +50,6 @@ Managed nodes: **:warning: This ansible role will destroy and then recreate Linux Pacemaker cluster in process.**
:warning: Do not execute this Ansible Role against existing Linux Pacemaker clusters unless you know what you are doing and you prepare inputs according to existing cluster. -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. - ### Supported Platforms | Platform | Status | Notes | | -------- | --------- | --------- | @@ -144,6 +142,8 @@ It is recommended to execute this role together with other roles in this collect ## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. + Cluster can be further customized with inputs available from underlying role [ha_cluster](https://github.com/linux-system-roles/ha_cluster/blob/main/README.md), which will take precedence over `sap_ha_pacemaker_cluster` inputs. @@ -158,5 +158,1024 @@ Apache 2.0 - [Marcel Mamula](https://github.com/marcelmamula) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_ha_pacemaker_cluster/INPUT_PARAMETERS.md) +## Role Variables + +Minimum required parameters for all clusters: + +- [sap_ha_pacemaker_cluster_hacluster_user_password](#sap_ha_pacemaker_cluster_hacluster_user_password) + +Additional minimum requirements depend on the type of cluster setup and on the target platform. + +### sap_ha_pacemaker_cluster_hacluster_user_password + +- _Type:_ `string` + +**Mandatory Input Parameter.**
+The password of the `hacluster` user which is created during pacemaker installation.
+Inherits the value of `ha_cluster_hacluster_password`, when defined.
+ + +### sap_ha_pacemaker_cluster_aws_access_key_id + +- _Type:_ `string` + +AWS access key to allow control of instances (for example for fencing operations).
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
+ +### sap_ha_pacemaker_cluster_aws_credentials_setup + +- _Type:_ `string` + +Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
+Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+ +### sap_ha_pacemaker_cluster_aws_region + +- _Type:_ `string` + +The AWS region in which the instances to be used for the cluster setup are located.
+Mandatory for cluster nodes setup on AWS EC2 instances.
+ +### sap_ha_pacemaker_cluster_aws_secret_access_key + +- _Type:_ `string` + +AWS secret key, paired with the access key for instance control.
+Mandatory for the cluster nodes setup on AWS EC2 instances, when:
+1. IAM Role or Instance profile is not attached to EC2 instance.
+2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
+ +### sap_ha_pacemaker_cluster_aws_vip_update_rt + +- _Type:_ `string` + +List one more routing table IDs for managing Virtual IP failover through routing table changes.
+Multiple routing tables must be defined as a comma-separated string (no spaces).
+Mandatory for the VIP resource configuration in AWS EC2 environments.
+ +### sap_ha_pacemaker_cluster_cluster_name + +- _Type:_ `string` + +The name of the pacemaker cluster.
+Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +### sap_ha_pacemaker_cluster_cluster_nodes + +- _Type:_ `list` + +List of cluster nodes and associated attributes to describe the target SAP HA environment.
+This is required for the HANA System Replication configuration.
+Synonym for this parameter is `sap_hana_cluster_nodes`.
+Mandatory to be defined for HANA clusters.
+ +- **hana_site**
+ Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +- **node_ip**
+ IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +- **node_name**
+ Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +- **node_role**
+ Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ + +Example: + +```yaml +sap_ha_pacemaker_cluster_cluster_nodes: +- hana_site: DC01 + node_ip: 192.168.5.1 + node_name: nodeA + node_role: primary +- hana_site: DC02 +``` + +### sap_ha_pacemaker_cluster_cluster_properties + +- _Type:_ `dict` +- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` + +Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
+When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_cluster_properties: + concurrent-fencing: true + stonith-enabled: true + stonith-timeout: 900 +``` + +### sap_ha_pacemaker_cluster_create_config_dest + +- _Type:_ `string` +- _Default:_ `review_resource_config.yml` + +The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
+Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file.
+Specify a path/filename to save the file in a custom location.
+The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role.
+ +### sap_ha_pacemaker_cluster_create_config_varfile + +- _Type:_ `bool` +- _Default:_ `False` + +When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format.
+This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role.
+When enabled this parameters file is also created when the playbook is run in check_mode (`--check`) and can be used to review the configuration parameters without executing actual changes on the target nodes.
+WARNING! This report may include sensitive details like secrets required for certain cluster resources!
+ +### sap_ha_pacemaker_cluster_enable_cluster_connector + +- _Type:_ `bool` +- _Default:_ `True` + +Enables/Disables the SAP HA Interface for SAP ABAP application server instances, also known as `sap_cluster_connector`.
+Set this parameter to 'false' if the SAP HA interface should not be installed and configured.
+ +### sap_ha_pacemaker_cluster_extra_packages + +- _Type:_ `list` + +Additional extra packages to be installed, for instance specific resource packages.
+For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
+ +### sap_ha_pacemaker_cluster_fence_agent_packages + +- _Type:_ `list` + +Additional fence agent packages to be installed.
+This is automatically combined with default packages in:
+`__sap_ha_pacemaker_cluster_fence_agent_packages_minimal`
+`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
+ +### sap_ha_pacemaker_cluster_gcp_project + +- _Type:_ `string` + +Google Cloud project name in which the target instances are installed.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_gcp_region_zone + +- _Type:_ `string` + +Google Cloud Platform region zone ID.
+Mandatory for the cluster setup on GCP instances.
+ +### sap_ha_pacemaker_cluster_ha_cluster + +- _Type:_ `dict` + +The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
+Optional _**host_vars**_ parameter - if defined it must be set for each node.
+Dictionary that can contain various node options for the pacemaker cluster configuration.
+Supported options can be reviewed in the `ha_cluster` Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].
+If not defined, the `ha_cluster` Linux System Role default will be used.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_ha_cluster: + corosync_addresses: + - 192.168.1.10 + - 192.168.2.10 + node_name: nodeA +``` + +### sap_ha_pacemaker_cluster_hana_automated_register + +- _Type:_ `bool` +- _Default:_ `True` + +Parameter for the 'SAPHana' cluster resource.
+Define if a former primary should be re-registered automatically as secondary.
+ +### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name + +- _Type:_ `string` +- _Default:_ `col_saphana_vip__HDB_primary` + +Customize the cluster constraint name for VIP and SAPHana primary clone colocation.
+ +### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name + +- _Type:_ `string` +- _Default:_ `col_saphana_vip__HDB_readonly` + +Customize the cluster constraint name for VIP and SAPHana secondary clone colocation.
+ +### sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout + +- _Type:_ `int` +- _Default:_ `7200` + +Parameter for the 'SAPHana' cluster resource.
+Time difference needed between to primary time stamps, if a dual-primary situation occurs.
+If the time difference is less than the time gap, then the cluster holds one or both instances in a "WAITING" status.
+This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
+ +### sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaFil__HDB` + +Customize the cluster resource name of the SAP HANA Filesystem clone.
+ +### sap_ha_pacemaker_cluster_hana_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaFil__HDB` + +Customize the cluster resource name of the SAP HANA Filesystem.
+ +### sap_ha_pacemaker_cluster_hana_global_ini_path + +- _Type:_ `string` +- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini` + +Path with location of global.ini for srHook update
+ +### sap_ha_pacemaker_cluster_hana_hook_chksrv + +- _Type:_ `bool` +- _Default:_ `False` + +Controls if ChkSrv srHook is enabled during srHook creation.
+It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
+ +### sap_ha_pacemaker_cluster_hana_hook_tkover + +- _Type:_ `bool` +- _Default:_ `False` + +Controls if TkOver srHook is enabled during srHook creation.
+It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
+ +### sap_ha_pacemaker_cluster_hana_hooks + +- _Type:_ `list` +- _Default:_ `[]` + +Customize required list of SAP HANA Hooks
+Mandatory to include SAPHanaSR srHook in list.
+Mandatory attributes are provider and path.
+Example below shows mandatory SAPHanaSR, TkOver and ChkSrv hooks.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_hana_hooks: +- options: + - name: execution_order + value: 1 + path: /usr/share/SAPHanaSR/ + provider: SAPHanaSR +- options: + - name: execution_order + value: 2 + path: /usr/share/SAPHanaSR/ + provider: susTkOver +- options: + - name: execution_order + value: 3 + - name: action_on_lost + value: stop + path: /usr/share/SAPHanaSR/ + provider: susChkSrv +``` + +### sap_ha_pacemaker_cluster_hana_instance_nr + +- _Type:_ `string` + +The instance number of the SAP HANA database which this role will configure in the cluster.
+Inherits the value of `sap_hana_instance_number`, when defined.
+Mandatory for SAP HANA cluster setups.
+ +### sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_vip__HDB_primary` + +Customize the cluster constraint name for VIP and SAPHana primary clone order.
+ +### sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_vip__HDB_readonly` + +Customize the cluster constraint name for VIP and SAPHana secondary clone order.
+ +### sap_ha_pacemaker_cluster_hana_order_topology_hana_name + +- _Type:_ `string` +- _Default:_ `ord_saphana_saphanatop__HDB` + +Customize the cluster constraint name for SAPHana and Topology order.
+ +### sap_ha_pacemaker_cluster_hana_prefer_site_takeover + +- _Type:_ `bool` +- _Default:_ `True` + +Parameter for the 'SAPHana' cluster resource.
+Set to "false" if the cluster should first attempt to restart the instance on the same node.
+When set to "true" (default) a failover to secondary will be initiated on resource failure.
+ +### sap_ha_pacemaker_cluster_hana_resource_clone_msl_name + +- _Type:_ `string` +- _Default:_ `msl_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource master slave clone.
+Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
+ +### sap_ha_pacemaker_cluster_hana_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource clone.
+ +### sap_ha_pacemaker_cluster_hana_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHana__HDB` + +Customize the cluster resource name of the SAP HANA DB resource.
+ +### sap_ha_pacemaker_cluster_hana_sid + +- _Type:_ `string` + +The SAP HANA SID of the instance that will be configured in the cluster.
+The SID must follow SAP specifications - see SAP Note 1979280.
+Inherits the value of `sap_hana_sid`, when defined.
+Mandatory for SAP HANA cluster setups.
+ +### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaTop__HDB` + +Customize the cluster resource name of the SAP HANA Topology resource clone.
+ +### sap_ha_pacemaker_cluster_hana_topology_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaTop__HDB` + +Customize the cluster resource name of the SAP HANA Topology resource.
+ +### sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_SAPHanaCon__HDB` + +Customize the cluster resource name of the SAP HANA Controller clone.
+ +### sap_ha_pacemaker_cluster_hanacontroller_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPHanaCon__HDB` + +Customize the cluster resource name of the SAP HANA Controller.
+ +### sap_ha_pacemaker_cluster_host_type + +- _Type:_ `list` +- _Default:_ `hana_scaleup_perf` + +The SAP landscape to for which the cluster is to be configured.
+The default is a 2-node SAP HANA scale-up cluster.
+ +### sap_ha_pacemaker_cluster_ibmcloud_api_key + +- _Type:_ `string` + +The API key which is required to allow the control of instances (for example for fencing operations).
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type + +- _Type:_ `string` + +IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
+Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url + +- _Type:_ `string` + +IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
+When public network interface, can be ignored.
+When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn + +- _Type:_ `string` + +IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
+Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
+ +### sap_ha_pacemaker_cluster_ibmcloud_region + +- _Type:_ `string` + +The IBM Cloud VS region name in which the instances are running.
+Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
+ +### sap_ha_pacemaker_cluster_msazure_resource_group + +- _Type:_ `string` + +Resource group name/ID in which the target instances are defined.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_msazure_subscription_id + +- _Type:_ `string` + +Subscription ID of the MS Azure environment containing the target instances.
+Mandatory for the cluster setup on MS Azure instances.
+ +### sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP AAS instance.
+Mandatory for NetWeaver AAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + +- _Type:_ `bool` +- _Default:_ `False` + +The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
+Set this parameter to 'true' to configure it as ENSA1.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + +- _Type:_ `bool` +- _Default:_ `True` + +Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount
+Set this parameter to 'true' to configure ENSA2 Simple Mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__ASCS` + +Name of the filesystem resource for the ASCS instance.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness + +- _Type:_ `string` +- _Default:_ `3000` + +NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool + +- _Type:_ `bool` +- _Default:_ `False` + +NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout + +- _Type:_ `string` +- _Default:_ `60` + +NetWeaver ASCS instance failure-timeout attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold + +- _Type:_ `string` +- _Default:_ `1` + +NetWeaver ASCS instance migration-threshold setting attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name + +- _Type:_ `string` + +The name of the ASCS instance, typically the profile name.
+Mandatory for the NetWeaver ASCS/ERS cluster setup
+Recommended format _ASCS_.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPInstance__ASCS` + +Name of the ASCS instance resource.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness + +- _Type:_ `string` +- _Default:_ `5000` + +NetWeaver ASCS instance resource stickiness attribute.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string + +- _Type:_ `string` + +The full path and name of the ASCS instance profile.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPStartSrv__ASCS` + +Name of the ASCS SAPStartSrv resource for simple mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__ERS` + +Name of the filesystem resource for the ERS instance.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool + +- _Type:_ `bool` +- _Default:_ `False` + +NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name + +- _Type:_ `string` + +The name of the ERS instance, typically the profile name.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
+Recommended format _ERS_.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPInstance__ERS` + +Name of the ERS instance resource.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string + +- _Type:_ `string` + +The full path and name of the ERS instance profile.
+Mandatory for the NetWeaver ASCS/ERS cluster.
+ +### sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_SAPStartSrv__ERS` + +Name of the ERS SAPstartSrv resource for simple mount.
+ +### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + +- _Type:_ `string` + +Instance number of the NetWeaver ABAP PAS instance.
+Mandatory for NetWeaver PAS cluster configuration.
+ +### sap_ha_pacemaker_cluster_nwas_abap_sid + +- _Type:_ `string` + +SID of the NetWeaver instances.
+Mandatory for NetWeaver cluster configuration.
+Uses `sap_swpm_sid` if defined.
+Mandatory for NetWeaver cluster setups.
+ +### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name + +- _Type:_ `string` +- _Default:_ `col_ascs_separate_` + +Customize the cluster constraint name for ASCS and ERS separation colocation.
+ +### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name + +- _Type:_ `string` +- _Default:_ `ord_ascs_first_` + +Customize the cluster constraint name for ASCS starting before ERS order.
+ +### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__sapmnt` + +Filesystem resource clone name for the shared filesystem /sapmnt.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__sapmnt` + +Filesystem resource name for the shared filesystem /sapmnt.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed + +- _Type:_ `bool` +- _Default:_ `False` + +Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
+ +### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__sys` + +Filesystem resource clone name for the shared filesystem /usr/sap//SYS.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__sys` + +Filesystem resource name for the transports filesystem /usr/sap//SYS.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name + +- _Type:_ `string` +- _Default:_ `cln_fs__trans` + +Filesystem resource clone name for the shared filesystem /usr/sap/trans.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_fs__trans` + +Filesystem resource name for the transports filesystem /usr/sap/trans.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+ +### sap_ha_pacemaker_cluster_operation_defaults + +- _Type:_ `dict` +- _Default:_ `{'record-pending': True, 'timeout': 600}` + +Set default operation parameters that will be valid for all pacemaker resources.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_operation_defaults: + record-pending: true + timeout: 600 +``` + +### sap_ha_pacemaker_cluster_resource_defaults + +- _Type:_ `dict` +- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` + +Set default parameters that will be valid for all pacemaker resources.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_resource_defaults: + migration-threshold: 5000 + resource-stickiness: 1000 +``` + +### sap_ha_pacemaker_cluster_saphanasr_angi_detection + +- _Type:_ `string` +- _Default:_ `True` + +Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
+ +### sap_ha_pacemaker_cluster_sbd_devices + +- _Type:_ `list` + +Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of block devices for Stonith SBD agent
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +``` + +### sap_ha_pacemaker_cluster_sbd_enabled + +- _Type:_ `bool` + +Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
+Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
+Default SBD agents are: `stonith:external/sbd` for SUSE and `stonith:fence_sbd` for Red Hat.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_devices: +- /dev/disk/by-id/scsi-3600 +sap_ha_pacemaker_cluster_sbd_enabled: true +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:external/sbd + id: stonith_sbd + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 15 +``` + +### sap_ha_pacemaker_cluster_sbd_options + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of SBD specific options that are added into SBD configuration file.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_options: +- name: startmode + value: clean +``` + +### sap_ha_pacemaker_cluster_sbd_watchdog + +- _Type:_ `str` +- _Default:_ `/dev/watchdog` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide watchdog name to override default /dev/watchdog
+ +### sap_ha_pacemaker_cluster_sbd_watchdog_modules + +- _Type:_ `list` + +Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
+Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_sbd_watchdog_modules: +- softdog +``` + +### sap_ha_pacemaker_cluster_stonith_custom + +- _Type:_ `list` + +Custom list of STONITH resource(s) to be configured in the cluster.
+This definition override any defaults the role would apply otherwise.
+Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
+ +- **agent**
+ Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. +- **id**
+ Parameter `id` is required.
Name that will be used as the resource ID (name). +- **instance_attrs**
+ Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. +- **meta_attrs**
+ Defines meta attributes as list of name/value pairs. +- **name**
+ WARNING! This option will be removed in future release. +- **operations**
+ Defines list of resource agent operations. +- **options**
+ WARNING! This option will be removed in future release. + +Example: + +```yaml +sap_ha_pacemaker_cluster_stonith_custom: +- agent: stonith:fence_rhevm + id: my-fence-resource + instance_attrs: + - attrs: + - name: ip + value: rhevm-server + - name: username + value: login-user + - name: password + value: login-user-password + - name: pcmk_host_list + value: node1,node2 + - name: power_wait + value: 3 + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 +``` + +### sap_ha_pacemaker_cluster_storage_definition + +- _Type:_ `list` + +List of filesystem definitions used for filesystem cluster resources.
+Options relevant, see example.
+Mandatory for SAP NetWeaver HA cluster configurations.
+Reuse `sap_storage_setup_definition` if defined.
+Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'.
+Reuse `sap_storage_setup_definition` all options are documented under Ansible Role `sap_storage_setup`.
+Note! For this variable, the argument specification does not list options, to avoid errors during reuse of `sap_storage_setup_definition` if defined.
+ +Example: + +```yaml +sap_ha_pacemaker_cluster_storage_definition: +- mountpoint: /usr/sap + name: usr_sap + nfs_path: /usr/sap + nfs_server: nfs-server.example.com:/ +- mountpoint: /usr/sap/trans + name: usr_sap_trans + nfs_path: /usr/sap/trans + nfs_server: nfs-server.example.com:/ +- mountpoint: /sapmnt + name: sapmnt + nfs_filesystem_type: nfs + nfs_mount_options: defaults + nfs_path: /sapmnt + nfs_server: nfs-server.example.com:/ +``` + +### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type + +- _Type:_ `string` +- _Default:_ `nfs` + +Filesystem type of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_mount_options + +- _Type:_ `string` +- _Default:_ `defaults` + +Mount options of the NFS filesystems that are part of the cluster configuration.
+ +### sap_ha_pacemaker_cluster_storage_nfs_server + +- _Type:_ `string` + +Default address of the NFS server, if not defined individually by filesystem.
+ +### sap_ha_pacemaker_cluster_system_roles_collection + +- _Type:_ `string` +- _Default:_ `fedora.linux_system_roles` + +Set which Ansible Collection to use for the Linux System Roles.
+Available values: +- `fedora.linux_system_roles` - for community/upstream.
+- `redhat.rhel_system_roles` - for the RHEL System Roles for SAP, or for Red Hat Automation Hub.
+ +### sap_ha_pacemaker_cluster_vip_client_interface + +- _Type:_ `string` + +OS device name of the network interface to use for the Virtual IP configuration.
+When there is only one interface on the system, its name will be used by default.
+ +### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address + +- _Type:_ `string` + +The virtual IP of the primary HANA instance.
+Mandatory parameter for HANA clusters.
+ +### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__HDB_primary` + +Customize the name of the resource managing the Virtual IP of the primary HANA instance.
+ +### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address + +- _Type:_ `string` + +The virtual IP for read-only access to the secondary HANA instance.
+Optional parameter in HANA clusters.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver AAS instance.
+Mandatory for NetWeaver AAS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__AAS` + +Name of the SAPInstance resource for NetWeaver AAS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver ASCS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name + +- _Type:_ `string` +- _Default:_ `grp__ASCS` + +Name of the NetWeaver ASCS resource group.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__ASCS` + +Name of the SAPInstance resource for NetWeaver ASCS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver ERS instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name + +- _Type:_ `string` +- _Default:_ `grp__ERS` + +Name of the NetWeaver ERS resource group.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__ERS` + +Name of the SAPInstance resource for NetWeaver ERS.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address + +- _Type:_ `string` + +Virtual IP of the NetWeaver PAS instance.
+Mandatory for NetWeaver PAS cluster setup.
+ +### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__PAS` + +Name of the SAPInstance resource for NetWeaver PAS.
+ +### sap_ha_pacemaker_cluster_vip_secondary_resource_name + +- _Type:_ `string` +- _Default:_ `rsc_vip__HDB_readonly` + +Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
+ \ No newline at end of file diff --git a/roles/sap_hana_install/INPUT_PARAMETERS.md b/roles/sap_hana_install/INPUT_PARAMETERS.md deleted file mode 100644 index 93f909fb8..000000000 --- a/roles/sap_hana_install/INPUT_PARAMETERS.md +++ /dev/null @@ -1,59 +0,0 @@ -## Input Parameters for sap_ha_pacemaker_cluster Ansible Role - -### sap_hana_install_sid - -- _Type:_ `string` - -Enter SAP HANA System ID (SID). - -### sap_hana_install_number - -- _Type:_ `string` - -Enter SAP HANA Instance number. - -### sap_hana_install_fapolicyd_integrity - -- _Type:_ `string` -- _Default:_ `sha256` - -Select fapolicyd integrity check option out of: `none`, `size`, `sha256`, `ima`. - -### sap_hana_install_check_sidadm_user - -- _Type:_ `bool` -- _Default:_ `True` - -If the variable `sap_hana_install_check_sidadm_user` is set to `False`, the role will install SAP HANA even -if the sidadm user exists. Default is `True`, in which case the installation will not be performed if the -sidadm user exists. - -### sap_hana_install_new_system - -- _Type:_ `bool` -- _Default:_ `True` - -The variable `sap_hana_install_new_system` determines if the role will perform a fresh SAP HANA installation -or if it will add further hosts to an existing SAP HANA system as specified by variable -`sap_hana_install_addhosts`. Default is `True` for a fresh SAP HANA installation. - -### sap_hana_install_update_firewall - -- _Type:_ `bool` -- _Default:_ `False` - -The role can be configured to also set the required firewall ports for SAP HANA. If this is desired, set -the variable `sap_hana_install_update_firewall` to `yes` (default is `no`). The firewall ports are defined -in a variable which is compatible with the variable structure used by Linux System Role `firewall`. -The firewall ports for SAP HANA are defined in member `port` of the first field of variable -`sap_hana_install_firewall` (`sap_hana_install_firewall[0].port`), see file `defaults/main.yml`. If the -member `state` is set to `enabled`, the ports will be enabled. If the member `state` is set to `disabled`, -the ports will be disabled, which might be useful for testing. - -Certain parameters have identical meanings, for supporting different naming schemes in playbooks and inventories. -You can find those in the task `Rename some variables used by hdblcm configfile` of the file `tasks/main.yml`. -Example: The parameter `sap_hana_install_number`, which is used by the role to define the hdblm parameter `number` -(= SAP HANA instance number) can be defined by setting `sap_hana_instance_number`, `sap_hana_install_instance_nr`, -`sap_hana_install_instance_number`, or `sap_hana_install_number`. The order of precedence is from left to right. - - \ No newline at end of file diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index efd9bc842..265c7f92e 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -5,7 +5,7 @@ ## Description -Ansible Role `sap_hana_install` is used to install SAP HANA database using HDBLCM. +The Ansible role `sap_hana_install` installs SAP HANA using the SAP HANA database lifecycle manager (HDBLCM). @@ -143,7 +143,6 @@ of this file will not be reflected. ## Execution -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -374,6 +373,8 @@ With the following tags, the role can be called to perform certain activities on +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -386,5 +387,57 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hana_install/INPUT_PARAMETERS.md) +## Role Variables + +### sap_hana_install_sid + +- _Type:_ `string` + +Enter SAP HANA System ID (SID). + +### sap_hana_install_number + +- _Type:_ `string` + +Enter SAP HANA Instance number. + +### sap_hana_install_fapolicyd_integrity + +- _Type:_ `string` +- _Default:_ `sha256` + +Select `fapolicyd` integrity check option.
+Available values: `none`, `size`, `sha256`, `ima`. + +### sap_hana_install_check_sidadm_user + +- _Type:_ `bool` +- _Default:_ `True` + +Set to `False` to install SAP HANA even if the `sidadm` user exists.
+Default is `True`, in which case the installation will not be performed if the `sidadm` user exists. + +### sap_hana_install_new_system + +- _Type:_ `bool` +- _Default:_ `True` + +Set to `False` to use existing SAP HANA database and add more hosts using variable `sap_hana_install_addhosts`.
+Default is `True`, in which case fresh SAP HANA installation will be performed. + +### sap_hana_install_update_firewall + +- _Type:_ `bool` +- _Default:_ `False` + +The role can be configured to also set the required firewall ports for SAP HANA. If this is desired, set the variable `sap_hana_install_update_firewall` to `yes` (default is `no`).
+The firewall ports are defined in a variable which is compatible with the variable structure used by Linux System Role `firewall`.
+The firewall ports for SAP HANA are defined in member `port` of the first field of variable `sap_hana_install_firewall` (`sap_hana_install_firewall[0].port`), see file `defaults/main.yml`.
+If the member `state` is set to `enabled`, the ports will be enabled. If the member `state` is set to `disabled`, the ports will be disabled, which might be useful for testing.
+ +Certain parameters have identical meanings, for supporting different naming schemes in playbooks and inventories.
+You can find those in the task `Rename some variables used by hdblcm configfile` of the file `tasks/main.yml`.
+Example: The parameter `sap_hana_install_number`, which is used by the role to define the hdblm parameter `number` (= SAP HANA instance number)
+ can be defined by setting `sap_hana_instance_number`, `sap_hana_install_instance_nr`, `sap_hana_install_instance_number`, or `sap_hana_install_number`.
+ The order of precedence is from left to right. + \ No newline at end of file diff --git a/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md b/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md deleted file mode 100644 index 5cd5c87e9..000000000 --- a/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md +++ /dev/null @@ -1,324 +0,0 @@ -## Input Parameters for sap_hana_preconfigure Ansible Role - -## Role Input Parameters - -#### Minimum required parameters: - -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_hana_preconfigure_config_all -- _Type:_ `bool` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_hana_preconfigure_installation -- _Type:_ `bool` - -If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_hana_preconfigure_configuration -- _Type:_ `bool` - -If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
- -Example: - -```yaml -sap_hana_preconfigure_config_all: false -sap_hana_preconfigure_configuration: true -sap_hana_preconfigure_2772999_04: true -sap_hana_preconfigure_2382421: true -``` - -### sap_hana_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_hana_preconfigure_assert_all_config -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will check either tuned or static settings.
-If this parameter is set to to `true`, the role will check both tuned and static settings.
- -### sap_hana_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_hana_preconfigure_system_roles_collection -- _Type:_ `str` -- _Default:_ `'fedora.linux_system_roles'` -- _Possible Values:_
- - `fedora.linux_system_roles` - - `redhat.rhel_system_roles` - -Set which Ansible Collection to use for the Linux System Roles.
-For community/upstream, use 'fedora.linux_system_roles'
-For the RHEL System Roles for SAP, or for Red Hat Automation Hub, use 'redhat.rhel_system_roles'
- -### sap_hana_preconfigure_min_rhel_release_check -- _Type:_ `bool` -- _Default:_ `false` - -Check the RHEL release against parameter `sap_hana_preconfigure_supported_rhel_minor_releases`, which is a list of
-known SAP HANA supported RHEL minor releases. By default, the role will display a message and continue running if
-the RHEL release is not part of that list. If set to `true`, the role will fail in such a case.
- -### sap_hana_preconfigure_supported_rhel_minor_releases -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA supported RHEL minor releases.
- -### sap_hana_preconfigure_enable_sap_hana_repos -- _Type:_ `bool` -- _Default:_ `false` - -Set to 'true' to enable the SAP HANA required RHEL repos.
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_use_hana_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_7_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 7 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_7_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 7 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_8_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 8 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_8_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 8 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_9_x86_64 -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 9 repos on x86_64'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_req_repos_redhat_9_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Use this parameter to set your own list of SAP HANA required RHEL 9 repos on ppc64le'
-This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
-The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
- -### sap_hana_preconfigure_set_minor_release -- _Type:_ `bool` -- _Default:_ `false` - -Use this parameter to set the RHEL minor release, which is required for SAP HANA.
-The related parameter is `sap_general_preconfigure_set_minor_release`.
- -### sap_hana_preconfigure_create_directories -- _Type:_ `bool` -- _Default:_ `true` - -Set to `false` if you do not want the SAP HANA directories to be created by the role.
-The SAP HANA directories will always be created if `sap_hana_preconfigure_modify_selinux_labels`
-(see below) is set to `true`, no matter how `sap_hana_preconfigure_create_directories` is set.
- -### sap_hana_preconfigure_hana_directories -- _Type:_ `list` with elements of type `str` -- _Default:_ - - /hana - - /lss/shared - -List of SAP HANA directories to be created.
- -### sap_hana_preconfigure_modify_selinux_labels -- _Type:_ `bool` -- _Default:_ `true` - -For compatibility of SAP HANA with SELinux in enforcing mode, the role will recursively add
-the `usr_t` label to directories and files in the directories where HANA is installed.
-If relabeling not desired, set this parameter `false`.
-If the variable is set to `true`, the SAP HANA directories will be created no matter
-how the variable `sap_hana_preconfigure_create_directories` (see above) is set.
- -### sap_hana_preconfigure_packages -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list
-or a list of the minimum required packages for SAP HANA server (parameter `__sap_hana_preconfigure_packages_min_install`).
- -### sap_hana_preconfigure_min_package_check -- _Type:_ `bool` -- _Default:_ `true` - -SAP HANA requires certain minimum package versions to be supported. These minimum levels are listed in SAP Note 2235581.
-Set this parameter to `false` if you want to ignore these requirements.
- -### sap_hana_preconfigure_update -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` to update the system to the latest package levels.
-By setting the parameter `sap_general_preconfigure_set_minor_release` of the
-role `sap_general_preconfigure` to `true`, you can install the most recent package updates
-without updating to a more recent RHEL minor release.
- -### sap_hana_preconfigure_reboot_ok -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` if you want to perform a reboot at the end of the role, if necessary.
- -### sap_hana_preconfigure_fail_if_reboot_required -- _Type:_ `bool` -- _Default:_ `true` - -If `sap_hana_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
-remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
-Can be useful if you want to implement your own reboot handling.
- -### sap_hana_preconfigure_kernel_parameters -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Network related linux kernel parameter settings for SAP HANA on all hardware platforms.
- -### sap_hana_preconfigure_kernel_parameters_ppc64le -- _Type:_ `list` with elements of type `str` -- _Default:_ (set by platform/environment specific variables) - -Network related linux kernel parameter settings for platform ppc64le.
- -### sap_hana_preconfigure_use_netapp_settings_nfs -- _Type:_ `bool` -- _Default:_ `false` - -Set to `true` to also set NetApp NFS required kernel parameters.
- -### sap_hana_preconfigure_install_ibm_power_tools -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
- -### sap_hana_preconfigure_add_ibm_power_repo -- _Type:_ `bool` -- _Default:_ `true` - -Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
-are already available on the local network). The IBM Power Systems service and productivity tools will only
-be installed if the variable `sap_hana_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
- -### sap_hana_preconfigure_ibm_power_repo_url -- _Type:_ `str` -- _Default:_ (set by platform/environment specific variables) - -URL of the IBM Power tools repository.
- -### sap_hana_preconfigure_ppcle_mtu9000_if -- _Type:_ `str` -- _Default:_ `''` - -List of interfaces for which the MTU size will be set to `9000`.
- -### sap_hana_preconfigure_ppcle_tso_if -- _Type:_ `list` with elements of type `str` -- _Default:_ - '{{ ansible_interfaces | difference([''lo'']) }}' - -List of interfaces for which the tso flag will be set.
- -### sap_hana_preconfigure_use_tuned -- _Type:_ `bool` -- _Default:_ `true` - -Use tuned for configuring most of the kernel settings for SAP HANA
-Set this parameter to `false` to use static kernel settings
- -### sap_hana_preconfigure_tuned_profile -- _Type:_ `str` -- _Default:_ `'sap-hana'` - -Name of the SAP HANA tuned tuned profile to enable (RHEL).
- -### sap_hana_preconfigure_modify_grub_cmdline_linux -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` to modify the Grub boot command line.
- -### sap_hana_preconfigure_run_grub2_mkconfig -- _Type:_ `bool` -- _Default:_ `true` - -By default, the role will run `grub2-mkconfig` to update the Grub configuration if necessary.
-Set this parameter to `false` if this is not desired.
- -### sap_hana_preconfigure_db_group_name -- _Type:_ `str` - -Use this parameter to specify the name of the RHEL group which is used for the database processes.
-It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999.
- -Example: - -```yaml -sap_hana_preconfigure_db_group_name: dba -``` - -### sap_hana_preconfigure_saptune_version -- _Type:_ `str` -- _Default:_ `''` - -Version of saptune to install (SLES for SAP Applications).
-This will replace the current installed version if present, even downgrade if necessary.
- -### sap_hana_preconfigure_saptune_solution -- _Type:_ `str` -- _Default:_ `'HANA'` -- _Possible Values:_
- - `HANA` - - `NETWEAVER+HANA` - - `S4HANA-APP+DB` - - `S4HANA-DBSERVER` - -The saptune solution to apply (SLES for SAP Applications).
- -### sap_hana_preconfigure_saptune_azure -- _Type:_ `bool` -- _Default:_ `false` - -On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications).
-If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
-Set this parameter to `true` on Azure.
- - \ No newline at end of file diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index f141faac4..d96e075b0 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -5,9 +5,7 @@ ## Description -Ansible Role `sap_hana_preconfigure` is used to ensure that Managed nodes are configured to host SAP HANA systems according to SAP Notes after [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) role was executed. - -This role performs installation of required packages for running SAP HANA systems and configuration of Operating system parameters. +The Ansible role `sap_hana_preconfigure` installs additional required packages and performs additional OS configuration steps according to applicable SAP notes for installing and running SAP HANA after the role [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) has been executed. @@ -86,8 +84,6 @@ Managed nodes: **:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** **NOTE: It is recommended to execute `timesync` role from Ansible Collection `fedora.linux_system_roles` before or after executing this role.** - -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -130,6 +126,8 @@ Example of execution together with prerequisite role [sap_general_preconfigure]( +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -142,5 +140,313 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hana_preconfigure/INPUT_PARAMETERS.md) +## Role Variables + +### sap_hana_preconfigure_config_all +- _Type:_ `bool` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_hana_preconfigure_installation +- _Type:_ `bool` + +If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_hana_preconfigure_configuration +- _Type:_ `bool` + +If `sap_hana_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes for which the corresponding SAP notes parameters have been set to `true`.
+ +Example: + +```yaml +sap_hana_preconfigure_config_all: false +sap_hana_preconfigure_configuration: true +sap_hana_preconfigure_2772999_04: true +sap_hana_preconfigure_2382421: true +``` + +### sap_hana_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_hana_preconfigure_assert_all_config +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will check either tuned or static settings.
+If this parameter is set to to `true`, the role will check both tuned and static settings.
+ +### sap_hana_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_hana_preconfigure_system_roles_collection +- _Type:_ `str` +- _Default:_ `'fedora.linux_system_roles'` + +Set which Ansible Collection to use for the Linux System Roles.
+Available values: +- `fedora.linux_system_roles` - for community/upstream.
+- `redhat.rhel_system_roles` - for the RHEL System Roles for SAP, or for Red Hat Automation Hub.
+ +### sap_hana_preconfigure_min_rhel_release_check +- _Type:_ `bool` +- _Default:_ `false` + +Check the RHEL release against parameter `sap_hana_preconfigure_supported_rhel_minor_releases`, which is a list of
+known SAP HANA supported RHEL minor releases. By default, the role will display a message and continue running if
+the RHEL release is not part of that list. If set to `true`, the role will fail in such a case.
+ +### sap_hana_preconfigure_supported_rhel_minor_releases +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA supported RHEL minor releases.
+ +### sap_hana_preconfigure_enable_sap_hana_repos +- _Type:_ `bool` +- _Default:_ `false` + +Set to 'true' to enable the SAP HANA required RHEL repos.
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_use_hana_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_7_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 7 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_7_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 7 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_8_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 8 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_8_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 8 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_9_x86_64 +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 9 repos on x86_64'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_req_repos_redhat_9_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Use this parameter to set your own list of SAP HANA required RHEL 9 repos on ppc64le'
+This parameter is deprecated because the role sap_general_preconfigure can be used for this purpose.
+The related parameters are `sap_general_preconfigure_enable_repos` and `sap_general_preconfigure_req_repos`.
+ +### sap_hana_preconfigure_set_minor_release +- _Type:_ `bool` +- _Default:_ `false` + +Use this parameter to set the RHEL minor release, which is required for SAP HANA.
+The related parameter is `sap_general_preconfigure_set_minor_release`.
+ +### sap_hana_preconfigure_create_directories +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` if you do not want the SAP HANA directories to be created by the role.
+The SAP HANA directories will always be created if `sap_hana_preconfigure_modify_selinux_labels`
+(see below) is set to `true`, no matter how `sap_hana_preconfigure_create_directories` is set.
+ +### sap_hana_preconfigure_hana_directories +- _Type:_ `list` with elements of type `str` +- _Default:_ + - /hana + - /lss/shared + +List of SAP HANA directories to be created.
+ +### sap_hana_preconfigure_modify_selinux_labels +- _Type:_ `bool` +- _Default:_ `true` + +For compatibility of SAP HANA with SELinux in enforcing mode, the role will recursively add
+the `usr_t` label to directories and files in the directories where HANA is installed.
+If relabeling not desired, set this parameter `false`.
+If the variable is set to `true`, the SAP HANA directories will be created no matter
+how the variable `sap_hana_preconfigure_create_directories` (see above) is set.
+ +### sap_hana_preconfigure_packages +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list
+or a list of the minimum required packages for SAP HANA server (parameter `__sap_hana_preconfigure_packages_min_install`).
+ +### sap_hana_preconfigure_min_package_check +- _Type:_ `bool` +- _Default:_ `true` + +SAP HANA requires certain minimum package versions to be supported. These minimum levels are listed in SAP Note 2235581.
+Set this parameter to `false` if you want to ignore these requirements.
+ +### sap_hana_preconfigure_update +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` to update the system to the latest package levels.
+By setting the parameter `sap_general_preconfigure_set_minor_release` of the
+role `sap_general_preconfigure` to `true`, you can install the most recent package updates
+without updating to a more recent RHEL minor release.
+ +### sap_hana_preconfigure_reboot_ok +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` if you want to perform a reboot at the end of the role, if necessary.
+ +### sap_hana_preconfigure_fail_if_reboot_required +- _Type:_ `bool` +- _Default:_ `true` + +If `sap_hana_preconfigure_reboot_ok` is set to `false`, which is the default, a reboot requirement should not
+remain unnoticed. For this reason, we let the role fail. Set this parameter to `false` to override this behavior.
+Can be useful if you want to implement your own reboot handling.
+ +### sap_hana_preconfigure_kernel_parameters +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Network related linux kernel parameter settings for SAP HANA on all hardware platforms.
+ +### sap_hana_preconfigure_kernel_parameters_ppc64le +- _Type:_ `list` with elements of type `str` +- _Default:_ (set by platform/environment specific variables) + +Network related linux kernel parameter settings for platform ppc64le.
+ +### sap_hana_preconfigure_use_netapp_settings_nfs +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to also set NetApp NFS required kernel parameters.
+ +### sap_hana_preconfigure_install_ibm_power_tools +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` to not install the IBM Power Systems service and productivity tools.
+ +### sap_hana_preconfigure_add_ibm_power_repo +- _Type:_ `bool` +- _Default:_ `true` + +Set this parameter to `false` if you do not want to add the IBM Power tools repository (e.g. because the packages
+are already available on the local network). The IBM Power Systems service and productivity tools will only
+be installed if the variable `sap_hana_preconfigure_install_ibm_power_tools` is set to `true`, which is the default.
+ +### sap_hana_preconfigure_ibm_power_repo_url +- _Type:_ `str` +- _Default:_ (set by platform/environment specific variables) + +URL of the IBM Power tools repository.
+ +### sap_hana_preconfigure_ppcle_mtu9000_if +- _Type:_ `str` +- _Default:_ `''` + +List of interfaces for which the MTU size will be set to `9000`.
+ +### sap_hana_preconfigure_ppcle_tso_if +- _Type:_ `list` with elements of type `str` +- _Default:_ + '{{ ansible_interfaces | difference([''lo'']) }}' + +List of interfaces for which the tso flag will be set.
+ +### sap_hana_preconfigure_use_tuned +- _Type:_ `bool` +- _Default:_ `true` + +Use tuned for configuring most of the kernel settings for SAP HANA
+Set this parameter to `false` to use static kernel settings
+ +### sap_hana_preconfigure_tuned_profile +- _Type:_ `str` +- _Default:_ `'sap-hana'` + +Name of the SAP HANA tuned tuned profile to enable (RHEL).
+ +### sap_hana_preconfigure_modify_grub_cmdline_linux +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` to modify the Grub boot command line.
+ +### sap_hana_preconfigure_run_grub2_mkconfig +- _Type:_ `bool` +- _Default:_ `true` + +By default, the role will run `grub2-mkconfig` to update the Grub configuration if necessary.
+Set this parameter to `false` if this is not desired.
+ +### sap_hana_preconfigure_db_group_name +- _Type:_ `str` + +Use this parameter to specify the name of the RHEL group which is used for the database processes.
+It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999.
+ +Example: + +```yaml +sap_hana_preconfigure_db_group_name: dba +``` + +### sap_hana_preconfigure_saptune_version +- _Type:_ `str` +- _Default:_ `''` + +(SUSE specific) Specifies the saptune version.
+This will replace the current installed version if present, even downgrade if necessary.
+ +### sap_hana_preconfigure_saptune_solution +- _Type:_ `str` +- _Default:_ `'HANA'` + +(SUSE specific) Specifies the saptune solution to apply.
+Available values: `HANA`, `NETWEAVER+HANA`, `S4HANA-APP+DB`, `S4HANA-DBSERVER` + +### sap_hana_preconfigure_saptune_azure +- _Type:_ `bool` +- _Default:_ `false` + +(SUSE specific) On Azure, TCP timestamps, reuse and recycle should be disabled.
+If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
+Set this parameter to `true` on Azure.
+ \ No newline at end of file diff --git a/roles/sap_hostagent/INPUT_PARAMETERS.md b/roles/sap_hostagent/INPUT_PARAMETERS.md deleted file mode 100644 index 1b10434b8..000000000 --- a/roles/sap_hostagent/INPUT_PARAMETERS.md +++ /dev/null @@ -1,130 +0,0 @@ -## Input Parameters for sap_hostagent Ansible Role - - -### sap_hostagent_installation_type - -- _Type:_ `string` -- _Default:_ `rpm` - -Select type of installation source for SAPHOSTAGENT.
-Available options: `sar`, `sar-remote`, `bundle`, `rpm` - - -## Input Parameters for SAR -Following input parameters are used by both Local SAR and Remote SAR. - -### sap_hostagent_sar_file_name - -- _Type:_ `string` - -Name of SAR file containing SAPHOSTAGENT. - -### sap_hostagent_sapcar_file_name - -- _Type:_ `string` - -Name of SAR file containing SAPCAR. - -## Input Parameters for Local SAR - -### sap_hostagent_sar_local_path - -- _Type:_ `string` - -Local directory path where SAR file is located. Do not use together with `sap_hostagent_sar_remote_path`. - -### sap_hostagent_sapcar_local_path - -- _Type:_ `string` - -Local directory path where SAPCAR file is located. Do not use together with `sap_hostagent_sapcar_remote_path`. - -## Input Parameters for Remote SAR - -### sap_hostagent_sar_remote_path - -- _Type:_ `string` - -Remote directory path where SAR file is located. Do not use together with `sap_hostagent_sar_local_path`. - -### sap_hostagent_sapcar_remote_path - -- _Type:_ `string` - -Local directory path where SAPCAR file is located. Do not use together with `sap_hostagent_sapcar_local_path`. - - -## Input Parameters for RPM - -### sap_hostagent_rpm_local_path - -- _Type:_ `string` - -Local directory path where RPM file is located. Do not use together with `sap_hostagent_rpm_remote_path`. - -### sap_hostagent_rpm_remote_path - -- _Type:_ `string` - -Remote directory path where RPM file is located. Do not use together with `sap_hostagent_rpm_local_path`. - -### sap_hostagent_rpm_file_name - -- _Type:_ `string` - -Name of RPM package containing SAPHOSTAGENT. - - -## Input Parameters for SAP Bundle - -### sap_hostagent_bundle_path - -- _Type:_ `string` - -Remote directory path where SAP Bundle file is located after being extracted. - - -## Input Parameters for SSL setup - -### sap_hostagent_config_ssl - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to configure PSE and create CSR.
-Adding signed certificates from a valid CA is not supported yet. - -### sap_hostagent_ssl_passwd - -- _Type:_ `string` - -Enter password for the CSR. It is used when `sap_hostagent_config_ssl` is set. - -### sap_hostagent_ssl_org - -- _Type:_ `string` - -Enter Organization information for the CSR. It is used when `sap_hostagent_config_ssl` is set. - -### sap_hostagent_ssl_country - -- _Type:_ `string` - -Enter Country information for the CSR. It is used when `sap_hostagent_config_ssl` is set. - - -### sap_hostagent_agent_tmp_directory - -- _Type:_ `string` -- _Default:_ `/tmp/hostagent` - -Temporary directory for processing of source file. - -### sap_hostagent_clean_tmp_directory - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to remove temporary directory after installation. - - \ No newline at end of file diff --git a/roles/sap_hostagent/README.md b/roles/sap_hostagent/README.md index 400395153..e72fc7cc7 100644 --- a/roles/sap_hostagent/README.md +++ b/roles/sap_hostagent/README.md @@ -4,7 +4,7 @@ ## Description -Ansible Role `sap_hostagent` is used install SAP Host Agent. +The Ansible Role `sap_hostagent` is used install SAP Host Agent. SAP Host Agent is an agent that can accomplish several life-cycle management tasks, such as operating system monitoring, database monitoring, system instance control and provisioning. @@ -130,5 +130,137 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_hostagent/INPUT_PARAMETERS.md) +## Role Variables + +### sap_hostagent_installation_type + +- _Type:_ `string` +- _Default:_ `rpm` + +Select type of installation source for SAPHOSTAGENT.
+Available options: `sar`, `sar-remote`, `bundle`, `rpm` + + +### Input Parameters for SAR +Following input parameters are used by both Local SAR and Remote SAR. + +#### sap_hostagent_sar_file_name + +- _Type:_ `string` + +Name of SAR file containing SAPHOSTAGENT. + +#### sap_hostagent_sapcar_file_name + +- _Type:_ `string` + +Name of SAR file containing SAPCAR. + +### Input Parameters for Local SAR + +#### sap_hostagent_sar_local_path + +- _Type:_ `string` + +Local directory path where SAR file is located.
+**Do not use together with `sap_hostagent_sar_remote_path`.** + +#### sap_hostagent_sapcar_local_path + +- _Type:_ `string` + +Local directory path where SAPCAR file is located.
+**Do not use together with `sap_hostagent_sapcar_remote_path`.** + +### Input Parameters for Remote SAR + +#### sap_hostagent_sar_remote_path + +- _Type:_ `string` + +Remote directory path where SAR file is located.
+**Do not use together with `sap_hostagent_sar_local_path`.** + +#### sap_hostagent_sapcar_remote_path + +- _Type:_ `string` + +Local directory path where SAPCAR file is located.
+**Do not use together with `sap_hostagent_sapcar_local_path`.** + + +### Input Parameters for RPM + +#### sap_hostagent_rpm_local_path + +- _Type:_ `string` + +Local directory path where RPM file is located.
+**Do not use together with `sap_hostagent_rpm_remote_path`.** + +#### sap_hostagent_rpm_remote_path + +- _Type:_ `string` + +Remote directory path where RPM file is located.
+**Do not use together with `sap_hostagent_rpm_local_path`.** + +#### sap_hostagent_rpm_file_name + +- _Type:_ `string` + +Name of RPM package containing SAPHOSTAGENT. + + +### Input Parameters for SAP Bundle + +#### sap_hostagent_bundle_path + +- _Type:_ `string` + +Remote directory path where SAP Bundle file is located after being extracted. + + +### Input Parameters for SSL setup + +#### sap_hostagent_config_ssl + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to configure PSE and create CSR.
+Adding signed certificates from a valid CA is not supported yet. + +#### sap_hostagent_ssl_passwd + +- _Type:_ `string` + +Enter password for the CSR. It is used when `sap_hostagent_config_ssl` is set. + +#### sap_hostagent_ssl_org + +- _Type:_ `string` + +Enter Organization information for the CSR. It is used when `sap_hostagent_config_ssl` is set. + +#### sap_hostagent_ssl_country + +- _Type:_ `string` + +Enter Country information for the CSR. It is used when `sap_hostagent_config_ssl` is set. + + +#### sap_hostagent_agent_tmp_directory + +- _Type:_ `string` +- _Default:_ `/tmp/hostagent` + +Temporary directory for processing of source file. + +#### sap_hostagent_clean_tmp_directory + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to remove temporary directory after installation. + \ No newline at end of file diff --git a/roles/sap_install_media_detect/INPUT_PARAMETERS.md b/roles/sap_install_media_detect/INPUT_PARAMETERS.md deleted file mode 100644 index 67beaf028..000000000 --- a/roles/sap_install_media_detect/INPUT_PARAMETERS.md +++ /dev/null @@ -1,181 +0,0 @@ -## Input Parameters for sap_install_media_detect Ansible Role - -### sap_install_media_detect_rar_handling - -- _Type:_ `bool` -- _Default:_ `True` - -Set this parameter to `false` for skipping the handling of RAR files. In this case, also no `unar` or other RAR handling software will be installed. - - -### sap_install_media_detect_rar_package - -- _Type:_ `str` -- _Default:_ `EPEL` - -Set this parameter to use either the `unar` package from `EPEL` or another software package for handling RAR files.
-Based on this setting, the commands for listing and extracting RAR files are being set in tasks/prepare/enable_rar_handling.yml - -### sap_install_media_detect_epel_gpg_key_url - -- _Type:_ `str` -- _Default:_ `https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}` - -URL for the EPEL GPG key - -### sap_install_media_detect_use_rpm_key_module_for_removing_the_key - -- _Type:_ `bool` -- _Default:_ `True` - -The `EPEL` GPG key can be removed with the rpm_key module and the URL for the key, or by using the `rpm -e` command.
-For using the rpm -e command, set this variable to 'false'. - -### sap_install_media_detect_file_server_only - -- _Type:_ `bool` -- _Default:_ `False` - -If this role is running on a file server on which the SAP software is not to be installed, set the following to true.
-If this role is running on a system on which the SAP software is to be installed, set the following to false. - -### sap_install_media_detect_rar_list - -- _Type:_ `str` -- _Default:_ `/usr/bin/unrar lb` - -Fully qualified path to the program for listing RAR files, including the argument for listing files.
-If not specified, the `lsar` program (or a link with the name `lsar`, pointing to the actual `lsar` program) is expected to be located in one of the PATH directories.
-If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. - -### sap_install_media_detect_rar_extract - -- _Type:_ `str` -- _Default:_ `/usr/bin/unrar x` - -Fully qualified path to the program for extracting RAR files, including the argument for extracting files.
-If not specified, the `unar` program (or a link with the name `unar`, pointing to the actual `unar` program) is expected to be located in one of the PATH directories.
-If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. - -### sap_install_media_detect_rar_extract_directory_argument - -- _Type:_ `str` - -Fully qualified path to an additional argument to the program for extracting RAR files, for specifying the directory into which the archive is to be extracted. Needs to be empty or start with a space character.
-If sap_install_media_detect_rar_package is set to 'EPEL', this variable is not used. - -### sap_install_media_detect_source_directory - -- _Type:_ `str` -- _Default:_ `/software` - -Directory where the SAP software is located - -### sap_install_media_detect_target_directory - -- _Type:_ `str` - -Directory where the SAP software is located after the role is run, if different from `sap_install_media_detect_source_directory` - -### sap_install_media_detect_create_target_directory - -- _Type:_ `bool` -- _Default:_ `True` - -Create target directory if it does not yet exist. If set to false, perform a check only - -### sap_install_media_detect_rename_target_file_exists - -- _Type:_ `str` -- _Default:_ `skip` - -If there are two files of the same RAR or ZIP type, one with and one without suffix, the following parameter will determine what the role will do for such a file: `skip` the file renaming, `fail`, or `overwrite` the file with the suffix by the file without suffix - -### sap_install_media_detect_extract_archives - -- _Type:_ `bool` -- _Default:_ `True` - -If you want the role to not extract archives which have the extract flag set, set the following parameter to `false`. - -### sap_install_media_detect_move_or_copy_archives - -- _Type:_ `bool` -- _Default:_ `True` - -If you want the role to not move or copy archive files to the `target_dir` subdirectories, set the following parameter to `false`. - -### sap_install_media_detect_assert_after_sapfile - -- _Type:_ `bool` -- _Default:_ `True` - -By default, the presence of at least one file for each file type according to the configured role parameters is asserted. Set the following parameter to 'false' to skip this step. - -### sap_install_media_detect_db - -- _Type:_ `str` - -Select which database type to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` - -### sap_install_media_detect_db_client - -- _Type:_ `str` - -Select which database client to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` - -### sap_install_media_detect_swpm - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to detect SWPM. - -### sap_install_media_detect_hostagent - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to detect SAP Hostagent. - -### sap_install_media_detect_igs - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to detect SAP IGS. - -### sap_install_media_detect_kernel - -- _Type:_ `bool` -- _Default:_ `False` - -Enable to detect SAP Kernel files. - -### sap_install_media_detect_kernel_db - -- _Type:_ `str` - -Select which database kernel to detect: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2`
\ No newline at end of file diff --git a/roles/sap_install_media_detect/README.md b/roles/sap_install_media_detect/README.md index 45e739bd6..1c0a100c5 100644 --- a/roles/sap_install_media_detect/README.md +++ b/roles/sap_install_media_detect/README.md @@ -5,7 +5,7 @@ ## Description -Ansible Role `sap_install_media_detect` is used to detect and extract SAP installation media. +The Ansible Role `sap_install_media_detect` is used to detect and extract SAP installation media. This role searches provided source directory, sorts files based on type and extracts them to target directory. Extraction can be further adjusted to create individual folders based on defined inputs. @@ -23,7 +23,6 @@ Managed nodes: ## Execution -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -118,6 +117,8 @@ Note: After running the role with the following four tags, the SAP archive files +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -130,5 +131,192 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_install_media_detect/INPUT_PARAMETERS.md) +## Role Variables + +### sap_install_media_detect_rar_handling + +- _Type:_ `bool` +- _Default:_ `True` + +Set this parameter to `false` for skipping the handling of RAR files. In this case, also no `unar` or other RAR handling software will be installed. + + +### sap_install_media_detect_rar_package + +- _Type:_ `str` +- _Default:_ `EPEL` + +Set this parameter to use either the `unar` package from `EPEL` or another software package for handling RAR files.
+Based on this setting, the commands for listing and extracting RAR files are being set in tasks/prepare/enable_rar_handling.yml + +### sap_install_media_detect_epel_gpg_key_url + +- _Type:_ `str` +- _Default:_ `https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}` + +URL for the EPEL GPG key + +### sap_install_media_detect_use_rpm_key_module_for_removing_the_key + +- _Type:_ `bool` +- _Default:_ `True` + +The `EPEL` GPG key can be removed with the rpm_key module and the URL for the key, or by using the `rpm -e` command.
+For using the rpm -e command, set this variable to 'false'. + +### sap_install_media_detect_file_server_only + +- _Type:_ `bool` +- _Default:_ `False` + +If this role is running on a file server on which the SAP software is not to be installed, set the following to true.
+If this role is running on a system on which the SAP software is to be installed, set the following to false. + +### sap_install_media_detect_rar_list + +- _Type:_ `str` +- _Default:_ `/usr/bin/unrar lb` + +Fully qualified path to the program for listing RAR files, including the argument for listing files.
+If not specified, the `lsar` program (or a link with the name `lsar`, pointing to the actual `lsar` program) is expected to be located in one of the PATH directories.
+If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. + +### sap_install_media_detect_rar_extract + +- _Type:_ `str` +- _Default:_ `/usr/bin/unrar x` + +Fully qualified path to the program for extracting RAR files, including the argument for extracting files.
+If not specified, the `unar` program (or a link with the name `unar`, pointing to the actual `unar` program) is expected to be located in one of the PATH directories.
+If sap_install_media_detect_rar_package is set to `EPEL`, this variable is not used. + +### sap_install_media_detect_rar_extract_directory_argument + +- _Type:_ `str` + +Fully qualified path to an additional argument to the program for extracting RAR files, for specifying the directory into which the archive is to be extracted.
+Needs to be empty or start with a space character.
+If sap_install_media_detect_rar_package is set to 'EPEL', this variable is not used. + +### sap_install_media_detect_source_directory + +- _Type:_ `str` +- _Default:_ `/software` + +Directory where the SAP software is located + +### sap_install_media_detect_target_directory + +- _Type:_ `str` + +Directory where the SAP software is located after the role is run, if different from `sap_install_media_detect_source_directory` + +### sap_install_media_detect_create_target_directory + +- _Type:_ `bool` +- _Default:_ `True` + +Create target directory if it does not yet exist. If set to false, perform a check only + +### sap_install_media_detect_rename_target_file_exists + +- _Type:_ `str` +- _Default:_ `skip` + +If there are two files of the same RAR or ZIP type, one with and one without suffix, the following parameter will determine what the role will do for such a file:
+- `skip` the file renaming. +- `fail` execution. +- `overwrite` the file with the suffix by the file without suffix. + +### sap_install_media_detect_extract_archives + +- _Type:_ `bool` +- _Default:_ `True` + +If you want the role to not extract archives which have the extract flag set, set the following parameter to `false`. + +### sap_install_media_detect_move_or_copy_archives + +- _Type:_ `bool` +- _Default:_ `True` + +If you want the role to not move or copy archive files to the `target_dir` subdirectories, set the following parameter to `false`. + +### sap_install_media_detect_assert_after_sapfile + +- _Type:_ `bool` +- _Default:_ `True` + +By default, the presence of at least one file for each file type according to the configured role parameters is asserted. Set the following parameter to 'false' to skip this step. + +### sap_install_media_detect_db + +- _Type:_ `str` + +Select which database type to detect.
+Available values: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` + +### sap_install_media_detect_db_client + +- _Type:_ `str` + +Select which database client to detect.
+Available values: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2` + +### sap_install_media_detect_swpm + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SWPM. + +### sap_install_media_detect_hostagent + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Hostagent. + +### sap_install_media_detect_igs + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP IGS. + +### sap_install_media_detect_kernel + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Kernel files. + +### sap_install_media_detect_kernel_db + +- _Type:_ `str` + +Select which database kernel to detect.
+Available values: `saphana`, `sapase`, `sapmaxdb`, `oracledb`, `ibmdb2`
+Only necessary if there is more than one SAPEXEDB file in the source directory + +### sap_install_media_detect_webdisp + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Web Dispatcher. + +### sap_install_media_detect_mpstack + +- _Type:_ `bool` +- _Default:_ `False` + +Enable to detect SAP Maintenance Planner stack file. + +### sap_install_media_detect_export + +- _Type:_ `str` + +Select which database export to detect.
+Available values: `saps4hana`, `sapbw4hana`, `sapecc`, `sapecc_ides`, `sapnwas_abap`, `sapnwas_java`, `sapsolman_abap`, `sapsolman_java` + \ No newline at end of file diff --git a/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md b/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md deleted file mode 100644 index 959447a1f..000000000 --- a/roles/sap_maintain_etc_hosts/INPUT_PARAMETERS.md +++ /dev/null @@ -1,78 +0,0 @@ -## Input Parameters for sap_maintain_etc_hosts Ansible Role - - -This role requires the dictionary `sap_maintain_etc_hosts_list` which contains the parameters for the `/etc/hosts` file. - -The default value is the definition of the cluster nodes like in the role [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster). If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined, then the role creates a default value from `ansible_facts`. - -**NOTE: If you want to use this role to remove entries from /etc/hosts it is a good practice to do this before adding entries. The adding/removal is done in the order the entries are listed.** - -### sap_maintain_etc_hosts_list - -- _Type:_ `list` with elements of type `dict` - -Mandatory list of nodes in form of dictionaries to be added or removed in `/etc/hosts` file. - -Following dictionary keys can be defined: -- **node_ip**
- IP address of the managed node.
- **Required** for adding new entries to `/etc/hosts`.
- _Optional_ for removing entries, where `node_name` and `node_domain` can be used instead. - - - _Type:_ `string` - -- **node_name**
- Hostname of the managed node.
- **Required** for adding new entries to `/etc/hosts`.
- _Optional_ for removing entries, when `node_ip` is not used. - - - _Type:_ `string` - -- **node_domain**
- Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_domain`.
- **Required** for adding new entries to `/etc/hosts`.
- _Optional_ for removing entries, when `node_name` is used. - - - _Type:_ `string` - - _Default:_ `sap_domain` - -- **aliases**
- List of aliases for the managed node.
- _Optional_ for adding new entries to `/etc/hosts`. - - - _Type:_ `list` with elements of type `string` - -- **alias_mode**
- Select method of updating `/etc/hosts` file:
- - `merge` : merges the list of aliases with the exiting aliases of the node.
- - `overwrite` : overwrites the aliases of the node. - _Optional_ for adding new entries to `/etc/hosts`. - - - _Type:_ `string` - - _Default:_ `merge` - -- **node_comment**
- Node comment is appended at end of line of managed node.
- _Optional_ for adding new entries to `/etc/hosts`. - - - _Type:_ `string` - - _Default:_ `managed by ansible sap_maintain_etc_hosts role` - -- **hana_site**
- Used by [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) and it is appended to `node_comment`
- _Optional_ for adding new entries to `/etc/hosts`. - - - _Type:_ `string` - -- **node_role**
- Not used, but mentioned for compatibility reasons for [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role.
- - - _Type:_ `string` - -- **state**
- Select `present` for adding new entries, `absent` for removing them.
- **Required** for removing entries, otherwise default `present` is used. - - - _Type:_ `string` - - _Default:_ `present` - \ No newline at end of file diff --git a/roles/sap_maintain_etc_hosts/README.md b/roles/sap_maintain_etc_hosts/README.md index e822ae55e..a308d2042 100644 --- a/roles/sap_maintain_etc_hosts/README.md +++ b/roles/sap_maintain_etc_hosts/README.md @@ -4,7 +4,7 @@ ## Description -Ansible Role `sap_maintain_etc_hosts` is used to maintain `/etc/hosts` file. +The Ansible role `sap_maintain_etc_hosts` is used to maintain the `/etc/hosts` file.. @@ -15,7 +15,6 @@ Ansible Role `sap_maintain_etc_hosts` is used to maintain `/etc/hosts` file. ## Execution -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -75,6 +74,8 @@ Example playbook when executed together with [sap_ha_pacemaker_cluster](https:// +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -88,5 +89,82 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_sap_maintain_etc_hosts/INPUT_PARAMETERS.md) +## Role Variables + + +This role requires the dictionary `sap_maintain_etc_hosts_list` which contains the parameters for the `/etc/hosts` file. + +The default value is the definition of the cluster nodes like in the role [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster).
+If the value `sap_hana_cluster_nodes`or `sap_ha_pacemaker_cluster_cluster_nodes` is not defined, then the role creates a default value from `ansible_facts`. + +**NOTE: If you want to use this role to remove entries from /etc/hosts it is a good practice to do this before adding entries. The adding/removal is done in the order the entries are listed.** + +### sap_maintain_etc_hosts_list + +- _Type:_ `list` with elements of type `dict` + +Mandatory list of nodes in form of dictionaries to be added or removed in `/etc/hosts` file. + +Following dictionary keys can be defined: +- **node_ip**
+ IP address of the managed node.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, where `node_name` and `node_domain` can be used instead. + + - _Type:_ `string` + +- **node_name**
+ Hostname of the managed node.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, when `node_ip` is not used. + + - _Type:_ `string` + +- **node_domain**
+ Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_domain`.
+ **Required** for adding new entries to `/etc/hosts`.
+ _Optional_ for removing entries, when `node_name` is used. + + - _Type:_ `string` + - _Default:_ `sap_domain` + +- **aliases**
+ List of aliases for the managed node.
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `list` with elements of type `string` + +- **alias_mode**
+ Select method of updating `/etc/hosts` file:
+ - `merge` : merges the list of aliases with the exiting aliases of the node.
+ - `overwrite` : overwrites the aliases of the node. + _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + - _Default:_ `merge` + +- **node_comment**
+ Node comment is appended at end of line of managed node.
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + - _Default:_ `managed by ansible sap_maintain_etc_hosts role` + +- **hana_site**
+ Used by [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) and it is appended to `node_comment`
+ _Optional_ for adding new entries to `/etc/hosts`. + + - _Type:_ `string` + +- **node_role**
+ Not used, but mentioned for compatibility reasons for [sap_ha_pacemaker_cluster](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_ha_pacemaker_cluster) role.
+ + - _Type:_ `string` + +- **state**
+ Select `present` for adding new entries, `absent` for removing them.
+ **Required** for removing entries, otherwise default `present` is used. + + - _Type:_ `string` + - _Default:_ `present` + \ No newline at end of file diff --git a/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md b/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md deleted file mode 100644 index bdaf4cdf6..000000000 --- a/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md +++ /dev/null @@ -1,92 +0,0 @@ -## Input Parameters for sap_netweaver_preconfigure Ansible Role - -## Role Input Parameters - -Minimum required parameters: -This role does not require any parameter to be set in the playbook or inventory. - - -### sap_netweaver_preconfigure_config_all -- _Type:_ `bool` -- _Default:_ `true` - -If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
-Default is to perform installation and configuration steps.
- -### sap_netweaver_preconfigure_installation -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-installation steps of SAP notes.
- -### sap_netweaver_preconfigure_configuration -- _Type:_ `bool` -- _Default:_ `false` - -If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
-configuration steps of SAP notes.
- -### sap_netweaver_preconfigure_assert -- _Type:_ `bool` -- _Default:_ `false` - -If set to `true`, the role will run in assertion mode instead of the default configuration mode.
- -### sap_netweaver_preconfigure_assert_ignore_errors -- _Type:_ `bool` -- _Default:_ `false` - -In assertion mode, the role will abort when encountering any assertion error.
-If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
-This is useful if the role is used for reporting a system's SAP notes compliance.
- -### sap_netweaver_preconfigure_min_swap_space_mb -- _Type:_ `str` -- _Default:_ `20480` - -Specifies the minimum amount of swap space on the system required by SAP NetWeaver.
-If this requirement is not met, the role will abort.
-Set your own value to override the default of `20480`.
- -### sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured -- _Type:_ `bool` -- _Default:_ `true` - -If the system does not have the minimum amount of swap space configured as defined
-in parameter `sap_netweaver_preconfigure_min_swap_space_mb`, the role will abort.
-By setting this parameter to `false`, the role will not abort in such cases.
- -### sap_netweaver_preconfigure_rpath -- _Type:_ `str` -- _Default:_ `/usr/sap/lib` - -Specifies the SAP kernel's `RPATH`. This is where the SAP kernel is searching for libraries, and where the role
-is creating a link named `libstdc++.so.6` pointing to `/opt/rh/SAP/lib64/compat-sap-c++-10.so`,
-so that newer SAP kernels which are built with GCC10 can find the required symbols.
- -### sap_netweaver_preconfigure_use_adobe_doc_services -- _Type:_ `bool` -- _Default:_ `false` - -Set this parameter to `true` when using Adobe Document Services, to ensure all required packages are installed.
- -### sap_netweaver_preconfigure_saptune_version -- _Type:_ `str` -- _Default:_ `3.0.2` - -On SLES systems, specifies the saptune version
- -### sap_netweaver_preconfigure_saptune_solution -- _Type:_ `str` -- _Default:_ `NETWEAVER` -- _Possible Values:_
- - `NETWEAVER` - - `NETWEAVER+HANA` - - `S4HANA-APP+DB` - - `S4HANA-APPSERVER` - - `S4HANA-DBSERVER` - -On SLES systems, specifies the saptune solution to apply.
- - \ No newline at end of file diff --git a/roles/sap_netweaver_preconfigure/README.md b/roles/sap_netweaver_preconfigure/README.md index 4375bfeca..fc321756a 100644 --- a/roles/sap_netweaver_preconfigure/README.md +++ b/roles/sap_netweaver_preconfigure/README.md @@ -4,9 +4,7 @@ ## Description -Ansible Role `sap_netweaver_preconfigure` is used to ensure that Managed nodes are configured to host SAP Netweaver systems according to SAP Notes after [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) role was executed. - -This role performs installation of required packages for running SAP Netweaver systems and configuration of Operating system parameters. +The Ansible role `sap_netweaver_preconfigure` installs additional required packages and performs additional OS configuration steps according to applicable SAP notes for installing and running SAP ABAP Application Platform (formerly known as SAP NetWeaver) after the role [sap_general_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_general_preconfigure) has been executed. @@ -23,8 +21,6 @@ Managed nodes: **:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.** **NOTE: It is recommended to execute `timesync` role from Ansible Collection `fedora.linux_system_roles` before or after executing this role.** - -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. @@ -68,6 +64,8 @@ Example of execution together with prerequisite role [sap_general_preconfigure]( +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -80,5 +78,82 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_netweaver_preconfigure/INPUT_PARAMETERS.md) +## Role Variables + +### sap_netweaver_preconfigure_config_all +- _Type:_ `bool` +- _Default:_ `true` + +If set to `false`, the role will only execute or verify the installation or configuration steps of SAP notes.
+Default is to perform installation and configuration steps.
+ +### sap_netweaver_preconfigure_installation +- _Type:_ `bool` +- _Default:_ `false` + +If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+installation steps of SAP notes.
+ +### sap_netweaver_preconfigure_configuration +- _Type:_ `bool` +- _Default:_ `false` + +If `sap_netweaver_preconfigure_config_all` is set to `false`, set this variable to `true` to perform only the
+configuration steps of SAP notes.
+ +### sap_netweaver_preconfigure_assert +- _Type:_ `bool` +- _Default:_ `false` + +If set to `true`, the role will run in assertion mode instead of the default configuration mode.
+ +### sap_netweaver_preconfigure_assert_ignore_errors +- _Type:_ `bool` +- _Default:_ `false` + +In assertion mode, the role will abort when encountering any assertion error.
+If this parameter is set to `false`, the role will *not* abort when encountering an assertion error.
+This is useful if the role is used for reporting a system's SAP notes compliance.
+ +### sap_netweaver_preconfigure_min_swap_space_mb +- _Type:_ `str` +- _Default:_ `20480` + +Specifies the minimum amount of swap space on the system required by SAP NetWeaver.
+If this requirement is not met, the role will abort.
+Set your own value to override the default of `20480`.
+ +### sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured +- _Type:_ `bool` +- _Default:_ `true` + +If the system does not have the minimum amount of swap space configured as defined
+in parameter `sap_netweaver_preconfigure_min_swap_space_mb`, the role will abort.
+By setting this parameter to `false`, the role will not abort in such cases.
+ +### sap_netweaver_preconfigure_rpath +- _Type:_ `str` +- _Default:_ `/usr/sap/lib` + +Specifies the SAP kernel's `RPATH`. This is where the SAP kernel is searching for libraries, and where the role
+is creating a link named `libstdc++.so.6` pointing to `/opt/rh/SAP/lib64/compat-sap-c++-10.so`,
+so that newer SAP kernels which are built with GCC10 can find the required symbols.
+ +### sap_netweaver_preconfigure_use_adobe_doc_services +- _Type:_ `bool` +- _Default:_ `false` + +Set this parameter to `true` when using Adobe Document Services, to ensure all required packages are installed.
+ +### sap_netweaver_preconfigure_saptune_version +- _Type:_ `str` + +(SUSE specific) Specifies the saptune version. + +### sap_netweaver_preconfigure_saptune_solution +- _Type:_ `str` +- _Default:_ `NETWEAVER` + +(SUSE specific) Specifies the saptune solution to apply.
+Available values: `NETWEAVER`, `NETWEAVER+HANA`, `S4HANA-APP+DB`, `S4HANA-APPSERVER`, `S4HANA-DBSERVER` + \ No newline at end of file diff --git a/roles/sap_storage_setup/INPUT_PARAMETERS.md b/roles/sap_storage_setup/INPUT_PARAMETERS.md deleted file mode 100644 index f4de99ad2..000000000 --- a/roles/sap_storage_setup/INPUT_PARAMETERS.md +++ /dev/null @@ -1,140 +0,0 @@ - -## Input Parameters for sap_netweaver_preconfigure Ansible Role - - -Minimum required parameters: - -- [sap_storage_setup_definition](#sap_storage_setup_definition-required) -- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) -- [sap_storage_setup_sid](#sap_storage_setup_sid-required) - - -### sap_storage_setup_definition required - -- _Type:_ `list` - -Describes list of the filesystems to be configured.
- -- **disk_size**
- Size of the disk device that is used for the filesystem.
For filesystems with no LVM logical volume striping, this is the total size of the filesystem.
For filesystems with LVM LV striping defined (`lvm_lv_stripes`), this is the size of each disk. The resulting filesystem size will be `disk_size` multiplied by `lvm_lv_stripes` (=disks). - - - _Type:_ `int` - -- **filesystem_type**
- The type of filesystem that will be created on the logical volume. - - - _Type:_ `str` - - _Default:_ `xfs` - -- **lvm_lv_name**
- The name of the LVM volume.
The default name is derived from the name value of the filesystem definition entry, for example 'lv_hanalog'. - - - _Type:_ `str` - -- **lvm_lv_stripe_size**
- When setting up a striped volume, the stripe size can be defined.
Example format - "128K". - - - _Type:_ `str` - -- **lvm_lv_stripes**
- Number of disks that will be configured in a striped volume.
This requires the availability of the same amount of unused disks, which must be of the size defined in `disk_size`. - - - _Type:_ `int` - _Default:_ `1` - -- **lvm_vg_name**
- The name of the LVM volume group.
The default name is derived from the name value of the filesystem definition entry, for example 'vg_hanalog'. - - - _Type:_ `str` - -- **lvm_vg_physical_extent_size**
- Adjustable size of the physical extents of the volume group in LVM. - - - _Type:_ `int` - - _Default:_ `4` - -- **mountpoint**
- The path to where the filesystem will be mounted.
This can be left out for the definition of a swap volume. - - - _Type:_ `str` - -- **name**
- A name of the filesystem definition entry.
This name is used to generate volume group name and logical volume name. - - - _Type:_ `str` - -- **nfs_filesystem_type**
- The type of the NFS filesystem, for example `nfs`, `nfs4`. - - - _Type:_ `str` - - _Default:_ `nfs4` - -- **nfs_mount_options**
- Mount options to use for the NFS mount.
Generic default is `hard,acl`.
Defaults depend on the specific platform detected by the role or defined explicitly. - - - _Type:_ `str` - - _Default:_ `hard,acl` - -- **nfs_path**
- When defining an NFS filesystem, this is the directory path of the filesystem to be mounted. - - - _Type:_ `str` - -- **nfs_server**
- When defining an NFS filesystem, this is the address of the NFS server.
The address must contain the root path, in which the mount directories exist or will be created.
For example, `192.168.1.100:/`. - - - _Type:_ `str` - -- **swap_path**
- The path to the swap file.
When this option is defined for a swap filesystem definition, it will create a swap file on an existing filesystem. - - - _Type:_ `str` - -Example: - -```yaml -sap_storage_setup_definition: - - # Block Storage volume - - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name - mountpoint: /hana/data # required: string, directory path where the filesystem is mounted - disk_size: 100 # required: integer, size in GB - filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem - - # File Storage volume - - name: hana_shared # required: string, reference name - mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted - nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server - - # Swap as file instead of Block Storage volume - # See SAP Note 1597355 - Swap-space recommendation for Linux - - name: swap # required: string, reference name - swap_path: /swapfile # required: string, directory path where swap file is created - disk_size: 4 # required: integer, size in GB of swap file - filesystem_type: swap # required: string, must be value 'swap' -``` - -### sap_storage_setup_host_type required - -- _Type:_ `list` - -The type of service the target system is going to be configured for.
-This can be a list of multiple types which apply to a single host.
-If not defined, the default will be inherited from the global parameter `sap_host_type`. One of these parameters must be defined.
-Available values: `hana_primary`, `hana_secondary`, `nwas_abap_ascs`, `nwas_abap_ers`, `nwas_abap_pas`, `nwas_abap_aas`, `nwas_java_scs`, `nwas_java_ers` - -### sap_storage_setup_multipath_enable_and_detect - -- _Type:_ `bool` -- _Default:_ `False` - -Define if multipathing should be enabled and dynamic multipath devices detected and used for the filesystem setup.
- -### sap_storage_setup_sid required - -- _Type:_ `str` - -SID of the SAP service.
-If not defined, the default will be inherited from the global parameter `sap_system_sid`. One of these parameters must be defined.
- - \ No newline at end of file diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index 55231f601..7105d1454 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -5,7 +5,7 @@ ## Description -Ansible Role `sap_storage_setup` is used to prepare a host with the storage requirements of an SAP System (prior to software installation). +The Ansible Role `sap_storage_setup` is used to prepare a host with the storage requirements of an SAP System (prior to software installation). This role can prepare host with: - Local block storage volume setup as LVM Logical Volumes, Filesystem formatting and mount to defined directory path @@ -37,8 +37,6 @@ Managed nodes: **:warning: Do not execute this Ansible Role against existing SAP systems unless you know what you are doing and you prepare inputs to avoid unintended changes caused by default inputs.**
:warning: While this Ansible Role has protection against overwrite of existing disks and filesystems - sensible review and care is required for any automation of disk storage. Please review the documentation and samples/examples carefully. It is strongly suggested to initially execute the Ansible Playbook calling this Ansible Role, with `ansible-playbook --check` for Check Mode - this will perform no changes to the host and show which changes would be made. -Role can be executed independently or as part of [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. - **Considerations** - This role does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. - This role enforces that 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). @@ -110,6 +108,8 @@ Example playbook to configure SAP HANA OneHost node on AWS that includes: +## Further Information +For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -122,5 +122,141 @@ Apache 2.0 - [Janine Fuchs](https://github.com/ja9fuchs) -## Role Input Parameters -All input parameters used by role are described in [INPUT_PARAMETERS.md](https://github.com/sap-linuxlab/community.sap_install/blob/main/roles/sap_storage_setup/INPUT_PARAMETERS.md) +## Role Variables + + +Minimum required parameters: + +- [sap_storage_setup_definition](#sap_storage_setup_definition-required) +- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) +- [sap_storage_setup_sid](#sap_storage_setup_sid-required) + + +### sap_storage_setup_definition required + +- _Type:_ `list` + +Describes list of the filesystems to be configured.
+ +- **disk_size**
+ Size of the disk device that is used for the filesystem.
For filesystems with no LVM logical volume striping, this is the total size of the filesystem.
For filesystems with LVM LV striping defined (`lvm_lv_stripes`), this is the size of each disk. The resulting filesystem size will be `disk_size` multiplied by `lvm_lv_stripes` (=disks). + + - _Type:_ `int` + +- **filesystem_type**
+ The type of filesystem that will be created on the logical volume. + + - _Type:_ `str` + - _Default:_ `xfs` + +- **lvm_lv_name**
+ The name of the LVM volume.
The default name is derived from the name value of the filesystem definition entry, for example 'lv_hanalog'. + + - _Type:_ `str` + +- **lvm_lv_stripe_size**
+ When setting up a striped volume, the stripe size can be defined.
Example format - "128K". + + - _Type:_ `str` + +- **lvm_lv_stripes**
+ Number of disks that will be configured in a striped volume.
This requires the availability of the same amount of unused disks, which must be of the size defined in `disk_size`. + + - _Type:_ `int` + _Default:_ `1` + +- **lvm_vg_name**
+ The name of the LVM volume group.
The default name is derived from the name value of the filesystem definition entry, for example 'vg_hanalog'. + + - _Type:_ `str` + +- **lvm_vg_physical_extent_size**
+ Adjustable size of the physical extents of the volume group in LVM. + + - _Type:_ `int` + - _Default:_ `4` + +- **mountpoint**
+ The path to where the filesystem will be mounted.
This can be left out for the definition of a swap volume. + + - _Type:_ `str` + +- **name**
+ A name of the filesystem definition entry.
This name is used to generate volume group name and logical volume name. + + - _Type:_ `str` + +- **nfs_filesystem_type**
+ The type of the NFS filesystem, for example `nfs`, `nfs4`. + + - _Type:_ `str` + - _Default:_ `nfs4` + +- **nfs_mount_options**
+ Mount options to use for the NFS mount.
Generic default is `hard,acl`.
Defaults depend on the specific platform detected by the role or defined explicitly. + + - _Type:_ `str` + - _Default:_ `hard,acl` + +- **nfs_path**
+ When defining an NFS filesystem, this is the directory path of the filesystem to be mounted. + + - _Type:_ `str` + +- **nfs_server**
+ When defining an NFS filesystem, this is the address of the NFS server.
The address must contain the root path, in which the mount directories exist or will be created.
For example, `192.168.1.100:/`. + + - _Type:_ `str` + +- **swap_path**
+ The path to the swap file.
When this option is defined for a swap filesystem definition, it will create a swap file on an existing filesystem. + + - _Type:_ `str` + +Example: + +```yaml +sap_storage_setup_definition: + + # Block Storage volume + - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name + mountpoint: /hana/data # required: string, directory path where the filesystem is mounted + disk_size: 100 # required: integer, size in GB + filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem + + # File Storage volume + - name: hana_shared # required: string, reference name + mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted + nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server + + # Swap as file instead of Block Storage volume + # See SAP Note 1597355 - Swap-space recommendation for Linux + - name: swap # required: string, reference name + swap_path: /swapfile # required: string, directory path where swap file is created + disk_size: 4 # required: integer, size in GB of swap file + filesystem_type: swap # required: string, must be value 'swap' +``` + +### sap_storage_setup_host_type required + +- _Type:_ `list` + +The type of service the target system is going to be configured for.
+This can be a list of multiple types which apply to a single host.
+If not defined, the default will be inherited from the global parameter `sap_host_type`. One of these parameters must be defined.
+Available values: `hana_primary`, `hana_secondary`, `nwas_abap_ascs`, `nwas_abap_ers`, `nwas_abap_pas`, `nwas_abap_aas`, `nwas_java_scs`, `nwas_java_ers` + +### sap_storage_setup_multipath_enable_and_detect + +- _Type:_ `bool` +- _Default:_ `False` + +Define if multipathing should be enabled and dynamic multipath devices detected and used for the filesystem setup.
+ +### sap_storage_setup_sid required + +- _Type:_ `str` + +SID of the SAP service.
+If not defined, the default will be inherited from the global parameter `sap_system_sid`. One of these parameters must be defined.
+ \ No newline at end of file From ac4b06f86c62963f9c0f90cdb996593dad78cb8f Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 3 Oct 2024 15:47:01 +0200 Subject: [PATCH 168/210] docs: Update readme and add vars section --- roles/sap_swpm/README.md | 753 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 720 insertions(+), 33 deletions(-) diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 6d1faf5fa..04c7360a8 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -5,7 +5,7 @@ ## Description -The Ansible role `sap_swpm` installs the SAP ABAP Application Platform (formerly known as SAP NetWeaver) using the SAP Software Provisioning Manager (SWPM). +The Ansible role `sap_swpm` installs various SAP Systems installable by SAP Software Provisioning Manager (SWPM). @@ -20,30 +20,27 @@ Install required collections by `ansible-galaxy install -vv -r meta/collection-r ## Prerequisites Managed nodes: -- Directory with SAP Installation media is present and `sap_install_media_detect_source_directory` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community). -- Ensure that servers are configured for SAP ABAP Application Platform. See [Recommended](#recommended) section. +- Directory with SAP Installation media is present and `sap_swpm_software_path` updated. Download can be completed using [community.sap_launchpad](https://github.com/sap-linuxlab/community). +- Ensure that servers are configured for SAP Systems. See [Recommended](#recommended) section. - Ensure that volumes and filesystems are configured correctly. See [Recommended](#recommended) section. -### Prepare SAP ABAP Application Platform installation media -Place a valid SAPCAR executable file in a directory specified by variable `sap_swpm_sapcar_path`, e.g. /software/sapcar. Example: - - SAPCAR_1300-70007716.EXE +### Prepare SAP installation media +Place a valid SAPCAR executable file in a directory specified by variable `sap_swpm_sapcar_path` (e.g. /software/sapcar). Example: `SAPCAR_1300-70007716.EXE` -Place the following files in a directory specified by variable `sap_swpm_swpm_path`, e.g. /software/sap_swpm: - - SWPM20SP18_3-80003424.SAR +Place a valid SWPM SAR file in a directory specified by variable `sap_swpm_swpm_path` (e.g. /software/sap_swpm). Example: `SWPM20SP18_3-80003424.SAR` -Place the following files in a directory specified by variable `sap_swpm_software_path`, e.g. /software/abap_application_platform: - - For a new installation - - Download the appropriate software from SAP Software Download Center, Maintenance Planner, etc - - For a restore or new installation - - SAP IGS - `igs*.sar` - - SAP IGS HELPER - `igshelper*sar` - - SAP Host Agent - `SAPHOSTAGENT*SAR` - - SAP Kernel DB - `SAPEXEDB_*SAR` - - SAP Kernel DB Independent - `SAPEXE_*SAR` - - SAP HANA Client - `IMDB_CLIENT*SAR` - -Alternatively, you can place all the files mentioned above into a single directory and use the role [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) to identify the required files and set the role variables automatically so that the role `sap_swpm` has access to all the files needed for a successful installation of SAP ABAP Application Platform. +Place the following files in a directory specified by variable `sap_swpm_software_path` (e.g. /software/sap_swpm_download_basket): + - For a new installation + - Download the appropriate software from SAP Software Download Center, Maintenance Planner, etc. + - For a restore or new installation + - SAP IGS - `igs*.sar` + - SAP IGS HELPER - `igshelper*sar` + - SAP Host Agent - `SAPHOSTAGENT*SAR` + - SAP Kernel DB - `SAPEXEDB_*SAR` + - SAP Kernel DB Independent - `SAPEXE_*SAR` + - SAP HANA Client - `IMDB_CLIENT*SAR` +Alternatively, you can place all the files mentioned above into a single directory and use the role [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) to identify the required files and set the role variables automatically so that the role `sap_swpm` has access to all the files needed for a successful installation of SAP System. ## Execution @@ -79,9 +76,9 @@ Note: For most scenarios, a database like SAP HANA must be available. Use the ro - Get all .SAR filenames from `sap_swpm_software_path` -- Update `/etc/hosts` (optional - `false` by default) +- (Optional) Update `/etc/hosts` if `sap_swpm_update_etchosts` is set to `true` (Default: `false`). -- Apply firewall rules for SAP HANA (optional - `false` by default) +- (Optional) Apply firewall rules for SAP HANA if `sap_swpm_setup_firewall` is set to `true` (Default: `false`). - At this stage, the role is searching for a sapinst inifile on the managed node, or it will create one: @@ -110,22 +107,22 @@ It is also possible to use method 1 for creating the inifile and then replace or ### Post-Install -- Set expiry of Unix created users to 'never' +- Set expiry of Linux created users to 'never' -- Apply firewall rules for SAP NW (optional - false by default) +- (Optional) Apply firewall rules for SAP Netweaver if `sap_swpm_setup_firewall` is set to `true` (Default: `false`). ### Example -#### Playbook for installing a Primary Application Server (PAS) instance - +#### Playbook for installing a SAP ABAP ASCS instance in distributed system with [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) role +Example shows execution together with [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) role, which sets required variables for `sap_swpm` role.
```yaml --- -- name: Ansible Play for SAP NetWeaver Application Server - Primary Application Server (PAS) - hosts: nwas_pas +- name: Ansible Play for SAP ABAP ASCS installation in distributed system + hosts: nwas_ascs become: true - any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts + any_errors_fatal: true max_fail_percentage: 0 tasks: @@ -138,15 +135,39 @@ It is also possible to use method 1 for creating the inifile and then replace or sap_install_media_detect_igs: true sap_install_media_detect_kernel: true sap_install_media_detect_webdisp: false - sap_install_media_detect_db_client: "saphana" + sap_install_media_detect_source_directory: /software - # Install SAP NetWeaver PAS via Ansible Role sap_swpm - name: Execute Ansible Role sap_swpm ansible.builtin.include_role: name: community.sap_install.sap_swpm vars: - *** TODO: Fill in variables *** + sap_swpm_sid: AE1 + sap_swpm_virtual_hostname: ae1ascs + sap_swpm_ascs_instance_nr: "01" + sap_swpm_master_password: "Password@1" # Do not use, this is example only! + sap_swpm_ddic_000_password: "Password@1" # Do not use, this is example only! + sap_swpm_sapadm_uid: "3000" + sap_swpm_sapsys_gid: "3001" + sap_swpm_sidadm_uid: "3001" + sap_swpm_product_catalog_id: NW_ABAP_ASCS:NW750.HDB.ABAPHA + sap_swpm_inifile_sections_list: + - swpm_installation_media + - swpm_installation_media_swpm1 + - credentials + - credentials_hana + - db_config_hana + - db_connection_nw_hana + - nw_config_other + - nw_config_central_services_abap + - nw_config_primary_application_server_instance + - nw_config_ports + - nw_config_host_agent + - sap_os_linux_user + + sap_swpm_role_parameters_dict: + sap_swpm_install_saphostagent: 'true' ``` + @@ -158,7 +179,7 @@ With the following tags, the role can be called to perform certain activities on - tag `sap_swpm_pre_install`: Perform all preinstallation steps, then exit. - tag `sap_swpm_setup_firewall`: Only perform the firewall preinstallation settings (but only if variable `sap_swpm_setup_firewall` is set to `true`). - tag `sap_swpm_update_etchosts`: Only update file `/etc/hosts` (but only if variable `sap_swpm_update_etchosts` is set to `true`). -!-- END Role Tags --> + ## License @@ -170,3 +191,669 @@ Apache 2.0 - [Bernd Finger](https://github.com/berndfinger) - [Sean Freeman](https://github.com/seanfreeman) + +## Role Variables + +**NOTE: Discontinued variables:** +- `sap_swpm_ansible_role_mode` + +### Variables for creating sapinst inifile + +#### sap_swpm_run_sapinst +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` to disable execution of sapinst after creation of inifile. + + +### Variables for controlling contents of inifile + +#### sap_swpm_inifile_sections_list +- _Type:_ `list` +- _Default:_ +```yaml +sap_swpm_inifile_sections_list: + - swpm_installation_media + - swpm_installation_media_swpm2_hana + - credentials + - credentials_hana + - db_config_hana + - db_connection_nw_hana + - db_restore_hana + - nw_config_other + - nw_config_central_services_abap + - nw_config_primary_application_server_instance + - nw_config_ports + - nw_config_host_agent + - sap_os_linux_user +``` + +Define list of sections that will be used to control parameters added into sapinst inifile. +Available values: +```yaml +sap_swpm_inifile_sections_list: + - swpm_installation_media + - swpm_installation_media_swpm2_hana + - swpm_installation_media_swpm1 + - swpm_installation_media_swpm1_exportfiles + - swpm_installation_media_swpm1_ibmdb2 + - swpm_installation_media_swpm1_oracledb_121 + - swpm_installation_media_swpm1_oracledb_122 + - swpm_installation_media_swpm1_oracledb_19 + - swpm_installation_media_swpm1_sapase + - swpm_installation_media_swpm1_sapmaxdb + - maintenance_plan_stack_tms_config + - maintenance_plan_stack_tms_transports + - maintenance_plan_stack_spam_config + - maintenance_plan_stack_sum_config + - maintenance_plan_stack_sum_10_batch_mode + - credentials + - credentials_hana + - credentials_anydb_ibmdb2 + - credentials_anydb_oracledb + - credentials_anydb_sapase + - credentials_anydb_sapmaxdb + - credentials_nwas_ssfs + - credentials_hdbuserstore + - db_config_hana + - db_config_anydb_all + - db_config_anydb_ibmdb2 + - db_config_anydb_oracledb + - db_config_anydb_oracledb_121 + - db_config_anydb_oracledb_122 + - db_config_anydb_oracledb_19 + - db_config_anydb_sapase + - db_config_anydb_sapmaxdb + - db_connection_nw_hana + - db_connection_nw_anydb_ibmdb2 + - db_connection_nw_anydb_oracledb + - db_connection_nw_anydb_sapase + - db_restore_hana + - nw_config_anydb + - nw_config_other + - nw_config_central_services_abap + - nw_config_central_services_java + - nw_config_primary_application_server_instance + - nw_config_additional_application_server_instance + - nw_config_ers + - nw_config_ports + - nw_config_java_ume + - nw_config_java_feature_template_ids + - nw_config_java_icm_credentials + - nw_config_webdisp_generic + - nw_config_webdisp_gateway + - nw_config_host_agent + - nw_config_post_load_abap_reports + - nw_config_livecache + - nw_config_sld + - nw_config_abap_language_packages + - sap_os_linux_user +``` + + +### Variables to define software paths + +#### sap_swpm_sapcar_path +- _Type:_ `string` + +Define path to directory with SAPCAR file. + +#### sap_swpm_sapcar_file_name +- _Type:_ `string` + +(Optional) Define name of SAPCAR file, or leave for auto-detection. + +#### sap_swpm_swpm_path +- _Type:_ `string` + +Define path to directory with SWPM. + +#### sap_swpm_swpm_sar_file_name +- _Type:_ `string` + +(Optional) Define name of SWPM file, or leave for auto-detection. + +#### sap_swpm_software_extract_directory +- _Type:_ `string` + +(Optional) Define path to directory with unpacked SWPM file. + +#### sap_swpm_software_use_media +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to use SAP Media files instead of SAR files.
+- SWPM2 (New SAP products like S4H, BW4H) uses SAR files.
+- SWPM1 (Older SAP products) use CD Media files. + +#### sap_swpm_inifile_directory +- _Type:_ `string` + +Define directory where sapinst inifile will be stored. + +#### sap_swpm_install_saphostagent +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` to disable installation of SAP Hostagent. **Not recommended** + + +### Variables specific to SAP Netweaver + +#### sap_swpm_product_catalog_id +- _Type:_ `string` + +Define SWPM Product catalog ID for installation. Example for SAP ASCS Netweaver: `NW_ABAP_ASCS:NW750.HDB.ABAPHA`. + +#### sap_swpm_sid +- _Type:_ `string` + +Define SAP System ID (SID) for installation. + +#### sap_swpm_ascs_instance_nr +- _Type:_ `string` + +Define SAP Netweaver ABAP Central Services (ASCS) instance number. + +#### sap_swpm_ascs_instance_hostname +- _Type:_ `string` + +Define SAP Netweaver ABAP Central Services (ASCS) hostname. + +#### sap_swpm_ers_instance_nr +- _Type:_ `string` + +Define SAP Netweaver Enqueue Replication Server (ERS) instance number. + +#### sap_swpm_ers_instance_hostname +- _Type:_ `string` + +Define SAP Netweaver Enqueue Replication Server (ERS) hostname. + +#### sap_swpm_pas_instance_nr +- _Type:_ `string` + +Define SAP Netweaver Primary Application Server (PAS) instance number. + +#### sap_swpm_pas_instance_hostname +- _Type:_ `string` + +Define SAP Netweaver Primary Application Server (PAS) hostname. + +#### sap_swpm_aas_instance_nr +- _Type:_ `string` + +Define SAP Netweaver Additional Application Server (AAS) instance number. + +#### sap_swpm_aas_instance_hostname +- _Type:_ `string` + +Define SAP Netweaver Additional Application Server (AAS) hostname. + +#### sap_swpm_java_scs_instance_nr +- _Type:_ `string` + +Define SAP Netweaver JAVA Central Services (SCS) instance number. + +#### sap_swpm_java_scs_instance_hostname +- _Type:_ `string` + +Define SAP Netweaver JAVA Central Services (SCS) hostname. + +#### sap_swpm_master_password +- _Type:_ `string` + +Define master password used for all users created during SWPM execution. + +#### sap_swpm_ddic_000_password +- _Type:_ `string` + +Define DDIC user password in client 000 for new install, or existing for restore. + +#### sap_swpm_virtual_hostname +- _Type:_ `string` + +Define virtual hostname when installing High Available instances (e.g. SAP ASCS/ERS cluster). + + +### Variables specific to SAP HANA Database Installation + +#### sap_swpm_db_ip +- _Type:_ `string` + +Define IP Address of database host for /etc/hosts update. + +#### sap_swpm_db_fqdn +- _Type:_ `string` + +Define FQDN of database host for /etc/hosts update. + +#### sap_swpm_db_host +- _Type:_ `string` + +Define hostname of database host for /etc/hosts update. + +#### sap_swpm_db_sid +- _Type:_ `string` + +Define database ID (SID). + +#### sap_swpm_db_instance_nr +- _Type:_ `string` + +Define database instance number. + +#### sap_swpm_db_system_password +- _Type:_ `string` + +Define database SYSTEM user password. + +#### sap_swpm_db_systemdb_password +- _Type:_ `string` + +Define database SYSTEMDB user password. + +#### sap_swpm_db_sidadm_password +- _Type:_ `string` + +Define database sidadm user password. + +#### sap_swpm_db_schema_abap +- _Type:_ `string` + +Define ABAP database schema name based on database type:
+- `SAPHANADB` for SAP HANA +- `ABAP` or `SAPABAP1` on IBM Db2 +- `SAPSR3` on Oracle DB + +#### sap_swpm_db_schema_abap_password +- _Type:_ `string` + +Define ABAP database schema password for new installation or restore from backup. + +#### sap_swpm_db_schema_java +- _Type:_ `string` + +Define JAVA database schema name. + +#### sap_swpm_db_schema_java_password +- _Type:_ `string` + +Define JAVA database schema password for new installation or restore from backup. + +#### sap_swpm_db_schema +- _Type:_ `string` + +#### sap_swpm_db_schema_password: +- _Type:_ `string` + + +### Variables specific to SAP JAVA UME + +#### sap_swpm_ume_client_nr +- _Type:_ `string` +- _Default:_ `000` + +Define client number of JAVA UME. + +#### sap_swpm_ume_type +- _Type:_ `string` + +Define type of JAVA UME. + +#### sap_swpm_ume_instance_nr +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_pas_instance_nr }}` + +Define instance number of JAVA UME. + +#### sap_swpm_ume_j2ee_admin_password +- _Type:_ `string` + +Define admin password for JAVA UME. + +#### sap_swpm_ume_j2ee_guest_password +- _Type:_ `string` + +Define guest password for JAVA UME. + +#### sap_swpm_ume_sapjsf_password +- _Type:_ `string` + +Define sapjsf password for JAVA UME. + +#### sap_swpm_ume_instance_hostname +- _Type:_ `string` + +Define instance hostname of JAVA UME. + + +### Variables specific to SAP HANA Database Restore + +#### sap_swpm_backup_location +- _Type:_ `string` + +Define directory with SAP HANA Backup files. + +#### sap_swpm_backup_prefix +- _Type:_ `string` + +Define prefix of SAP HANA Backup files. + +#### sap_swpm_backup_system_password +- _Type:_ `string` + +Define SAP HANA SYSTEM password from source database. + + +### Variables specific to SAP Web Dispatcher + +#### sap_swpm_wd_instance_nr +- _Type:_ `string` + +Define instance number of SAP Web Dispatcher. + +#### sap_swpm_wd_system_connectivity +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to set parameter `configureSystemConnectivity` to true during installation. + +#### sap_swpm_wd_activate_icf +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to activate ICF. + +#### sap_swpm_wd_backend_sid +- _Type:_ `string` + +Define backend SID for SAP Web Dispatcher connection. + +#### sap_swpm_wd_backend_ms_http_port +- _Type:_ `string` + +Define backend message server HTTP port for SAP Web Dispatcher connection. + +#### sap_swpm_wd_backend_ms_host +- _Type:_ `string` + +Define backend message server hostname for SAP Web Dispatcher connection. + +#### sap_swpm_wd_backend_rfc_host +- _Type:_ `string` + +Define backend hostname for SAP Web Dispatcher RFC connection. + +#### sap_swpm_wd_backend_rfc_instance_nr +- _Type:_ `string` + +Define backend instance number for SAP Web Dispatcher RFC connection. + +#### sap_swpm_wd_backend_rfc_client_nr +- _Type:_ `string` +- _Default:_ `000` + +Define backend SAP client for SAP Web Dispatcher RFC connection. + +#### sap_swpm_wd_backend_rfc_user +- _Type:_ `string` +- _Default:_ `DDIC` + +Define backend SAP user for SAP Web Dispatcher RFC connection. + +#### sap_swpm_wd_backend_rfc_user_password +- _Type:_ `string` + +Define password for backend SAP user for SAP Web Dispatcher RFC connection. + +#### sap_swpm_wd_backend_scenario_size +- _Type:_ `string` + +Define to set parameter `scenarioSize` during installation. + +#### sap_swpm_wd_virtual_host +- _Type:_ `string` + +Define virtual hostname of SAP Web Dispatcher. + + +### Variables for Linux User + +#### sap_swpm_sapadm_password +- _Type:_ `string` + +Define password for Linux user SAPADM. + +#### sap_swpm_sap_sidadm_password +- _Type:_ `string` + +Define password for Linux user SIDADM. + +#### sap_swpm_sapadm_uid +- _Type:_ `string` + +Define UID of Linux user SAPADM. + +#### sap_swpm_sapsys_gid +- _Type:_ `string` + +Define GID of Linux group SAPSYS. + +#### sap_swpm_sidadm_uid +- _Type:_ `string` + +Define UID of Linux user SIDADM. + + +### Miscellaneous Variables + +#### sap_swpm_ascs_install_gateway +- _Type:_ `string` +- _Default:_ `true` + +Enable to install gateway as part of ASCS installation. + +#### sap_swpm_parallel_jobs_nr +- _Type:_ `string` +- _Default:_ `23` + +Define to limit number of parallel extraction SAP HANA jobs. + +#### sap_swpm_diagnostics_agent_password +- _Type:_ `string` + +Define password for Diagnostic Agent. + +#### sap_swpm_igs_path +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_software_path }}` + +Define individual path for SAP IGS file. `sap_swpm_software_path` is used by default. + +#### sap_swpm_igs_file_name +- _Type:_ `string` + +Define individual name of SAP IGS file. Newest file is auto-detected in `sap_swpm_igs_path`. + +#### sap_swpm_igs_helper_path +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_software_path }}` + +Define individual path for SAP IGS Helper file. `sap_swpm_software_path` is used by default. + +#### sap_swpm_igs_helper_file_name +- _Type:_ `string` + +Define individual name of SAP IGS Helper file. Newest file is auto-detected in `sap_swpm_igs_helper_path`. + +#### sap_swpm_kernel_dependent_path +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_software_path }}` + +Define individual path for Database dependent kernel files. `sap_swpm_software_path` is used by default. + +#### sap_swpm_kernel_dependent_file_name +- _Type:_ `string` + +Define individual name of Database dependent kernel file. Newest file is auto-detected in `sap_swpm_kernel_dependent_path`. + +#### sap_swpm_kernel_independent_path +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_software_path }}` + +Define individual path for Database independent kernel files. `sap_swpm_software_path` is used by default. + +#### sap_swpm_kernel_independent_file_name +- _Type:_ `string` + +Define individual name of Database independent kernel file. Newest file is auto-detected in `sap_swpm_kernel_independent_path`. + +#### sap_swpm_web_dispatcher_path +- _Type:_ `string` +- _Default:_ `{{ sap_swpm_software_path }}` + +Define individual path for SAP Web Dispatcher files. `sap_swpm_software_path` is used by default. + +#### sap_swpm_web_dispatcher_file_name +- _Type:_ `string` + +Define individual name of SAP Web Dispatcher file. Newest file is auto-detected in `sap_swpm_web_dispatcher_path`. + +#### sap_swpm_fqdn +- _Type:_ `string` + +Define FQDN for SAP Installation. + +#### sap_swpm_set_fqdn +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` to disable enabling of FQDN during SWPM. + +#### sap_swpm_use_password_file +- _Type:_ `string` +- _Default:_ `n` + +Set to `y` to use encrypted password file for SWPM execution.
Location has to be same as parameter file location. + +#### sap_swpm_password_file_path +- _Type:_ `string` + +Define path to encrypted password file, used when `sap_swpm_use_password_file` is set to `y`. + +#### sap_swpm_use_livecache +- _Type:_ `bool` +- _Default:_ `false` + +Enable to use Livecache + +#### sap_swpm_load_type +- _Type:_ `string` +- _Default:_ `SAP` + +Define load type parameter `loadType`. + +#### sap_swpm_generic +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to execute `sap_swpm` role in generic auto-detection mode, ignoring steps for individual detection. + +#### sap_swpm_swpm_installation_type +- _Type:_ `string` + +Define installation type method. Available types: `restore`, `ha`, `maint_plan_stack`, `ha_maint_plan_stack`.
+Installation type is auto-detected from `sap_swpm_product_catalog_id`. + +#### sap_swpm_swpm_command_virtual_hostname +- _Type:_ `string` + +Define to override default virtual hostname `sap_swpm_virtual_hostname` sapinst command used for HA installation. + +#### sap_swpm_swpm_command_mp_stack +- _Type:_ `string` + +Define to override default sapinst command parameter for Maintenance Plan stack file. + +#### sap_swpm_setup_firewall +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to configure firewall after SWPM execution. + +#### sap_swpm_update_etchosts +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to to update `/etc/hosts` file with SAP system details for SWPM execution. + +#### sap_swpm_display_unattended_output +- _Type:_ `bool` +- _Default:_ `false` + +Set to `true` to display what sapinst command is being executed. + + +### Variables for setting owner, group, and permissions for the SAP files in `sap_swpm_software_path` + +#### sap_swpm_set_file_permissions +- _Type:_ `bool` +- _Default:_ `true` + +Set to `false` to not change the owner, group, and permissions of the files in `sap_swpm_software_path`. + +#### sap_swpm_software_directory_mode +- _Type:_ `string` +- _Default:_ `0755` + +Set permissions for all directories in `sap_swpm_software_path`. + +#### sap_swpm_software_directory_owner +- _Type:_ `string` +- _Default:_ `root` + +Set owner for all directories in `sap_swpm_software_path`. + +#### sap_swpm_software_directory_group +- _Type:_ `string` +- _Default:_ `root` + +Set group ownership for all directories in `sap_swpm_software_path`. + +#### sap_swpm_files_sapcar_mode +- _Type:_ `string` +- _Default:_ `0755` + +Set permissions for SAPCAR file in `sap_swpm_sapcar_path`. + +#### sap_swpm_files_sapcar_owner +- _Type:_ `string` +- _Default:_ `root` + +Set owner for SAPCAR file in `sap_swpm_sapcar_path`. + +#### sap_swpm_files_sapcar_group +- _Type:_ `string` +- _Default:_ `root` + +Set group ownership for SAPCAR file in `sap_swpm_sapcar_path`. + +#### sap_swpm_files_non_sapcar_mode +- _Type:_ `string` +- _Default:_ `0644` + +Set permissions for all non-SAPCAR files in `sap_swpm_software_path` and for SWPM*.SAR files in `sap_swpm_swpm_path`. + +#### sap_swpm_files_non_sapcar_owner +- _Type:_ `string` +- _Default:_ `root` + +Set owner for all non-SAPCAR files in `sap_swpm_software_path` and for SWPM*.SAR files in `sap_swpm_swpm_path`. + +#### sap_swpm_files_non_sapcar_group +- _Type:_ `string` +- _Default:_ `root` + +Set group ownership for all non-SAPCAR files in `sap_swpm_software_path` and for SWPM*.SAR files in `sap_swpm_swpm_path`. + \ No newline at end of file From 384f4d82f22f2f9ea6bb49bc3fb4ffb4f085e30a Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 11 Oct 2024 11:05:01 +0200 Subject: [PATCH 169/210] fix: Issue 868 fix for SLES4SAP15 SP6 --- roles/sap_hana_preconfigure/defaults/main.yml | 13 +++---- .../meta/argument_specs.yml | 4 +-- roles/sap_hana_preconfigure/tasks/main.yml | 8 ++++- .../defaults/main.yml | 26 ++++++-------- .../meta/argument_specs.yml | 7 ++-- .../tasks/SLES/installation.yml | 29 ++++++++++++---- .../sap_netweaver_preconfigure/tasks/main.yml | 8 ++++- .../vars/SLES_SAP_15.6.yml | 34 +++++++++++++++++++ 8 files changed, 91 insertions(+), 38 deletions(-) create mode 100644 roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index 741fed623..55e1ec05f 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -166,18 +166,15 @@ sap_hana_preconfigure_run_grub2_mkconfig: true # It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999. # Example: See README.md -sap_hana_preconfigure_saptune_version: '' -# Version of saptune to install (SLES for SAP Applications). +# (SUSE specific) Version of saptune to install. # It is recommended to install latest version by keeping this variable empty. # This will replace the current installed version if present, even downgrade if necessary. +sap_hana_preconfigure_saptune_version: '' +# (SUSE specific) Saptune solution to be applied. +# Available options for HANA are: HANA, NETWEAVER+HANA, S4HANA-APP+DB, S4HANA-DBSERVER sap_hana_preconfigure_saptune_solution: 'HANA' -# The saptune solution to apply (SLES for SAP Applications). -# Possible Values: -# - HANA -# - NETWEAVER+HANA -# - S4HANA-APP+DB -# - S4HANA-DBSERVER + sap_hana_preconfigure_saptune_azure: false # On Azure, TCP timestamps, reuse and recycle should be disabled (SLES for SAP Applications). diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index 53df54c5e..ecb0c5cdb 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -353,7 +353,7 @@ argument_specs: sap_hana_preconfigure_saptune_version: default: '' description: - - Version of saptune to install (SLES for SAP Applications). + - (SUSE specific) Version of saptune to install. - This will replace the current installed version if present, even downgrade if necessary. required: false type: str @@ -361,7 +361,7 @@ argument_specs: sap_hana_preconfigure_saptune_solution: default: HANA description: - - The saptune solution to apply (SLES for SAP Applications). + - (SUSE specific) Saptune solution to be applied. choices: - 'HANA' - 'NETWEAVER+HANA' diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index e977d796d..03dfb9814 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -5,12 +5,18 @@ ansible.builtin.debug: var: role_path +# Load variable file starting with actual version up to OS family. +# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: +# 1. SLES_SAP_15.6.yml +# 2. SLES_SAP_15.yml +# 3. SLES_15.yml +# 4. Suse.yml - name: Include OS specific vars ansible.builtin.include_vars: '{{ item }}' with_first_found: - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' + - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_os_family }}.yml' - name: Set filename prefix to empty string if role is run in normal mode diff --git a/roles/sap_netweaver_preconfigure/defaults/main.yml b/roles/sap_netweaver_preconfigure/defaults/main.yml index 6b46f5183..36afc47db 100644 --- a/roles/sap_netweaver_preconfigure/defaults/main.yml +++ b/roles/sap_netweaver_preconfigure/defaults/main.yml @@ -3,30 +3,24 @@ # defaults file for sap_netweaver_preconfigure # Perform an assertion run: -sap_netweaver_preconfigure_assert: no +sap_netweaver_preconfigure_assert: false # In case of an assertion run, if set to "yes", the role will abort for any assertion error: -sap_netweaver_preconfigure_assert_ignore_errors: no +sap_netweaver_preconfigure_assert_ignore_errors: false sap_netweaver_preconfigure_min_swap_space_mb: '20480' -sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured: yes +sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured: true sap_netweaver_preconfigure_rpath: '/usr/sap/lib' -sap_netweaver_preconfigure_use_adobe_doc_services: no +sap_netweaver_preconfigure_use_adobe_doc_services: true -#SLES Only -sap_netweaver_preconfigure_saptune_version: '3.0.2' - -## The following variables control aspects of saptune and are only relevant for SLES for SAP Application - -# The saptune solution to apply. For netweaver, the only appropriate options are: -#NETWEAVER -#NETWEAVER+HANA -#S4HANA-APP+DB -#S4HANA-APPSERVER -#S4HANA-DBSERVER -# The default value is NETWEAVER +# (SUSE specific) Version of saptune to install. +# It is recommended to install latest version by keeping this variable empty. +# This will replace the current installed version if present, even downgrade if necessary. +sap_netweaver_preconfigure_saptune_version: '' +# (SUSE specific) Saptune solution to be applied. +# Available options for Netweaver are: NETWEAVER, NETWEAVER+HANA, S4HANA-APP+DB, S4HANA-APPSERVER, S4HANA-DBSERVER sap_netweaver_preconfigure_saptune_solution: NETWEAVER diff --git a/roles/sap_netweaver_preconfigure/meta/argument_specs.yml b/roles/sap_netweaver_preconfigure/meta/argument_specs.yml index 4f4554643..f9392052a 100644 --- a/roles/sap_netweaver_preconfigure/meta/argument_specs.yml +++ b/roles/sap_netweaver_preconfigure/meta/argument_specs.yml @@ -96,16 +96,17 @@ argument_specs: type: bool sap_netweaver_preconfigure_saptune_version: - default: '3.0.2' + default: '' description: - - On SLES systems, specifies the saptune version + - (SUSE specific) Version of saptune to install. + - This will replace the current installed version if present, even downgrade if necessary. required: false type: str sap_netweaver_preconfigure_saptune_solution: default: 'NETWEAVER' description: - - On SLES systems, specifies the saptune solution to apply. + - (SUSE specific) Saptune solution to be applied. choices: - 'NETWEAVER' - 'NETWEAVER+HANA' diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml index 14764a4f4..72981ca44 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/installation.yml @@ -20,15 +20,30 @@ - '"SLES" in sles_baseproduct.stat.lnk_target' - ansible_os_family == 'Suse' -# The use of zypper here allows exact saptune version to be declared and used. -- name: Ensure saptune is installed - community.general.zypper: - type: package - name: "saptune={{ sap_netweaver_preconfigure_saptune_version }}" - state: present - force: true + +- name: Prepare saptune when: - __sap_netweaver_preconfigure_run_saptune + block: + - name: Ensure latest saptune is installed + community.general.zypper: + type: package + name: saptune + state: present + when: + - sap_netweaver_preconfigure_saptune_version is undefined + or sap_netweaver_preconfigure_saptune_version | length == 0 + + - name: Ensure specific saptune version is installed + community.general.zypper: + type: package + name: "saptune={{ sap_netweaver_preconfigure_saptune_version }}" + state: present + force: true + when: + - sap_netweaver_preconfigure_saptune_version is defined + - sap_netweaver_preconfigure_saptune_version | length > 0 + - name: Ensure sapconf is installed community.general.zypper: diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index 016d3a7a7..29c5cc725 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -5,12 +5,18 @@ ansible.builtin.debug: var: role_path +# Load variable file starting with actual version up to OS family. +# Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: +# 1. SLES_SAP_15.6.yml +# 2. SLES_SAP_15.yml +# 3. SLES_15.yml +# 4. Suse.yml - name: Include OS specific vars ansible.builtin.include_vars: '{{ item }}' with_first_found: - - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' + - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_os_family }}.yml' - name: Set filename prefix to empty string if role is run in normal mode diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml b/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml new file mode 100644 index 000000000..50d05f4aa --- /dev/null +++ b/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# required SAP Notes for SLES 15 + +__sap_netweaver_preconfigure_sapnotes: + - "1275776" + +__sap_netweaver_preconfigure_packages: + - libstdc++6 + - libatomic1 + - libgcc_s1 + - libltdl7 + - insserv-compat + - cpupower + - hicolor-icon-theme + - libcpupower1 + - libsensors4 + - patterns-base-basesystem + - patterns-server-enterprise-sap_server + - patterns-yast-yast2_basis + - procmail + - sysstat + - system-user-uuidd + - uuidd + - yast2-auth-client + - yast2-auth-server + - yast2-theme + - yast2-vpn + - tcsh + - acl + +# SLES_SAP is using saptune, but SLES is using sapconf. +# Default value true runs saptune, but installation.yml auto-detects base product and adjusts. +__sap_netweaver_preconfigure_run_saptune: true From a927ec5c4f98a75aa7088f6a026a31c39ee305c4 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 11 Oct 2024 12:47:54 +0200 Subject: [PATCH 170/210] feat: Add new minor version across distribution --- roles/sap_hana_preconfigure/tasks/main.yml | 10 ++++++---- roles/sap_hana_preconfigure/vars/SLES_15.yml | 5 +++-- roles/sap_netweaver_preconfigure/tasks/main.yml | 10 ++++++---- .../vars/{SLES_SAP_15.6.yml => SLES_15.6.yml} | 6 ++++-- roles/sap_netweaver_preconfigure/vars/SLES_15.yml | 4 +++- 5 files changed, 22 insertions(+), 13 deletions(-) rename roles/sap_netweaver_preconfigure/vars/{SLES_SAP_15.6.yml => SLES_15.6.yml} (78%) diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 03dfb9814..1708ca6aa 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -7,15 +7,17 @@ # Load variable file starting with actual version up to OS family. # Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. SLES_SAP_15.6.yml -# 2. SLES_SAP_15.yml -# 3. SLES_15.yml -# 4. Suse.yml +# 1. SLES_SAP_15.6.yml - Specific to distribution with major and minor release. +# 2. SLES_SAP_15.yml - Specific to distribution and major release regardless of minor release. +# 3. SLES_15.6.yml - Specific to distribution family (SLES and SLES4SAP) and minor release. +# 4. SLES_15.yml - Specific to distribution. +# 5. Suse.yml - Specific to OS family. - name: Include OS specific vars ansible.builtin.include_vars: '{{ item }}' with_first_found: - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' + - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_os_family }}.yml' diff --git a/roles/sap_hana_preconfigure/vars/SLES_15.yml b/roles/sap_hana_preconfigure/vars/SLES_15.yml index a52238bad..1f98593b5 100644 --- a/roles/sap_hana_preconfigure/vars/SLES_15.yml +++ b/roles/sap_hana_preconfigure/vars/SLES_15.yml @@ -1,7 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 --- - -# required SAP Notes for SLES 15 +# Variables specific to following versions: +# - SUSE Linux Enterprise Server for SAP Applications 15 +# - SUSE Linux Enterprise Server 15 __sap_hana_preconfigure_sapnotes: # - "{% if ansible_architecture == 'ppc64le' %}2055470{% endif %}" diff --git a/roles/sap_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index 29c5cc725..f0a525abd 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -7,15 +7,17 @@ # Load variable file starting with actual version up to OS family. # Example for SUSE Linux Enterprise Server for SAP Applications 15 SP6: -# 1. SLES_SAP_15.6.yml -# 2. SLES_SAP_15.yml -# 3. SLES_15.yml -# 4. Suse.yml +# 1. SLES_SAP_15.6.yml - Specific to distribution with major and minor release. +# 2. SLES_SAP_15.yml - Specific to distribution and major release regardless of minor release. +# 3. SLES_15.6.yml - Specific to distribution family (SLES and SLES4SAP) and minor release. +# 4. SLES_15.yml - Specific to distribution. +# 5. Suse.yml - Specific to OS family. - name: Include OS specific vars ansible.builtin.include_vars: '{{ item }}' with_first_found: - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml' + - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_version }}.yml' - '{{ ansible_distribution.split("_")[0] }}_{{ ansible_distribution_major_version }}.yml' - '{{ ansible_os_family }}.yml' diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml similarity index 78% rename from roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml rename to roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml index 50d05f4aa..34ad9619a 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.6.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.6.yml @@ -1,6 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 --- -# required SAP Notes for SLES 15 +# Variables specific to following versions: +# - SUSE Linux Enterprise Server for SAP Applications 15 SP6 +# - SUSE Linux Enterprise Server 15 SP6 __sap_netweaver_preconfigure_sapnotes: - "1275776" @@ -13,7 +15,7 @@ __sap_netweaver_preconfigure_packages: - insserv-compat - cpupower - hicolor-icon-theme - - libcpupower1 + - libcpupower1 # libcpupower0 was removed in SP6 - libsensors4 - patterns-base-basesystem - patterns-server-enterprise-sap_server diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml index 454c589b0..b6f0bacc6 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml @@ -1,6 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 --- -# required SAP Notes for SLES 15 +# Variables specific to following versions: +# - SUSE Linux Enterprise Server for SAP Applications 15 +# - SUSE Linux Enterprise Server 15 __sap_netweaver_preconfigure_sapnotes: - "1275776" From c12fa431f9451922c1ac7459c42347b2eb712269 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 21 Oct 2024 18:08:23 +0200 Subject: [PATCH 171/210] sap_swpm: Use sap_maintain_etc_hosts role; use booleans Signed-off-by: Bernd Finger --- roles/sap_swpm/defaults/main.yml | 30 +++++----- roles/sap_swpm/tasks/post_install.yml | 2 +- roles/sap_swpm/tasks/pre_install.yml | 4 +- roles/sap_swpm/tasks/pre_install/firewall.yml | 4 +- .../tasks/pre_install/prepare_software.yml | 2 +- .../tasks/pre_install/swpm_prepare.yml | 2 +- .../tasks/pre_install/update_etchosts.yml | 58 +++++++------------ 7 files changed, 44 insertions(+), 58 deletions(-) diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index fd24c156a..726342fcd 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -154,7 +154,7 @@ sap_swpm_software_extract_directory: # e.g. /software/sap_swpm_extracted # Note: # When using SWPM2 (for modern SAP products such as S/4 B/4), using .SAR files is recommended - param value should be false # When using SWPM1 (for older SAP products), using CD Media is the only choice - param value should be true -sap_swpm_software_use_media: 'false' +sap_swpm_software_use_media: false # Main path that this role will look for .SAR files #sap_swpm_software_path: /software/sapfiles @@ -190,12 +190,12 @@ sap_swpm_ibmdb2_unpack_path: "/db2/db2{{ sap_swpm_db_sid | lower }}/db2_software sap_swpm_mp_stack_path: sap_swpm_mp_stack_file_name: # SUM -sap_swpm_sum_prepare: 'false' -sap_swpm_sum_start: 'false' +sap_swpm_sum_prepare: false +sap_swpm_sum_start: false sap_swpm_sum_batch_file: -sap_swpm_spam_update: 'false' +sap_swpm_spam_update: false sap_swpm_spam_update_sar: -sap_swpm_configure_tms: 'true' +sap_swpm_configure_tms: true sap_swpm_tmsadm_password: sap_swpm_tms_tr_files_path: # --- Experimental --- # @@ -210,7 +210,7 @@ sap_swpm_swpm_observer_mode: false sap_swpm_swpm_remote_access_user: # --- Experimental - SWPM Observer mode --- # -sap_swpm_install_saphostagent: 'true' +sap_swpm_install_saphostagent: true ######################################## @@ -357,7 +357,7 @@ sap_swpm_backup_prefix: sap_swpm_backup_system_password: # ASCS Install Gateway -sap_swpm_ascs_install_gateway: "true" +sap_swpm_ascs_install_gateway: true ######################################## @@ -368,8 +368,8 @@ sap_swpm_ascs_install_gateway: "true" sap_swpm_wd_instance_nr: -sap_swpm_wd_system_connectivity: 'false' -sap_swpm_wd_activate_icf: 'false' +sap_swpm_wd_system_connectivity: false +sap_swpm_wd_activate_icf: false sap_swpm_wd_backend_sid: sap_swpm_wd_backend_ms_http_port: sap_swpm_wd_backend_ms_host: @@ -422,18 +422,18 @@ sap_swpm_kernel_independent_file_name: sap_swpm_web_dispatcher_path: sap_swpm_web_dispatcher_file_name: sap_swpm_fqdn: -sap_swpm_set_fqdn: "true" +sap_swpm_set_fqdn: true # If the template to use already has the passwords and they are encrypted the password file must be in the same path as the parameter file -sap_swpm_use_password_file: "n" +sap_swpm_use_password_file: false sap_swpm_password_file_path: -sap_swpm_use_livecache: "false" +sap_swpm_use_livecache: false sap_swpm_ddic_001_password: sap_swpm_load_type: 'SAP' -sap_swpm_generic: 'false' +sap_swpm_generic: false # SWPM sap_swpm_swpm_installation_type: "" @@ -442,10 +442,10 @@ sap_swpm_swpm_command_virtual_hostname: "" sap_swpm_swpm_command_mp_stack: "" # Firewall setup -sap_swpm_setup_firewall: 'false' +sap_swpm_setup_firewall: false # Update /etc/hosts -sap_swpm_update_etchosts: 'false' +sap_swpm_update_etchosts: false # Display SAP SWPM Unattended Mode output (sapinst stdout) sap_swpm_display_unattended_output: false diff --git a/roles/sap_swpm/tasks/post_install.yml b/roles/sap_swpm/tasks/post_install.yml index 935ed0571..65fba3cf0 100644 --- a/roles/sap_swpm/tasks/post_install.yml +++ b/roles/sap_swpm/tasks/post_install.yml @@ -17,7 +17,7 @@ - name: SAP SWPM Post Install - Firewall Setup ansible.builtin.include_tasks: post_install/firewall.yml when: - - "sap_swpm_setup_firewall | bool" + - sap_swpm_setup_firewall ######################################################################################################################## diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 3e8436560..803ad9c96 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -142,7 +142,7 @@ tags: sap_swpm_setup_firewall when: - sap_swpm_run_sapinst - - "sap_swpm_setup_firewall | bool" + - sap_swpm_setup_firewall tags: sap_swpm_setup_firewall # /etc/hosts @@ -154,7 +154,7 @@ tags: sap_swpm_update_etchosts when: - sap_swpm_run_sapinst - - "sap_swpm_update_etchosts | bool" + - sap_swpm_update_etchosts tags: sap_swpm_update_etchosts ################ diff --git a/roles/sap_swpm/tasks/pre_install/firewall.yml b/roles/sap_swpm/tasks/pre_install/firewall.yml index f27aea554..a36cb1644 100644 --- a/roles/sap_swpm/tasks/pre_install/firewall.yml +++ b/roles/sap_swpm/tasks/pre_install/firewall.yml @@ -54,7 +54,7 @@ - "51000" - "64997" when: - - not sap_swpm_generic | bool + - not sap_swpm_generic - name: SAP SWPM Pre Install - Add Ports Based on NR - {{ sap_swpm_db_instance_nr }} ansible.builtin.include_tasks: update_firewall.yml @@ -62,7 +62,7 @@ loop_control: loop_var: passed_port when: - - not sap_swpm_generic | bool + - not sap_swpm_generic # Reason for noqa: We currently do not determine if reloading the firewall changes anything - name: SAP SWPM Pre Install - Reload Firewall # noqa no-changed-when diff --git a/roles/sap_swpm/tasks/pre_install/prepare_software.yml b/roles/sap_swpm/tasks/pre_install/prepare_software.yml index 62ca21d1f..26e40fb98 100644 --- a/roles/sap_swpm/tasks/pre_install/prepare_software.yml +++ b/roles/sap_swpm/tasks/pre_install/prepare_software.yml @@ -177,7 +177,7 @@ - sap_swpm_set_file_permissions - name: SAP SWPM Pre Install - Full SAP System - when: not sap_swpm_generic | bool + when: not sap_swpm_generic block: # 3. IGS diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index bbb21945a..f2ae6cb62 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -26,7 +26,7 @@ dest: "{{ sap_swpm_tmpdir.path }}/instkey.pkey" remote_src: yes mode: '0640' - when: sap_swpm_use_password_file == "y" + when: sap_swpm_use_password_file # Create the SWPM inifile - name: SAP SWPM Pre Install - Generate the SWPM inifile diff --git a/roles/sap_swpm/tasks/pre_install/update_etchosts.yml b/roles/sap_swpm/tasks/pre_install/update_etchosts.yml index 4adbdcf34..815ae29e6 100644 --- a/roles/sap_swpm/tasks/pre_install/update_etchosts.yml +++ b/roles/sap_swpm/tasks/pre_install/update_etchosts.yml @@ -1,75 +1,61 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Update etc hosts for NW +# Update /etc/hosts for NW -- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' is not configured for NW due to missing 'sap_swpm_fqdn' +- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' will not be configured for NW due to missing 'sap_swpm_fqdn' ansible.builtin.debug: msg: "WARN: Not configuring NW entries in '/etc/hosts' because 'sap_swpm_fqdn' is not defined!" when: (sap_swpm_fqdn | type_debug == 'NoneType') or (sap_swpm_fqdn | length == 0) -# Update etc hosts for HANA - - name: SAP SWPM Pre Install - Update '/etc/hosts' for NW + ansible.builtin.import_role: + name: 'community.sap_install.sap_maintain_etc_hosts' + vars: + sap_maintain_etc_hosts_list: + - node_ip: "{{ ansible_default_ipv4.address | d(ansible_all_ipv4_addresses[0]) }}" + node_name: "{{ ansible_hostname }}" + node_domain: "{{ sap_swpm_fqdn }}" + state: present when: - "sap_swpm_fqdn | type_debug != 'NoneType'" - "sap_swpm_fqdn | length > 0" - block: - - - name: SAP SWPM Pre Install - Deduplicate values from '/etc/hosts' - ansible.builtin.lineinfile: - path: /etc/hosts - create: false - regexp: (?i)^\s*{{ ansible_default_ipv4.address | d(ansible_all_ipv4_addresses[0]) }}\s+ - state: absent -# Reason for noqa: 1. Tabs can increase readability; -# 2. Tabs are allowed for /etc/hosts - - name: SAP SWPM Pre Install - Update '/etc/hosts' with NW entry # noqa no-tabs - ansible.builtin.lineinfile: - path: /etc/hosts - line: "{{ ansible_default_ipv4.address | d(ansible_all_ipv4_addresses[0]) }}\t{{ ansible_hostname }}.{{ sap_swpm_fqdn }}\t{{ ansible_hostname }}" +# Update /etc/hosts for HANA -- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' is not configured for HANA due to missing 'sap_swpm_db_ip' +- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' will not be configured for HANA due to missing 'sap_swpm_db_ip' ansible.builtin.debug: msg: "WARN: Not configuring HANA entries in '/etc/hosts' because 'sap_swpm_db_ip' is not defined!" when: (sap_swpm_db_ip | type_debug == 'NoneType') or (sap_swpm_db_ip | length == 0) -- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' is not configured for HANA due to missing 'sap_swpm_db_host' +- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' will not be configured for HANA due to missing 'sap_swpm_db_host' ansible.builtin.debug: msg: "WARN: Not configuring HANA entries in '/etc/hosts' because 'sap_swpm_db_host' is not defined!" when: (sap_swpm_db_host | type_debug == 'NoneType') or (sap_swpm_db_host | length == 0) -- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' is not configured for HANA because 'sap_swpm_db_host' is the current host +- name: SAP SWPM Pre Install - Display warning message if '/etc/hosts' will not be configured for HANA because 'sap_swpm_db_host' is the current host ansible.builtin.debug: msg: "WARN: Not configuring HANA entries in '/etc/hosts' because 'sap_swpm_db_host' is the current host!" when: sap_swpm_db_host == ansible_hostname - name: SAP SWPM Pre Install - Update '/etc/hosts' for HANA + ansible.builtin.import_role: + name: 'community.sap_install.sap_maintain_etc_hosts' + vars: + sap_maintain_etc_hosts_list: + - node_ip: "{{ sap_swpm_db_ip }}" + node_name: "{{ sap_swpm_db_host }}" + node_domain: "{{ sap_swpm_fqdn }}" + state: present when: - "sap_swpm_db_ip | type_debug != 'NoneType'" - "sap_swpm_db_ip | length > 0" - "sap_swpm_db_host | type_debug != 'NoneType'" - "sap_swpm_db_host | length > 0" - "sap_swpm_db_host != ansible_hostname" - block: - - - name: SAP SWPM Pre Install - Deduplicate values from '/etc/hosts' - ansible.builtin.lineinfile: - path: /etc/hosts - create: false - regexp: (?i)^\s*{{ sap_swpm_db_ip }}\s+ - state: absent - -# Reason for noqa: 1. Tabs can increase readability; -# 2. Tabs are allowed for /etc/hosts - - name: SAP SWPM Pre Install - Update '/etc/hosts' with HANA entry # noqa no-tabs - ansible.builtin.lineinfile: - path: /etc/hosts - line: "{{ sap_swpm_db_ip }}\t{{ sap_swpm_db_host }}.{{ sap_swpm_fqdn }}\t{{ sap_swpm_db_host }}" From 3d6c7977ba9c3091894545745285cd4fcb4a1dd1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 21 Oct 2024 20:58:36 +0200 Subject: [PATCH 172/210] sap_hana_preconfigure: Set THP to madvise from RHEL 9.2 onwards Solves issue #879. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/handlers/main.yml | 13 +++++- .../tasks/RedHat/generic/assert-thp.yml | 42 +++++++++++++++++-- .../tasks/RedHat/generic/configure-thp.yml | 30 +++++++++++++ .../tasks/sapnote/2777782.yml | 4 +- ...5-disable-thp.yml => 05-configure-thp.yml} | 4 +- .../tasks/sapnote/3108302.yml | 4 +- .../tasks/sapnote/3108302/05-assert-thp.yml | 2 +- .../sapnote/3108302/05-configure-thp.yml | 10 +++++ .../tasks/sapnote/3108302/05-disable-thp.yml | 10 ----- 9 files changed, 97 insertions(+), 22 deletions(-) create mode 100644 roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml rename roles/sap_hana_preconfigure/tasks/sapnote/2777782/{05-disable-thp.yml => 05-configure-thp.yml} (66%) create mode 100644 roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-configure-thp.yml delete mode 100644 roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml diff --git a/roles/sap_hana_preconfigure/handlers/main.yml b/roles/sap_hana_preconfigure/handlers/main.yml index afebc5699..542984485 100644 --- a/roles/sap_hana_preconfigure/handlers/main.yml +++ b/roles/sap_hana_preconfigure/handlers/main.yml @@ -71,11 +71,22 @@ - name: "Run grubby for enabling TSX" ansible.builtin.command: grubby --args="tsx=on" --update-kernel=ALL - register: __sap_hana_preconfigure_register_grubby_update changed_when: true listen: __sap_hana_preconfigure_grubby_update_handler notify: __sap_hana_preconfigure_reboot_handler +- name: "Run grubby for disabling THP" + ansible.builtin.command: grubby --args="transparent_hugepage=never" --update-kernel=ALL + changed_when: true + listen: __sap_hana_preconfigure_grubby_thp_never_handler + notify: __sap_hana_preconfigure_reboot_handler + +- name: "Run grubby for setting THP to madvise" + ansible.builtin.command: grubby --args="transparent_hugepage=madvise" --update-kernel=ALL + changed_when: true + listen: __sap_hana_preconfigure_grubby_thp_madvise_handler + notify: __sap_hana_preconfigure_reboot_handler + - name: Reboot the managed node ansible.builtin.reboot: test_command: /bin/true diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index e97efd54d..77fe53f72 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -1,8 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 --- -# can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- name: Perform steps for setting transparent_hugepage=never +# can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" or "transparent_hugepages=madvise" +- name: Perform steps for setting transparent_hugepage to 'never' or 'madvise' when: not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_modify_grub_cmdline_linux or sap_hana_preconfigure_assert_all_config | d(false) @@ -13,21 +13,55 @@ register: __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert changed_when: no - - name: Assert that transparent_hugepage=never is in GRUB_CMDLINE_LINUX in /etc/default/grub + - name: Assert that 'transparent_hugepage=never' is in GRUB_CMDLINE_LINUX in /etc/default/grub ansible.builtin.assert: that: "'transparent_hugepage=never' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" fail_msg: "FAIL: 'transparent_hugepage=never' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!" success_msg: "PASS: 'transparent_hugepage=never' is in GRUB_CMDLINE_LINUX in /etc/default/grub." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '7' or + ansible_distribution_major_version == '8' or + ansible_distribution_version == '9.0' or + ansible_distribution_version == '9.1' + + - name: Assert that 'transparent_hugepage=madvise' is in GRUB_CMDLINE_LINUX in /etc/default/grub + ansible.builtin.assert: + that: "'transparent_hugepage=madvise' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" + fail_msg: "FAIL: 'transparent_hugepage=madvise' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!" + success_msg: "PASS: 'transparent_hugepage=madvise' is in GRUB_CMDLINE_LINUX in /etc/default/grub." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '9' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 - name: THP - Get contents of /proc/cmdline ansible.builtin.command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_thp_assert changed_when: no - - name: Assert that transparent_hugepage=never is in /proc/cmdline + - name: Assert that 'transparent_hugepage=never' is in /proc/cmdline ansible.builtin.assert: that: "'transparent_hugepage=never' in __sap_hana_preconfigure_register_proc_cmdline_thp_assert.stdout" fail_msg: "FAIL: 'transparent_hugepage=never' is not in /proc/cmdline!" success_msg: "PASS: 'transparent_hugepage=never' is in /proc/cmdline." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '7' or + ansible_distribution_major_version == '8' or + ansible_distribution_version == '9.0' or + ansible_distribution_version == '9.1' + + - name: Assert that 'transparent_hugepage=madvise' is in /proc/cmdline + ansible.builtin.assert: + that: "'transparent_hugepage=madvise' in __sap_hana_preconfigure_register_proc_cmdline_thp_assert.stdout" + fail_msg: "FAIL: 'transparent_hugepage=madvise' is not in /proc/cmdline!" + success_msg: "PASS: 'transparent_hugepage=madvise' is in /proc/cmdline." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '9' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml new file mode 100644 index 000000000..fb07f278b --- /dev/null +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +- name: Get boot command line + ansible.builtin.slurp: + src: /proc/cmdline + register: __sap_hana_preconfigure_register_proc_cmdline_thp + +- name: Set THP to 'never' at boot time + ansible.builtin.command: /bin/true + notify: __sap_hana_preconfigure_grubby_thp_never_handler + changed_when: true + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '8' or + ansible_distribution_version == '9.0' or + ansible_distribution_version == '9.1' + - not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=never') ) + tags: grubconfig + +- name: Set THP to 'madvise' at boot time + ansible.builtin.command: /bin/true + notify: __sap_hana_preconfigure_grubby_thp_madvise_handler + changed_when: true + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '9' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 + - not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=madvise') ) + tags: grubconfig diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml index 9dce5fb8a..d200a097d 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782.yml @@ -23,8 +23,8 @@ ansible.builtin.import_tasks: 2777782/04-turn-off-auto-numa-balancing.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_04|d(false) -- name: Import tasks from '2777782/05-disable-thp.yml' - ansible.builtin.import_tasks: 2777782/05-disable-thp.yml +- name: Import tasks from '2777782/05-configure-thp.yml' + ansible.builtin.import_tasks: 2777782/05-configure-thp.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_05|d(false) - name: Import tasks from '2777782/06-configure-c-states-for-lower-latency.yml' diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-configure-thp.yml similarity index 66% rename from roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml rename to roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-configure-thp.yml index 8430fbba3..ee541f7cc 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-disable-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2777782/05-configure-thp.yml @@ -6,5 +6,5 @@ ansible.builtin.debug: msg: "SAP note 2777782 Step 5: Disable Transparent Hugepages (THP)" -- name: Import ../../RedHat/generic/disable-thp.yml - ansible.builtin.import_tasks: ../../RedHat/generic/disable-thp.yml +- name: Import ../../RedHat/generic/configure-thp.yml + ansible.builtin.import_tasks: ../../RedHat/generic/configure-thp.yml diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml index 81f00d5f5..f2cf27499 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302.yml @@ -23,8 +23,8 @@ ansible.builtin.import_tasks: 3108302/04-turn-off-auto-numa-balancing.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3108302_04|d(false) -- name: Import tasks from '3108302/05-disable-thp.yml' - ansible.builtin.import_tasks: 3108302/05-disable-thp.yml +- name: Import tasks from '3108302/05-configure-thp.yml' + ansible.builtin.import_tasks: 3108302/05-configure-thp.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3108302_05|d(false) - name: Import tasks from '3108302/06-configure-c-states-for-lower-latency.yml' diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml index 58e3d400e..9573a190e 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-assert-thp.yml @@ -4,7 +4,7 @@ # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" - name: Assert 3108302-5 ansible.builtin.debug: - msg: "SAP note 3108302 Step 5: Disable Transparent Hugepages (THP)" + msg: "SAP note 3108302 Step 5: Configure Transparent Hugepages (THP)" - name: Import ../../RedHat/generic/assert-thp.yml ansible.builtin.import_tasks: ../../RedHat/generic/assert-thp.yml diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-configure-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-configure-thp.yml new file mode 100644 index 000000000..f9d1fa746 --- /dev/null +++ b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-configure-thp.yml @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" or "transparent_hugepages=madvise" +- name: Configure 3108302-5 + ansible.builtin.debug: + msg: "SAP note 3108302 Step 5: Configure Transparent Hugepages (THP)" + +- name: Import ../../RedHat/generic/configure-thp.yml + ansible.builtin.import_tasks: ../../RedHat/generic/configure-thp.yml diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml b/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml deleted file mode 100644 index bf2db0e63..000000000 --- a/roles/sap_hana_preconfigure/tasks/sapnote/3108302/05-disable-thp.yml +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- name: Configure 3108302-5 - ansible.builtin.debug: - msg: "SAP note 3108302 Step 5: Disable Transparent Hugepages (THP)" - -- name: Import ../../RedHat/generic/disable-thp.yml - ansible.builtin.import_tasks: ../../RedHat/generic/disable-thp.yml From 6ae1d762089a87592b2b7964eeb3b113e9467457 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 24 Oct 2024 11:43:13 +0200 Subject: [PATCH 173/210] sap_hana_preconfigure: Also assert the current THP status Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/assert-thp.yml | 66 +++++++++---------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index 77fe53f72..76c032304 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -2,7 +2,7 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" or "transparent_hugepages=madvise" -- name: Perform steps for setting transparent_hugepage to 'never' or 'madvise' +- name: Assert correct setting of THP when: not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_modify_grub_cmdline_linux or sap_hana_preconfigure_assert_all_config | d(false) @@ -13,12 +13,19 @@ register: __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert changed_when: no - - name: Assert that 'transparent_hugepage=never' is in GRUB_CMDLINE_LINUX in /etc/default/grub - ansible.builtin.assert: - that: "'transparent_hugepage=never' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" - fail_msg: "FAIL: 'transparent_hugepage=never' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!" - success_msg: "PASS: 'transparent_hugepage=never' is in GRUB_CMDLINE_LINUX in /etc/default/grub." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + - name: THP - Get contents of /proc/cmdline + ansible.builtin.command: cat /proc/cmdline + register: __sap_hana_preconfigure_register_proc_cmdline_thp_assert + changed_when: no + + - name: THP - Get current status of THP + ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled + register: __sap_hana_preconfigure_register_sys_kernel_thp_assert + changed_when: no + + - name: Set fact for THP, RHEL up to RHEL 9.1 + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: 'never' when: - ansible_distribution == 'RedHat' - ansible_distribution_major_version == '7' or @@ -26,42 +33,31 @@ ansible_distribution_version == '9.0' or ansible_distribution_version == '9.1' - - name: Assert that 'transparent_hugepage=madvise' is in GRUB_CMDLINE_LINUX in /etc/default/grub - ansible.builtin.assert: - that: "'transparent_hugepage=madvise' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" - fail_msg: "FAIL: 'transparent_hugepage=madvise' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!" - success_msg: "PASS: 'transparent_hugepage=madvise' is in GRUB_CMDLINE_LINUX in /etc/default/grub." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" + - name: Set fact for THP, RHEL 9.2 and later + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: 'madvise' when: - ansible_distribution == 'RedHat' - ansible_distribution_major_version == '9' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 - - name: THP - Get contents of /proc/cmdline - ansible.builtin.command: cat /proc/cmdline - register: __sap_hana_preconfigure_register_proc_cmdline_thp_assert - changed_when: no + - name: Assert that 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in GRUB_CMDLINE_LINUX in /etc/default/grub + ansible.builtin.assert: + that: "'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" + fail_msg: "FAIL: 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is not in GRUB_CMDLINE_LINUX in /etc/default/grub!" + success_msg: "PASS: 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in GRUB_CMDLINE_LINUX in /etc/default/grub." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - - name: Assert that 'transparent_hugepage=never' is in /proc/cmdline + - name: Assert that 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in /proc/cmdline ansible.builtin.assert: - that: "'transparent_hugepage=never' in __sap_hana_preconfigure_register_proc_cmdline_thp_assert.stdout" - fail_msg: "FAIL: 'transparent_hugepage=never' is not in /proc/cmdline!" - success_msg: "PASS: 'transparent_hugepage=never' is in /proc/cmdline." + that: "'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' in __sap_hana_preconfigure_register_proc_cmdline_thp_assert.stdout" + fail_msg: "FAIL: 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is not in /proc/cmdline!" + success_msg: "PASS: 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in /proc/cmdline." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '7' or - ansible_distribution_major_version == '8' or - ansible_distribution_version == '9.0' or - ansible_distribution_version == '9.1' - - name: Assert that 'transparent_hugepage=madvise' is in /proc/cmdline + - name: Assert that THP currently has the correct current status ansible.builtin.assert: - that: "'transparent_hugepage=madvise' in __sap_hana_preconfigure_register_proc_cmdline_thp_assert.stdout" - fail_msg: "FAIL: 'transparent_hugepage=madvise' is not in /proc/cmdline!" - success_msg: "PASS: 'transparent_hugepage=madvise' is in /proc/cmdline." + that: __sap_hana_preconfigure_register_sys_kernel_thp_assert.stdout.split('[')[1].split(']')[0] == '{{ __sap_hana_preconfigure_fact_thp }}' + fail_msg: "FAIL: THP is currently configured with the status of '{{ __sap_hana_preconfigure_register_sys_kernel_thp_assert.stdout.split('[')[1].split(']')[0] }}' but it needs to be '{{ __sap_hana_preconfigure_fact_thp }}'!" + success_msg: "PASS: THP is currently configured with the correct status of '{{ __sap_hana_preconfigure_fact_thp }}'!" ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '9' and - __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 From 3585fe81b893d7e40ca290d554dcb2c64a9d6fd9 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 24 Oct 2024 11:47:45 +0200 Subject: [PATCH 174/210] sap_hana_preconfigure: Fix typo in THP assert task Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index 76c032304..9262fd71a 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -55,7 +55,7 @@ success_msg: "PASS: 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in /proc/cmdline." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - - name: Assert that THP currently has the correct current status + - name: Assert that THP currently has the correct status ansible.builtin.assert: that: __sap_hana_preconfigure_register_sys_kernel_thp_assert.stdout.split('[')[1].split(']')[0] == '{{ __sap_hana_preconfigure_fact_thp }}' fail_msg: "FAIL: THP is currently configured with the status of '{{ __sap_hana_preconfigure_register_sys_kernel_thp_assert.stdout.split('[')[1].split(']')[0] }}' but it needs to be '{{ __sap_hana_preconfigure_fact_thp }}'!" From b0a76ec9b49221b8f102b7384d851b842adddf8d Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 24 Oct 2024 11:50:56 +0200 Subject: [PATCH 175/210] sap_hana_preconfigure: Use false instead of no in THP assert tasks Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/assert-thp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index 9262fd71a..ba356730e 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -11,17 +11,17 @@ - name: THP - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub ansible.builtin.command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert - changed_when: no + changed_when: false - name: THP - Get contents of /proc/cmdline ansible.builtin.command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_thp_assert - changed_when: no + changed_when: false - name: THP - Get current status of THP ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled register: __sap_hana_preconfigure_register_sys_kernel_thp_assert - changed_when: no + changed_when: false - name: Set fact for THP, RHEL up to RHEL 9.1 ansible.builtin.set_fact: From a291af43d0bb0fcc38c3800e5ea983ebcd9245c0 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 24 Oct 2024 13:20:09 +0200 Subject: [PATCH 176/210] sap_hana_preconfigure: Also set the current THP state Signed-off-by: Bernd Finger --- .../tasks/RedHat/generic/configure-thp.yml | 34 +++++++++++++++++++ roles/sap_hana_preconfigure/vars/RedHat_9.yml | 4 +-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml index fb07f278b..7d056aa1a 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml @@ -28,3 +28,37 @@ __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 - not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=madvise') ) tags: grubconfig + +- name: Configure - Get initial status of THP + ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled + register: __sap_hana_preconfigure_register_thp_status_before + changed_when: false + +- name: Set THP to 'never' on the running system + ansible.builtin.shell: echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled + changed_when: true + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '8' or + ansible_distribution_version == '9.0' or + ansible_distribution_version == '9.1' + - __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != 'never' + +- name: Set THP to 'madvise' on the running system + ansible.builtin.shell: echo 'madvise' > /sys/kernel/mm/transparent_hugepage/enabled + changed_when: true + when: + - ansible_distribution == 'RedHat' + - ansible_distribution_major_version == '9' and + __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 + - __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != 'madvise' + +- name: Configure - Get the status of THP + ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled + register: __sap_hana_preconfigure_register_thp_status + ignore_errors: true + changed_when: false + +- name: Display the status of THP + ansible.builtin.debug: + var: __sap_hana_preconfigure_register_thp_status.stdout_lines, __sap_hana_preconfigure_register_thp_status.stderr_lines diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index ebc31864c..2ce0194b9 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -122,13 +122,13 @@ __sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '10' } + - { number: '3024346', version: '11' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '90' } - { number: '3108302', version: '9' } - { number: '2382421', version: '45' } - - { number: '3024346', version: '10' } + - { number: '3024346', version: '11' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" From 573bb12d2be67da5f2d54768690f875ac434fc09 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Fri, 25 Oct 2024 17:43:22 +0200 Subject: [PATCH 177/210] Feat: JAVA HA scenario Added SCS/ERS Classic and Simple Mount Refactor of nwas_abap to work with java Refactor of private variables Backwards compatibility for nwas_abap --- roles/sap_ha_pacemaker_cluster/README.md | 34 +- .../defaults/main.yml | 286 +++++-------- .../meta/argument_specs.yml | 225 +++++++--- .../Suse/post_steps_nwas_abap_ascs_ers.yml | 2 +- ...nfigure_nwas_ascs_ers_postinstallation.yml | 86 ++-- .../tasks/construct_vars_common.yml | 2 +- .../construct_vars_nwas_abap_ascs_ers.yml | 112 ++--- ...t_vars_nwas_abap_ascs_ers_simple_mount.yml | 70 ++-- .../tasks/construct_vars_nwas_common.yml | 18 +- .../construct_vars_nwas_java_scs_ers.yml | 388 +++++++++++------- ...ct_vars_nwas_java_scs_ers_simple_mount.yml | 210 ++++++++++ .../tasks/construct_vars_stonith.yml | 14 +- .../tasks/construct_vars_vip_groups.yml | 12 +- .../tasks/include_construct_vip_resources.yml | 32 +- .../tasks/include_vars_hana.yml | 116 ++++++ .../tasks/include_vars_nwas.yml | 330 +++++++++++++++ roles/sap_ha_pacemaker_cluster/tasks/main.yml | 65 ++- ...uct_vars_vip_resources_cloud_gcp_ce_vm.yml | 4 +- ...t_vars_vip_resources_cloud_ibmcloud_vs.yml | 4 +- .../platform/preconfigure_cloud_gcp_ce_vm.yml | 8 +- .../preconfigure_cloud_ibmcloud_vs.yml | 8 +- .../tasks/validate_input_parameters.yml | 221 ++++++++-- .../templates/cluster_create_config.j2 | 28 +- .../vars/hana_scaleout_perf.yml | 2 +- .../vars/hana_scaleup_perf.yml | 6 +- roles/sap_ha_pacemaker_cluster/vars/main.yml | 17 +- .../vars/nwas_abap_ascs_ers.yml | 12 +- .../vars/nwas_common.yml | 2 +- .../vars/nwas_java_scs_ers.yml | 14 + .../vars/platform_cloud_aws_ec2_vs.yml | 8 +- .../vars/platform_cloud_gcp_ce_vm.yml | 12 +- .../vars/platform_cloud_ibmcloud_powervs.yml | 12 +- .../vars/platform_cloud_ibmcloud_vs.yml | 12 +- .../vars/platform_cloud_msazure_vm.yml | 12 +- .../vars/platform_hyp_ibmpower_vm.yml | 10 +- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 4 +- roles/sap_ha_pacemaker_cluster/vars/suse.yml | 4 +- 37 files changed, 1676 insertions(+), 726 deletions(-) create mode 100644 roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml create mode 100644 roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 97491599f..2be284e0b 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -613,20 +613,20 @@ Mandatory for the cluster setup on MS Azure instances.
Instance number of the NetWeaver ABAP AAS instance.
Mandatory for NetWeaver AAS cluster configuration.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 +### sap_ha_pacemaker_cluster_nwas_cs_ensa1 - _Type:_ `bool` - _Default:_ `False` -The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2.
+The standard NetWeaver Central Services (ASCS or SCS) cluster will be set up as ENSA2.
Set this parameter to 'true' to configure it as ENSA1.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount +### sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - _Type:_ `bool` - _Default:_ `True` -Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount
+Enables preferred method for Central Services (ASCS or SCS) ENSA2 clusters - Simple Mount.
Set this parameter to 'true' to configure ENSA2 Simple Mount.
### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name @@ -643,11 +643,11 @@ Name of the filesystem resource for the ASCS instance.
NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr +### sap_ha_pacemaker_cluster_nwas_ascs_instance_nr - _Type:_ `string` -Instance number of the NetWeaver ABAP ASCS instance.
+Instance number of the NetWeaver ABAP Central Services (ASCS) instance.
Mandatory for NetWeaver ASCS/ERS cluster configuration.
### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool @@ -657,21 +657,21 @@ Mandatory for NetWeaver ASCS/ERS cluster configuration.
NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout +### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout - _Type:_ `string` - _Default:_ `60` -NetWeaver ASCS instance failure-timeout attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+NetWeaver Central Services (ASCS or SCS) instance failure-timeout attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold +### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold - _Type:_ `string` - _Default:_ `1` -NetWeaver ASCS instance migration-threshold setting attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). Default setup is ENSA2.
+NetWeaver Central Services (ASCS or SCS) instance migration-threshold setting attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name @@ -766,7 +766,7 @@ Name of the ERS SAPstartSrv resource for simple mount.
Instance number of the NetWeaver ABAP PAS instance.
Mandatory for NetWeaver PAS cluster configuration.
-### sap_ha_pacemaker_cluster_nwas_abap_sid +### sap_ha_pacemaker_cluster_nwas_sid - _Type:_ `string` @@ -1116,7 +1116,7 @@ Mandatory for NetWeaver AAS cluster setup.
Name of the SAPInstance resource for NetWeaver AAS.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address +### sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address - _Type:_ `string` @@ -1130,14 +1130,14 @@ Mandatory for NetWeaver ASCS/ERS cluster setup.
Name of the NetWeaver ASCS resource group.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name +### sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name - _Type:_ `string` - _Default:_ `rsc_vip__ASCS` Name of the SAPInstance resource for NetWeaver ASCS.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address +### sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address - _Type:_ `string` @@ -1151,7 +1151,7 @@ Mandatory for NetWeaver ASCS/ERS cluster setup.
Name of the NetWeaver ERS resource group.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name +### sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name - _Type:_ `string` - _Default:_ `rsc_vip__ERS` diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 457abf5fb..8e644c952 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -29,7 +29,7 @@ sap_ha_pacemaker_cluster_create_config_dest: "review_resource_config.yml" # This variable is currently only required for HANA nodes to define # - hana_site: # Other options are needed in the separate HSR setup role. -sap_ha_pacemaker_cluster_cluster_nodes: "{{ sap_hana_cluster_nodes | default([]) }}" +sap_ha_pacemaker_cluster_cluster_nodes: "{{ sap_hana_cluster_nodes | d([]) }}" # Resource defaults are defined differently by cluster type in different tasks, if not custom defined. sap_ha_pacemaker_cluster_resource_defaults: {} @@ -44,12 +44,11 @@ sap_ha_pacemaker_cluster_operation_defaults: {} # hana_scaleout (not yet) # nwas_abap_ascs_ers (available) # nwas_abap_pas_aas (not yet) -# nwas_java_scs_ers (maybe) +# nwas_java_scs_ers (available) # 'sap_ha_pacemaker_cluster_host_type' is converted from string to list type in # 'tasks/ascertain_sap_landscape.yml'. -# TODO: review with testers, updated arg specs now require it to be a list from the start -sap_ha_pacemaker_cluster_host_type: "{{ sap_host_type | default(['hana_scaleup_perf']) }}" +sap_ha_pacemaker_cluster_host_type: "{{ sap_host_type | d(['hana_scaleup_perf']) }}" ### VIP resource default patterns sap_ha_pacemaker_cluster_vip_client_interface: '' @@ -98,11 +97,8 @@ sap_ha_pacemaker_cluster_hacluster_user_password: "{{ ha_cluster_hacluster_passw # HANA ################################################################################ -sap_ha_pacemaker_cluster_hana_sid: "{{ sap_hana_sid | default('') }}" -# Keeping 'sap_ha_pacemaker_cluster_hana_instance_number' for the time being for backwards compatibility. -sap_ha_pacemaker_cluster_hana_instance_nr: >- - {{ sap_ha_pacemaker_cluster_hana_instance_number - | default(sap_hana_instance_number) | default('') }} +sap_ha_pacemaker_cluster_hana_sid: '' # Mandatory System ID in capital letters +sap_ha_pacemaker_cluster_hana_instance_nr: '' # Mandatory instance number in string format # Optional parameters to customize SAPHana resources # AUTOMATED_REGISTER @@ -113,65 +109,37 @@ sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout: 7200 sap_ha_pacemaker_cluster_hana_prefer_site_takeover: true # SAP HANA - Resource IDs (names) as convenience parameters. -sap_ha_pacemaker_cluster_hana_resource_name: >- - rsc_SAPHana_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -sap_ha_pacemaker_cluster_hana_resource_clone_name: >- - cln_SAPHana_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -# Master slave clone for SAPHanaSR on SLES <15.6 -sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: >- - msl_SAPHana_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -# SAPHanaController resource in SAPHanaSR-angi -sap_ha_pacemaker_cluster_hanacontroller_resource_name: >- - rsc_SAPHanaCon_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: >- - mst_SAPHanaCon_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} - -sap_ha_pacemaker_cluster_hana_topology_resource_name: >- - rsc_SAPHanaTop_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: >- - cln_SAPHanaTop_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} - -sap_ha_pacemaker_cluster_hana_filesystem_resource_name: >- - rsc_SAPHanaFil_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} -sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name: >- - cln_SAPHanaFil_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} +sap_ha_pacemaker_cluster_hana_resource_name: '' # Default: rsc_SAPHana__HDB +sap_ha_pacemaker_cluster_hana_resource_clone_name: '' # Default: cln_SAPHana__HDB +sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: '' # (SUSE Specific) Default: msl_SAPHana__HDB +sap_ha_pacemaker_cluster_hanacontroller_resource_name: '' # Default: rsc_SAPHanaCon__HDB +sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: '' # Default: cln_SAPHanaCon__HDB +sap_ha_pacemaker_cluster_hana_topology_resource_name: '' # Default: rsc_SAPHanaTop__HDB +sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: '' # Default: cln_SAPHanaTop__HDB +sap_ha_pacemaker_cluster_hana_filesystem_resource_name: '' # Default: rsc_SAPHanaFil__HDB +sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name: '' # Default: cln_SAPHanaFil__HDB # SAP HANA - Constraint names -sap_ha_pacemaker_cluster_hana_order_topology_hana_name: >- - ord_saphana_saphanatop_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }} - -sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name: >- - col_saphana_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary -sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name: >- - col_saphana_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly - -sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name: >- - ord_saphana_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary -sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name: >- - ord_saphana_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly +sap_ha_pacemaker_cluster_hana_order_topology_hana_name: '' # Default: ord_saphana_saphanatop__HDB +sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name: '' # Default: col_saphana_vip__HDB_primary +sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name: '' # Default: col_saphana_vip__HDB_readonly +sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name: '' # Default: ord_saphana_vip__HDB_primary +sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name: '' # Default: ord_saphana_vip__HDB_readonly # Multiple VIP parameters can be defined and will be combined. # See tasks/include_construct_vip_resources.yml # # Mandatory: primary VIP address definition in HANA scale-up clusters sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: '' -sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary -sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_primary +sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: '' # Default: rsc_vip__HDB_primary +sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: '' # Default: rsc_vip_health_check__HDB_primary sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: '' -sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly -sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_hana_sid }}_HDB{{ sap_ha_pacemaker_cluster_hana_instance_nr }}_readonly - -sap_ha_pacemaker_cluster_healthcheck_hana_primary_id: "{{ sap_ha_pacemaker_cluster_hana_sid + 'prim' }}" -sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id: "{{ sap_ha_pacemaker_cluster_hana_sid + 'ro' }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid + 'ascs' }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid + 'ers' }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_id: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid + 'pas' }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_id: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid + 'aas' }}" +sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: '' # Default: rsc_vip__HDB_readonly +sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: '' # Default: rsc_vip_health_check__HDB_readonly + +sap_ha_pacemaker_cluster_healthcheck_hana_primary_id: '' # Default: prim +sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id: '' # Default: ro # Optional dictionary with custom list of HANA Hooks for replication sap_ha_pacemaker_cluster_hana_hooks: [] @@ -181,8 +149,7 @@ sap_ha_pacemaker_cluster_hana_hook_tkover: false sap_ha_pacemaker_cluster_hana_hook_chksrv: false # SAP Hana global.ini path calculated from SID -sap_ha_pacemaker_cluster_hana_global_ini_path: "/usr/sap/{{ - sap_ha_pacemaker_cluster_hana_sid | upper }}/SYS/global/hdb/custom/config/global.ini" +sap_ha_pacemaker_cluster_hana_global_ini_path: '' # Default: /usr/sap//SYS/global/hdb/custom/config/global.ini # Disable auto-detection of SAPHanaSR-angi package and use Classic sap_ha_pacemaker_cluster_saphanasr_angi_detection: true @@ -193,30 +160,31 @@ sap_ha_pacemaker_cluster_saphanasr_angi_detection: true # Default will be ENSA2. To configure HA resources for ENSA1, # set this parameter to 'true'. -sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1: false +# TODO: Remove backwards compatibility to nwas_abap_ascs +sap_ha_pacemaker_cluster_nwas_cs_ensa1: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 | d(false) }}" # Enable ENSA2 simple mount configuration -sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount: true +sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: true # Enable/Disable sap_cluster_connector. # Ref.: https://access.redhat.com/solutions/3606101 sap_ha_pacemaker_cluster_enable_cluster_connector: true -# Inherit common synonym NetWeaver parameters when defined. -sap_ha_pacemaker_cluster_nwas_abap_sid: "{{ sap_swpm_sid | default('') }}" -sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr: "{{ sap_swpm_ascs_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr: "{{ sap_swpm_ers_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: "{{ sap_swpm_pas_instance_nr | default('') }}" -sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: "{{ sap_swpm_aas_instance_nr | default('') }}" -# Prepare in case JAVA SCS/ERS will be included later. -# sap_ha_pacemaker_cluster_nwas_java_scs_instance_nr: "{{ sap_swpm_java_scs_instance_nr | default('') }}" -# sap_ha_pacemaker_cluster_nwas_java_ers_instance_nr: "{{ sap_swpm_java_ers_instance_nr | default('') }}" +# SAP Netweaver instance details +sap_ha_pacemaker_cluster_nwas_sid: '' # Mandatory System ID in capital letters for Netweaver scenarios +sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: '' # Mandatory instance number for ASCS/ERS +sap_ha_pacemaker_cluster_nwas_scs_instance_nr: '' # Mandatory instance number for SCS/ERS +sap_ha_pacemaker_cluster_nwas_ers_instance_nr: '' # Mandatory instance number for ASCS/ERS and SCS/ERS +# TODO: Differentiate between ABAP and JAVA (Dxx vs Jxx) once supported +sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: '' # Mandatory instance number for PAS/AAS +sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: '' # Mandatory instance number for PAS/AAS + # Definitions for filesystems resources. Currently limited to NFS filesystems. -sap_ha_pacemaker_cluster_storage_definition: "{{ sap_storage_setup_definition | default([]) }}" +sap_ha_pacemaker_cluster_storage_definition: "{{ sap_storage_setup_definition | d([]) }}" sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: nfs sap_ha_pacemaker_cluster_storage_nfs_mount_options: 'defaults' -sap_ha_pacemaker_cluster_storage_nfs_server: "{{ sap_storage_nfs_server | default('') }}" +sap_ha_pacemaker_cluster_storage_nfs_server: "{{ sap_storage_nfs_server | d('') }}" # NFS filesystem resource requirement # Not adding to argument_specs because this should not be changed anyway. @@ -226,148 +194,122 @@ sap_ha_pacemaker_cluster_resource_filesystem_force_unmount: safe # Multiple VIP parameters can be defined and will be combined. # See tasks/include_construct_vip_resources.yml -sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address: '' -sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} - -sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address: '' -sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} +sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address: '' +sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: '' # Default rsc_vip__ASCS +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: '' # Default: rsc_vip_health_check__ASCS + +sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address: '' +sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: '' # Default: rsc_vip__SCS +sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: '' # Default: rsc_vip_health_check__SCS + +sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address: '' +sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: '' # Default: rsc_vip__ERS +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: '' # Default: rsc_vip_health_check__ERS sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: '' -sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_PAS{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_PAS{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }} +sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: '' # Default: rsc_vip__PAS +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: '' # Default: rsc_vip_health_check__PAS sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: '' -sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: >- - rsc_vip_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_AAS{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: >- - rsc_vip_health_check_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_AAS{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }} +sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: '' # Default: rsc_vip__AAS +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: '' # Default: rsc_vip_health_check__AAS +# sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: '' +# sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: '' +# sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: '' +# sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: '' +# sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: '' # SAP NetWeaver common - Resource IDs (names) as convenience parameters # for the following filesystems: # - /sapmnt # - /usr/sap/trans # - /usr/sap/<>/SYS -sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name: >- - rsc_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_sapmnt -sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name: >- - cln_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_sapmnt +sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name: '' # Default: rsc_fs__sapmnt +sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name: '' # Default: cln_fs__sapmnt -sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name: >- - rsc_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_trans -sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name: >- - cln_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_trans +sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name: '' # Default: rsc_fs__trans +sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name: '' # Default: cln_fs__trans -sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name: >- - rsc_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_sys -sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name: >- - cln_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_sys +sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name: '' # Default: rsc_fs__sys +sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name: '' # Default: cln_fs__sys # The shared filesystems are not required to be configured in the cluster. # By default it is assumed that they are mounted by the system and available on all cluster nodes. # Set this parameter to "true" to configure the 3 shared filesystems as part of the cluster. sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed: false + ################################################################################ -# ASCS resource defaults +# ASCS and SCS shared resource defaults ################################################################################ -# Name of the instance profile - mandatory to be user-defined -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name: '' -# Full path with instance profile name - mandatory to be user-defined -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string: '' +# TODO: Remove backwards compatibility to nwas_abap_ascs +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: false +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: 5000 +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold | d(1) }}" +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout | d(60) }}" +sap_ha_pacemaker_cluster_nwas_cs_group_stickiness: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness | d(3000) }}" -# SAP NetWeaver ABAP ASCS/ERS - Resource IDs (names) as convenience parameters. -# - /usr/sap/<>/ASCS<> -# - /usr/sap/<>/ERS<> -sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name: >- - rsc_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name: >- - rsc_SAPInstance_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name: >- - rsc_SAPStartSrv_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} +################################################################################ +# ASCS resource defaults +################################################################################ -sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name: >- - grp_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} +sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: '' # Mandatory name of instance profile +sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string: '' # Full path of instance profile -sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name: >- - col_ascs_separate_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }} +sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name: '' # Default: rsc_fs__ASCS +sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name: '' # Default: rsc_SAPInstance__ASCS +sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name: '' # Default: rsc_SAPStartSrv__ASCS -sap_ha_pacemaker_cluster_nwas_order_ascs_first_name: >- - ord_ascs_first_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }} +sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name: '' # Default: grp__ASCS -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool: false -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness: 5000 -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold: 1 -sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout: 60 +sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name: '' # Default: col_ascs_separate_ +sap_ha_pacemaker_cluster_nwas_order_ascs_first_name: '' # Default: ord_ascs_first_ -# Stickiness of the ASCS group -sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness: 3000 ################################################################################ -# ERS resource defaults +# SCS resource defaults ################################################################################ -# Name of the instance profile - mandatory to be user-defined -sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name: '' +sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name: '' # Mandatory name of instance profile +sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string: '' # Full path of instance profile -# Full path with instance profile name - mandatory to be user-defined -sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string: '' +sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name: '' # Default: rsc_fs__SCS +sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name: '' # Default: rsc_SAPInstance__SCS +sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name: '' # Default: rsc_SAPStartSrv__SCS -# SAP NetWeaver ABAP ERS - Resource IDs (names) as convenience parameters. -sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name: >- - rsc_fs_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name: >- - rsc_SAPInstance_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name: >- - rsc_SAPStartSrv_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool: false +sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name: '' # Default: grp__SCS -sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name: >- - grp_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} +sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name: '' # Default: col_ascs_separate_ +sap_ha_pacemaker_cluster_nwas_order_scs_first_name: '' # Default: ord_ascs_first_ ################################################################################ -# PAS/AAS resource defaults +# ERS resource defaults ################################################################################ -# SAP NetWeaver ABAP PAS/AAS - Resource IDs (names) as convenience parameters. -# - /usr/sap/<>/D<> -# sap_ha_pacemaker_cluster_nwas_abap_pas_filesystem_resource_name: > -# "Filesystem_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_abap_pas_sapinstance_resource_name: > -# "SAPInstance_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_abap_aas_filesystem_resource_name: > -# "Filesystem_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_abap_aas_sapinstance_resource_name: > -# "SAPInstance_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" + +sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: '' # Mandatory name of instance profile +sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string: '' # Full path of instance profile + +sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name: '' # Default: rsc_fs__ERS +sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name: '' # Default: rsc_SAPInstance__ERS +sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name: '' # Default: rsc_SAPStartSrv__ERS +sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name: '' # Default: grp__ERS + +sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool: false ################################################################################ -# JAVA SCS/ERS resource defaults +# PAS/AAS resource defaults ################################################################################ -# SAP NetWeaver JAVA SCS/ERS - Resource IDs (names) as convenience parameters. -# - /usr/sap/<>/SCS<> -# - /usr/sap/<>/ERS<> -# sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_resource_name: > -# "Filesytem_NWAS_JAVA_SCS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_java_scs_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_name: > -# "SAPInstance_NWAS_JAVA_SCS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_java_scs_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_clone_name: > -# "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}-clone" -# sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_resource_name: > -# "Filesytem_NWAS_JAVA_ERS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_java_ers_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_name: > -# "SAPInstance_NWAS_JAVA_ERS_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ sap_ha_pacemaker_cluster_nwas_java_ers_instance_nr }}" -# sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_clone_name: > -# "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}-clone" +# sap_ha_pacemaker_cluster_nwas_abap_pas_filesystem_resource_name: '' +# sap_ha_pacemaker_cluster_nwas_abap_pas_sapinstance_resource_name: '' +# sap_ha_pacemaker_cluster_nwas_abap_aas_filesystem_resource_name: '' +# sap_ha_pacemaker_cluster_nwas_abap_aas_sapinstance_resource_name: '' ################################################################################ diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 365675987..04f32397e 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -135,7 +135,7 @@ argument_specs: # - hana_scaleout - nwas_abap_ascs_ers # - nwas_abap_pas_aas -# - nwas_java_scs_ers + - nwas_java_scs_ers default: hana_scaleup_perf description: - The SAP landscape to for which the cluster is to be configured. @@ -368,16 +368,16 @@ argument_specs: sap_ha_pacemaker_cluster_hana_sid: description: - - The SAP HANA SID of the instance that will be configured in the cluster. + - The SAP HANA System ID (SID) of the instance that will be configured in the cluster. - The SID must follow SAP specifications - see SAP Note 1979280. - Inherits the value of `sap_hana_sid`, when defined. - - Mandatory for SAP HANA cluster setups. + - Mandatory for SAP HANA cluster scenarios. sap_ha_pacemaker_cluster_hana_instance_nr: description: - The instance number of the SAP HANA database which this role will configure in the cluster. - Inherits the value of `sap_hana_instance_number`, when defined. - - Mandatory for SAP HANA cluster setups. + - Mandatory for SAP HANA cluster scenarios. sap_ha_pacemaker_cluster_hana_automated_register: type: bool @@ -467,18 +467,27 @@ argument_specs: sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: default: "rsc_vip__HDB_primary" description: - - Customize the name of the resource managing the Virtual IP of the primary HANA instance. + - Name of the Virtual IP resource for primary HANA instance. + + sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: + default: "rsc_vip_health_check__HDB_primary" + description: + - Name of the Virtual IP Health Check resource for primary HANA instance. sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: description: - The virtual IP for read-only access to the secondary HANA instance. - Optional parameter in HANA clusters. - sap_ha_pacemaker_cluster_vip_secondary_resource_name: + sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: default: "rsc_vip__HDB_readonly" description: - - Customize the name of the resource managing the Virtual IP of read-only access to the - secondary HANA instance. + - Name of the Virtual IP resource for read-only HANA instance. + + sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: + default: "rsc_vip_health_check__HDB_readonly" + description: + - Name of the Virtual IP Health Check resource for read-only HANA instance. sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name: default: "ord_saphana_vip__HDB_primary" @@ -558,18 +567,18 @@ argument_specs: # NetWeaver specific parameters ########################################################################## - sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount: + sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: type: bool default: true description: - - Enables preferred method for ASCS ERS ENSA2 clusters - Simple Mount + - Enables preferred method for Central Services (ASCS or SCS) ENSA2 clusters - Simple Mount. - Set this parameter to 'true' to configure ENSA2 Simple Mount. - sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1: + sap_ha_pacemaker_cluster_nwas_cs_ensa1: type: bool default: false description: - - The standard NetWeaver ASCS/ERS cluster will be set up as ENSA2. + - The standard NetWeaver Central Services cluster will be set up as ENSA2. - Set this parameter to 'true' to configure it as ENSA1. sap_ha_pacemaker_cluster_enable_cluster_connector: @@ -580,22 +589,26 @@ argument_specs: known as `sap_cluster_connector`. - Set this parameter to 'false' if the SAP HA interface should not be installed and configured. - sap_ha_pacemaker_cluster_nwas_abap_sid: + sap_ha_pacemaker_cluster_nwas_sid: description: - - SID of the NetWeaver instances. - - Mandatory for NetWeaver cluster configuration. - - Uses `sap_swpm_sid` if defined. - - Mandatory for NetWeaver cluster setups. + - System ID (SID) of the NetWeaver instances in Capital letters. + - Defaults to `sap_swpm_sid` if defined. + - Mandatory for NetWeaver cluster scenarios. - sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr: + sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: description: - - Instance number of the NetWeaver ABAP ASCS instance. + - Instance number of the NetWeaver ABAP Central Services (ASCS) instance. - Mandatory for NetWeaver ASCS/ERS cluster configuration. - sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr: + sap_ha_pacemaker_cluster_nwas_scs_instance_nr: description: - - Instance number of the NetWeaver ABAP ERS instance. - - Mandatory for NetWeaver ASCS/ERS cluster configuration. + - Instance number of the NetWeaver Central Services (SCS) instance. + - Mandatory for NetWeaver SCS/ERS cluster configuration. + + sap_ha_pacemaker_cluster_nwas_ers_instance_nr: + description: + - Instance number of the NetWeaver Enqueue Replication Service (ERS) instance. + - Mandatory for NetWeaver ASCS/ERS and SCS/ERS cluster configuration. sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: description: @@ -612,7 +625,7 @@ argument_specs: description: - List of filesystem definitions used for filesystem cluster resources. - Options relevant, see example. - - Mandatory for SAP NetWeaver HA cluster configurations. + - Mandatory for SAP NetWeaver cluster without Simple Mount. - Reuse `sap_storage_setup_definition` if defined. - Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'. @@ -654,25 +667,50 @@ argument_specs: description: - Default address of the NFS server, if not defined individually by filesystem. - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address: + sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address: description: - - Virtual IP of the NetWeaver ASCS instance. + - Virtual IP of the NetWeaver ABAP Central Services (ASCS) instance. - Mandatory for NetWeaver ASCS/ERS cluster setup. - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name: + sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: default: rsc_vip__ASCS description: - - Name of the SAPInstance resource for NetWeaver ASCS. + - Name of the Virtual IP resource for NetWeaver ABAP Central Services (ASCS). - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address: + sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: + default: rsc_vip_health_check__ASCS description: - - Virtual IP of the NetWeaver ERS instance. - - Mandatory for NetWeaver ASCS/ERS cluster setup. + - Name of the Virtual IP Health Check resource for NetWeaver ABAP Central Services (ASCS). + + sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address: + description: + - Virtual IP of the NetWeaver Central Services (SCS) instance. + - Mandatory for NetWeaver SCS/ERS cluster setup. + + sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: + default: rsc_vip__SCS + description: + - Name of the Virtual IP resource for NetWeaver Central Services (SCS). - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name: + sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: + default: rsc_vip_health_check__SCS + description: + - Name of the Virtual IP Health Check resource for NetWeaver Central Services (SCS). + + sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address: + description: + - Virtual IP of the NetWeaver Enqueue Replication Service (ERS) instance. + - Mandatory for NetWeaver ASCS/ERS and SCS/ERS cluster setup. + + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: default: rsc_vip__ERS description: - - Name of the SAPInstance resource for NetWeaver ERS. + - Name of the Virtual IP resource for NetWeaver Enqueue Replication Service (ERS). + + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + default: rsc_vip_health_check__ERS + description: + - Name of the Virtual IP Health Check resource for NetWeaver Enqueue Replication Service (ERS). sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: description: @@ -682,7 +720,12 @@ argument_specs: sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: default: rsc_vip__PAS description: - - Name of the SAPInstance resource for NetWeaver PAS. + - Name of the Virtual IP resource for NetWeaver PAS. + + sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: + default: rsc_vip_health_check__PAS + description: + - Name of the Virtual IP Health Check resource for NetWeaver PAS. sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: description: @@ -692,7 +735,12 @@ argument_specs: sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: default: rsc_vip__AAS description: - - Name of the SAPInstance resource for NetWeaver AAS. + - Name of the Virtual IP resource for NetWeaver AAS. + + sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: + default: rsc_vip_health_check__AAS + description: + - Name of the Virtual IP Health Check resource for NetWeaver AAS. sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name: default: rsc_fs__sapmnt @@ -744,36 +792,36 @@ argument_specs: `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources. ########################################################################## - # NetWeaver ASCS specific parameters + # NetWeaver ABAP Central Services (ASCS) specific parameters ########################################################################## - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name: + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: description: - The name of the ASCS instance, typically the profile name. - Mandatory for the NetWeaver ASCS/ERS cluster setup - - Recommended format _ASCS_. + - Recommended format _ASCS_ - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string: + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string: description: - The full path and name of the ASCS instance profile. - Mandatory for the NetWeaver ASCS/ERS cluster setup. - sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name: + sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name: default: rsc_fs__ASCS description: - Name of the filesystem resource for the ASCS instance. - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name: + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name: default: rsc_SAPInstance__ASCS description: - Name of the ASCS instance resource. - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name: + sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name: default: rsc_SAPStartSrv__ASCS description: - Name of the ASCS SAPStartSrv resource for simple mount. - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name: + sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name: default: grp__ASCS description: - Name of the NetWeaver ASCS resource group. @@ -788,75 +836,124 @@ argument_specs: description: - Customize the cluster constraint name for ASCS starting before ERS order. - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool: + ########################################################################## + # NetWeaver Central Services (SCS) specific parameters + ########################################################################## + + sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name: + description: + - The name of the SCS instance, typically the profile name. + - Mandatory for the NetWeaver SCS/ERS cluster setup + - Recommended format _SCS_ + + sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string: + description: + - The full path and name of the SCS instance profile. + - Mandatory for the NetWeaver SCS/ERS cluster setup. + + sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name: + default: rsc_fs__SCS + description: + - Name of the filesystem resource for the SCS instance. + + sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name: + default: rsc_SAPInstance__SCS + description: + - Name of the SCS instance resource. + + sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name: + default: rsc_SAPStartSrv__SCS + description: + - Name of the SCS SAPStartSrv resource for simple mount. + + sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name: + default: grp__SCS + description: + - Name of the NetWeaver SCS resource group. + + sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name: + default: "col_ascs_separate_" + description: + - Customize the cluster constraint name for SCS and ERS separation colocation. + + sap_ha_pacemaker_cluster_nwas_order_scs_first_name: + default: "ord_ascs_first_" + description: + - Customize the cluster constraint name for SCS starting before ERS order. + + ########################################################################## + # NetWeaver Central Services (ASCS and SCS) shared parameters + ########################################################################## + + sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: type: bool default: false description: - - NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER". + - NetWeaver Central Services (ASCS and SCS) instance resource option "AUTOMATIC_RECOVER". - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness: + sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: default: 5000 description: - - NetWeaver ASCS instance resource stickiness attribute. + - NetWeaver Central Services (ASCS and SCS) instance resource stickiness attribute. - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold: + sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold: default: 1 description: - - NetWeaver ASCS instance migration-threshold setting attribute. - - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). + - NetWeaver Central Services (ASCS and SCS) instance migration-threshold setting attribute. + - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2. - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout: + sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout: default: 60 description: - - NetWeaver ASCS instance failure-timeout attribute. - - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1`). + - NetWeaver Central Services (ASCS and SCS) instance failure-timeout attribute. + - Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2. - sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness: + sap_ha_pacemaker_cluster_nwas_cs_group_stickiness: default: 3000 description: - - NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node - it was started on. + - NetWeaver Central Services (ASCS and SCS) resource group stickiness. + - Defines how sticky is Central Services group to the node it was started on. ########################################################################## # NetWeaver ERS specific parameters ########################################################################## - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name: + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: description: - The name of the ERS instance, typically the profile name. - - Mandatory for the NetWeaver ASCS/ERS cluster setup. + - Mandatory for the NetWeaver ASCS/ERS and SCS/ERS clusters. - Recommended format _ERS_. - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string: + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string: description: - The full path and name of the ERS instance profile. - - Mandatory for the NetWeaver ASCS/ERS cluster. + - Mandatory for the NetWeaver ASCS/ERS and SCS/ERS clusters. - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool: + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool: type: bool default: false description: - NetWeaver ERS instance resource option "AUTOMATIC_RECOVER". - sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name: + sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name: default: rsc_fs__ERS description: - Name of the filesystem resource for the ERS instance. - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name: + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name: default: rsc_SAPInstance__ERS description: - Name of the ERS instance resource. - sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name: + sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name: default: rsc_SAPStartSrv__ERS description: - Name of the ERS SAPstartSrv resource for simple mount. - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name: + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name: default: grp__ERS description: - Name of the NetWeaver ERS resource group. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml index 06d95406a..695e937d1 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml @@ -73,7 +73,7 @@ - name: "SAP HA Install Pacemaker - Remove operations for SAPStartSrv" ansible.builtin.command: cmd: cibadmin -d --force --xpath "//primitive[@type='SAPStartSrv']//operations" - when: sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + when: sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount changed_when: true # SAPInstance - Remove default operations: promote, demote, start, stop diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml index 9993ebf9f..478fe11ef 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml @@ -6,7 +6,7 @@ - name: "SAP HA Pacemaker - (ASCS profile) Prevent automatic restart of enqueue server" ansible.builtin.replace: - path: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string }}" + path: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" backup: true regexp: 'Restart_Program_01' replace: 'Start_Program_01' @@ -17,7 +17,7 @@ - name: "SAP HA Pacemaker - (ERS profile) Prevent automatic restart" ansible.builtin.replace: - path: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string }}" + path: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" backup: true regexp: 'Restart_Program_00' replace: 'Start_Program_00' @@ -36,20 +36,20 @@ regexp: '^([^#\n].+{{ sapserv_item }}.+)$' replace: '# \1' loop: - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name }}" - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" loop_control: loop_var: sapserv_item - name: "SAP HA Pacemaker - (systemd) Check for ASCS/ERS services" ansible.builtin.stat: - path: "/etc/systemd/system/SAP{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ systemd_item }}.service" + path: "/etc/systemd/system/SAP{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" loop: - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" loop_control: loop_var: systemd_item - label: "SAP{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}_{{ systemd_item }}.service" + label: "SAP{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" register: __sap_ha_pacemaker_cluster_register_instance_service - name: "SAP HA Pacemaker - (systemd) Save found ASCS/ERS services" @@ -117,10 +117,10 @@ - sap_ha_pacemaker_cluster_enable_cluster_connector block: - - name: "SAP HA Pacemaker - (SAP HA Interface) Add {{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm + - name: "SAP HA Pacemaker - (SAP HA Interface) Add {{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm user to 'haclient' group" # noqa name[template] ansible.builtin.user: - name: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + name: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" groups: haclient append: true state: present @@ -131,7 +131,7 @@ backup: true path: "{{ nwas_profile_item.0 }}" line: "{{ nwas_profile_item.1 }}" - loop: "{{ __sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_profile_paths + loop: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_ers_profile_paths | product(__sap_ha_pacemaker_cluster_connector_config_lines) }}" loop_control: @@ -145,19 +145,19 @@ # Sleep added to resolve issue with WaitforStarted finishing before resources are available. - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ASCS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ascs ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ers ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false @@ -167,20 +167,20 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_restart_ascs ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function RestartService + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function RestartService changed_when: __sap_ha_pacemaker_cluster_register_restart_ascs.rc == 0 - name: "SAP HA Pacemaker - (SAP HA Interface) Restart the ERS service" when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_restart_ers ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function RestartService + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function RestartService changed_when: __sap_ha_pacemaker_cluster_register_restart_ers.rc == 0 @@ -188,21 +188,21 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config ansible.builtin.shell: | sleep 10 - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig changed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for ERS" when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig changed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Display HAGetFailoverConfig results" @@ -218,10 +218,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_check_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig changed_when: false failed_when: false @@ -245,12 +245,12 @@ or (__sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout is defined and 'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout)" vars: - __rsc_ascs: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" - __rsc_ers: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}" + __rsc_ascs: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + __rsc_ers: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" block: - name: "SAP HA Pacemaker - (SAP HA Interface) Restart ASCS ERS resources" ansible.builtin.shell: | @@ -266,19 +266,19 @@ - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ASCS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ascs_restart ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ers_restart ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false @@ -293,11 +293,11 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_check_config ansible.builtin.shell: | sleep 30 - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig changed_when: false failed_when: - "'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout" @@ -306,10 +306,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_check_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HACheckConfig changed_when: false failed_when: - "'ERROR' in __sap_ha_pacemaker_cluster_register_ers_ha_check_config.stdout" @@ -319,10 +319,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig changed_when: false # failed_when: # - __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config.stdout is defined @@ -332,10 +332,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | lower }}adm" + become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig changed_when: false # failed_when: # - __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout is defined diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml index e34dd1584..33dbe95d3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_common.yml @@ -88,7 +88,7 @@ - name: "SAP HA Prepare Pacemaker - Prepare corosync totem settings" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_corosync_totem: - options: "{{ __sap_ha_pacemaker_cluster_corosync_totem.options | default([]) + __totem_settings }}" + options: "{{ __sap_ha_pacemaker_cluster_corosync_totem.options | d([]) + __totem_settings }}" vars: # Identify if provided sap_ha_pacemaker_cluster_corosync_totem is defined __user_totem_is_present: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml index 7c264ec45..059e7f2de 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml @@ -1,79 +1,57 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Variables containing variables must be constructed with values -# to be fed into the included ha_cluster role - -# TODO: add conditionals to verify that the same resource agent is not already -# defined in user input variables. Conflicting user input should take precedence. - -# Several parameters are pre-defined from potentially inherited ha_cluster LSR definitions. -# They are necessary to be used for combining all cluster setup definitions. -# -# See tasks/ascertain_ha_cluster_in_inventory.yml: -# -# __sap_ha_pacemaker_cluster_cluster_properties: "{{ ha_cluster_cluster_properties }}" -# __sap_ha_pacemaker_cluster_constraints_colocation: "{{ ha_cluster_constraints_colocation }}" -# __sap_ha_pacemaker_cluster_constraints_location: "{{ ha_cluster_constraints_location }}" -# __sap_ha_pacemaker_cluster_constraints_order: "{{ ha_cluster_constraints_order }}" -# __sap_ha_pacemaker_cluster_fence_agent_packages: "{{ ha_cluster_fence_agent_packages }}" -# __sap_ha_pacemaker_cluster_repos: "{{ ha_cluster_repos }}" -# __sap_ha_pacemaker_cluster_resource_clones: "{{ ha_cluster_resource_clones }}" -# __sap_ha_pacemaker_cluster_resource_groups: "{{ ha_cluster_resource_groups }}" -# __sap_ha_pacemaker_cluster_resource_primitives: "{{ ha_cluster_resource_primitives }}" - - ### Different SAPInstance resource attributes for ENSA1 and ENSA2 - name: "SAP HA Prepare Pacemaker - Define default ASCS/ERS instance attributes (ENSA2)" - when: not sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + when: not sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: "SAP HA Prepare Pacemaker - Define ASCS/ERS instance attributes (ENSA1)" - when: sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + when: sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" - name: migration-threshold - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold }}" - name: failure-timeout - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true ### Resources -# ASCS/ERS instance filesystems -- name: "SAP HA Prepare Pacemaker - Add filesystem resources for ASCS/ERS to resource definition" +# ASCS/ERS Filesystems +- name: "SAP HA Prepare Pacemaker - Add filesystem resources to resource definition (ASCS/ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_filesystem] }}" vars: __resource_filesystem: id: |- {%- if '/ASCS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name %} + {% set idname = sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name %} {%- elif '/ERS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name %} + {% set idname = sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} {%- endif -%} {{ idname }} agent: "ocf:heartbeat:Filesystem" @@ -154,32 +132,30 @@ {%- endfor %} __mountpoint: "{{ fsres_item }}" - loop: "{{ __sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_filesystems }}" + loop: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_ers_filesystems }}" loop_control: loop_var: fsres_item label: "{{ fsres_item }}" when: - __resource_filesystem.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) -# End of filesystem resource task - # ASCS instance resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Central Service (ABAP ASCS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for ABAP SAP Central Service (ASCS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" meta_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs }}" operations: @@ -208,12 +184,12 @@ # ERS instance resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ABAP ERS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs }}" @@ -252,14 +228,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ascs_group] }}" vars: __ascs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name %} + sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, + sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name, + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -269,7 +245,7 @@ meta_attrs: - attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_group_stickiness }}" when: - __ascs_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) @@ -284,14 +260,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name %} + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -318,10 +294,10 @@ __constraint_colo_ers: id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -336,10 +312,10 @@ __constraint_order_ascs_ers: id: "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" @@ -355,13 +331,13 @@ vars: __constraint_location_ascs_ers: resource: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" - rule: "runs_ers_{{ sap_ha_pacemaker_cluster_nwas_abap_sid }} eq 1" + id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + rule: "runs_ers_{{ sap_ha_pacemaker_cluster_nwas_sid }} eq 1" options: - name: score value: 2000 when: - - sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + - sap_ha_pacemaker_cluster_nwas_cs_ensa1 # When /sapmnt is managed by the cluster, @@ -375,7 +351,7 @@ id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed @@ -388,6 +364,6 @@ id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml index a3eb6d998..a86dd0526 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml @@ -1,67 +1,61 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Variables containing variables must be constructed with values -# to be fed into the included ha_cluster role - -# TODO: add conditionals to verify that the same resource agent is not already -# defined in user input variables. Conflicting user input should take precedence. -# # ASCS ERS simple mount cluster is ENSA2. ### Resources # ASCS SAPStartSrv resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for Central Service (ABAP ASCS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for ABAP SAP Central Service (ASCS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) # ERS SAPStartSrv resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for Central Service (ABAP ERS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for Enqueue Replication Service (ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) # ASCS instance resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Central Service (ABAP ASCS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for ABAP SAP Central Service (ASCS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" - name: MINIMAL_PROBE value: true meta_attrs: - attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" operations: # TODO: Add values for start and stop when they are published. - action: monitor @@ -77,21 +71,21 @@ # ERS instance resource definition -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ABAP ERS)" +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: MINIMAL_PROBE @@ -120,14 +114,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ascs_group] }}" vars: __ascs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name %} + sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, + sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name, + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -137,7 +131,7 @@ meta_attrs: - attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_group_stickiness }}" when: - __ascs_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) @@ -151,14 +145,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name %} + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -185,10 +179,10 @@ __constraint_colo_ers: id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -203,10 +197,10 @@ __constraint_order_ascs_ers: id: "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name }}" + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index f26b6fb14..5a42064e5 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + sap_ha_pacemaker_cluster_nwas_abap_sid + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} {% set idname = sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -120,18 +120,18 @@ value: 40 # Format input variables to make above construction code more readable. - __fstype: "{{ commonfs_item.nfs_filesystem_type | default(sap_ha_pacemaker_cluster_storage_nfs_filesytem_type) }}" - __mount_opts: "{{ commonfs_item.nfs_mount_options | default(sap_ha_pacemaker_cluster_storage_nfs_mount_options) }}" - __nfs_server: "{{ commonfs_item.nfs_server | default(sap_ha_pacemaker_cluster_storage_nfs_server) | regex_replace('/$', '') }}" + __fstype: "{{ commonfs_item.nfs_filesystem_type | d(sap_ha_pacemaker_cluster_storage_nfs_filesytem_type) }}" + __mount_opts: "{{ commonfs_item.nfs_mount_options | d(sap_ha_pacemaker_cluster_storage_nfs_mount_options) }}" + __nfs_server: "{{ commonfs_item.nfs_server | d(sap_ha_pacemaker_cluster_storage_nfs_server) | regex_replace('/$', '') }}" __nfs_path: |- {%- if '/usr/sap' in commonfs_item.nfs_path and '/usr/sap/trans' not in commonfs_item.nfs_path -%} - {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}/SYS + {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }} {%- endif %} __mountpoint: |- {%- if commonfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}/SYS + {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfs_item.mountpoint | regex_replace('/$', '') }} {%- endif %} @@ -162,7 +162,7 @@ {{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + sap_ha_pacemaker_cluster_nwas_abap_sid + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} {{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + sap_ha_pacemaker_cluster_nwas_abap_sid + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} {{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: @@ -180,7 +180,7 @@ __mountpoint: |- {%- if commonfsclone_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}/SYS + {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }} {%- endif %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml index f5fd0b540..ce1b35ce9 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml @@ -1,76 +1,73 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Variables containing variables must be constructed with values -# to be fed into the included ha_cluster role +### Different SAPInstance resource attributes for ENSA1 and ENSA2 +- name: "SAP HA Prepare Pacemaker - Define default SCS/ERS instance attributes (ENSA2)" + when: not sap_ha_pacemaker_cluster_nwas_cs_ensa1 + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs: + - name: resource-stickiness + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" -# - put here all scale-up and scale-out common resources -# - certain differences like ra agent names are provided through -# type specific variables + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + - name: START_PROFILE + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + - name: AUTOMATIC_RECOVER + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + - name: IS_ERS + value: true -# TODO: add conditionals to verify that the same resource agent is not already -# defined in user input variables. Conflicting user input should take precedence. +- name: "SAP HA Prepare Pacemaker - Define SCS/ERS instance attributes (ENSA1)" + when: sap_ha_pacemaker_cluster_nwas_cs_ensa1 + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs: + - name: resource-stickiness + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + - name: migration-threshold + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold }}" + - name: failure-timeout + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout }}" + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + - name: START_PROFILE + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + - name: AUTOMATIC_RECOVER + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + - name: IS_ERS + value: true -- name: "SAP HA Prepare Pacemaker - Add resource: Filesystem /usr/sap/<>/SCS<>" - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_filesystem] }}" - vars: - __resource_filesystem: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_resource_name }}" - agent: "ocf:heartbeat:Filesystem" - instance_attrs: - - attrs: - - name: device - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_host_mount_path }}" - - name: directory - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_local_mount_path }}" - - name: fstype - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_fstype }}" - - name: options - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_options_string }}" - - name: force_unmount - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_force_unmount }}" - operations: - - action: start - attrs: - - name: interval - value: 0 - - name: timeout - value: 60 - - action: stop - attrs: - - name: interval - value: 0 - - name: timeout - value: 120 - - action: monitor - attrs: - - name: interval - value: 200 - - name: timeout - value: 40 - when: - - __resource_filesystem.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) -- name: "SAP HA Prepare Pacemaker - Add resource: Filesystem /usr/sap/<>/ERS<>" +### Resources +# SCS/ERS Filesystems + +- name: "SAP HA Prepare Pacemaker - Add filesystem resources to resource definition (SCS/ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_filesystem] }}" vars: __resource_filesystem: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_resource_name }}" + id: |- + {%- if '/SCS' in __mountpoint -%} + {% set idname = sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name %} + {%- elif '/ERS' in __mountpoint -%} + {% set idname = sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} + {%- endif -%} + {{ idname }} agent: "ocf:heartbeat:Filesystem" instance_attrs: - attrs: - name: device - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_host_mount_path }}" + value: "{{ __nfs_server }}/{{ __nfs_path }}/{{ __mountpoint }}" - name: directory - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_local_mount_path }}" + value: "/usr/sap/{{ __mountpoint }}" - name: fstype - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_fstype }}" + value: "{{ __fstype }}" - name: options - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_options_string }}" + value: "{{ __mount_opts }}" - name: force_unmount - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_force_unmount }}" + value: "{{ sap_ha_pacemaker_cluster_resource_filesystem_force_unmount }}" operations: - action: start attrs: @@ -90,33 +87,78 @@ value: 200 - name: timeout value: 40 + + # Format input variables to make above construction code more readable. + # Method: + # - parse sap_ha_pacemaker_cluster_storage_definition + # - check if a mounpoint is defined (filters out swap) + # - if the needed parameter is defined, take it + # - otherwise, take the value from a default parameter + + __fstype: |- + {% for def in sap_ha_pacemaker_cluster_storage_definition -%} + {% if def.mountpoint is defined and '/usr/sap' == def.mountpoint | regex_replace('/$', '') -%} + {% if def.nfs_filesystem_type is defined -%} + {{ def.nfs_filesystem_type }} + {%- else -%} + {{ sap_ha_pacemaker_cluster_storage_nfs_filesytem_type }} + {%- endif %} + {%- endif %} + {%- endfor %} + __mount_opts: |- + {% for def in sap_ha_pacemaker_cluster_storage_definition -%} + {% if def.mountpoint is defined and '/usr/sap' == def.mountpoint | regex_replace('/$', '') -%} + {% if def.nfs_mount_options is defined -%} + {{ def.nfs_mount_options }} + {%- else -%} + {{ sap_ha_pacemaker_cluster_storage_nfs_mount_options }} + {%- endif %} + {%- endif %} + {%- endfor %} + __nfs_path: |- + {% for def in sap_ha_pacemaker_cluster_storage_definition -%} + {% if def.mountpoint is defined and '/usr/sap' == def.mountpoint | regex_replace('/$', '') -%} + {{ def.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }} + {%- endif %} + {%- endfor %} + __nfs_server: |- + {% for def in sap_ha_pacemaker_cluster_storage_definition -%} + {% if def.mountpoint is defined and '/usr/sap' == def.mountpoint | regex_replace('/$', '') -%} + {% if def.nfs_server is defined -%} + {{ def.nfs_server | regex_replace('/$', '') }} + {%- else -%} + {{ sap_ha_pacemaker_cluster_storage_nfs_server | regex_replace('/$', '') }} + {%- endif %} + {%- endif %} + {%- endfor %} + __mountpoint: "{{ fsres_item }}" + + loop: "{{ __sap_ha_pacemaker_cluster_nwas_scs_ers_filesystems }}" + loop_control: + loop_var: fsres_item + label: "{{ fsres_item }}" when: - __resource_filesystem.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Central Service (JAVA SCS)" +# SCS instance resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for SAP Central Service (SCS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_instance_name }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_start_profile_string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_automatic_recover_bool | string }}" + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" meta_attrs: - - attrs: - - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_stickiness }}" - - name: migration-threshold - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_migration_threshold }}" - - name: failure-timeout - value: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_failure_timeout }}" + - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs }}" operations: - action: start attrs: @@ -141,29 +183,17 @@ when: - __resource_sapinstance.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) -- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (JAVA ERS)" + +# ERS instance resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ERS)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_name }}" + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - - attrs: - - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_instance_name }}" - - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_start_profile_string }}" - - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_automatic_recover_bool | string }}" - meta_attrs: - - attrs: - - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_stickiness }}" - - name: migration-threshold - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_migration_threshold }}" - - name: failure-timeout - value: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_failure_timeout }}" + - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs }}" operations: - action: start attrs: @@ -189,95 +219,153 @@ - __resource_sapinstance_ers.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) -- name: "SAP HA Prepare Pacemaker - Add resource clone: Filesystem /usr/sap/<>/SCS<>" - ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_filesystem] }}" - vars: - __clone_filesystem: - resource_id: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_filesystem_resource_name }}" - promotable: "no" - meta_attrs: - - attrs: - - name: clone-max - value: 2 - - name: clone-node-max - value: 1 - - name: interleave - value: "true" - when: - - __clone_filesystem.resource_id not in (__sap_ha_pacemaker_cluster_resource_clones | map(attribute='resource_id')) +### Groups +# SCS group consists of resources in this order: +# - SCS filesystem +# - SCS instance +# - SCS VIP -- name: "SAP HA Prepare Pacemaker - Add resource clone: Filesystem /usr/sap/<>/ERS<>" +- name: "SAP HA Prepare Pacemaker - Add resource group for SCS resources" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_filesystem] }}" + __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__scs_group] }}" vars: - __clone_filesystem: - resource_id: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_filesystem_resource_name }}" - promotable: "no" + __acs_group: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + resource_ids: | + {% set resource_ids_list = [] %} + {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, + sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name, + sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} + {%- if resource | length > 0 + and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} + {%- set ids = resource_ids_list.append(resource) %} + {%- endif %} + {%- endfor %} + {{ resource_ids_list }} meta_attrs: - attrs: - - name: clone-max - value: 2 - - name: clone-node-max - value: 1 - - name: interleave - value: "true" + - name: resource-stickiness + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_group_stickiness }}" when: - - __clone_filesystem.resource_id not in (__sap_ha_pacemaker_cluster_resource_clones | map(attribute='resource_id')) + - __scs_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) + +# ERS group consists of resources in this order: +# - ERS filesystem +# - ERS instance +# - ERS VIP -- name: "SAP HA Prepare Pacemaker - Add resource clone: SAPInstance for Central Service (JAVA SCS)" +- name: "SAP HA Prepare Pacemaker - Add resource group for ERS resources" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_sapinstance] }}" + __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: - __clone_sapinstance: - resource_id: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_name }}" - promotable: "yes" - meta_attrs: - - attrs: - - name: clone-max - value: 2 - - name: clone-node-max - value: 1 - - name: interleave - value: "true" + __ers_group: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + resource_ids: | + {% set resource_ids_list = [] %} + {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + {%- if resource | length > 0 + and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} + {%- set ids = resource_ids_list.append(resource) %} + {%- endif %} + {%- endfor %} + {{ resource_ids_list }} when: - - __clone_sapinstance.resource_id not in (__sap_ha_pacemaker_cluster_resource_clones | map(attribute='resource_id')) + - __ers_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) + +- name: "SAP HA Prepare Pacemaker - Display VIP resource group definition if any were built" + ansible.builtin.debug: + var: __sap_ha_pacemaker_cluster_resource_groups + when: + - __sap_ha_pacemaker_cluster_resource_groups is defined + - __sap_ha_pacemaker_cluster_resource_groups | length > 0 + -- name: "SAP HA Prepare Pacemaker - Add resource clone: SAPInstance for Enqueue Replication Service (JAVA ERS)" +### Constraints +# ERS and SCS resource groups should try to avoid running on the same node +- name: "SAP HA Prepare Pacemaker - Add colocation constraint: ERS avoids to run on the SCS node" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_sapinstance_ers] }}" + __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" vars: - __clone_sapinstance_ers: - resource_id: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_name }}" - promotable: "yes" - meta_attrs: - - attrs: - - name: clone-max - value: 2 - - name: clone-node-max - value: 1 - - name: interleave - value: "true" + __constraint_colo_ers: + id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" + resource_leader: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + role: started + resource_follower: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + options: + - name: score + value: -5000 when: - - __clone_sapinstance_ers.resource_id not in (__sap_ha_pacemaker_cluster_resource_clones | map(attribute='resource_id')) + - __constraint_colo_ers.resource_follower not in (__sap_ha_pacemaker_cluster_constraints_colocation | map(attribute='resource_follower')) -# First start SAPInstance for Central Service, then SAPInstance for Enqueue Replication Service (automatically stops in reverse order) -- name: "SAP HA Prepare Pacemaker - Add order constraint: Central Service starts before Enqueue Replication Service" +# Optional: SCS should be started before ERS +- name: "SAP HA Prepare Pacemaker - Add order constraint: first start SCS group, then ERS group" ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_sapinstance] }}" + __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_scs_ers] }}" vars: - __constraint_order_sapinstance: + __constraint_order_scs_ers: + id: "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_scs_sapinstance_resource_clone_name }}" - action: start + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_nwas_java_ers_sapinstance_resource_clone_name }}" - action: start + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" - name: kind - value: "Optional" + value: Optional +# when: +# - __constraint_order_scs_ers.resource_then not in (__sap_ha_pacemaker_cluster_constraints_order | map(attribute='resource_then')) + +# ENSA1 only: location rule for SCS to follow ERS +- name: "SAP HA Prepare Pacemaker - Add location constraint: SCS follows ERS in ENSA1 setup" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_location: "{{ __sap_ha_pacemaker_cluster_constraints_location + [__constraint_location_scs_ers] }}" + vars: + __constraint_location_scs_ers: + resource: + id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + rule: "runs_ers_{{ sap_ha_pacemaker_cluster_nwas_sid }} eq 1" + options: + - name: score + value: 2000 + when: + - sap_ha_pacemaker_cluster_nwas_cs_ensa1 + + +# When /sapmnt is managed by the cluster, +# start instance groups only after the SAPMNT resource is running. +- name: "SAP HA Prepare Pacemaker - Add order constraint: first start /sapmnt, then start SCS group" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_sapmnt] }}" + vars: + __constraint_order_sapmnt: + resource_first: + id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + role: started + resource_then: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + when: + - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed + +- name: "SAP HA Prepare Pacemaker - Add order constraint: first start /sapmnt, then start ERS group" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_sapmnt] }}" + vars: + __constraint_order_sapmnt: + resource_first: + id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + role: started + resource_then: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" when: - - __constraint_order_sapinstance.resource_then not in (__sap_ha_pacemaker_cluster_constraints_order | map(attribute='resource_then')) + - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml new file mode 100644 index 000000000..a69ac19b9 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml @@ -0,0 +1,210 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# SCS ERS simple mount cluster is ENSA2. + +### Resources +# SCS SAPStartSrv resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for ABAP SAP Central Service (SCS)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" + vars: + __resource_sapstartsrv: + id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name }}" + agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" + instance_attrs: + - attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + when: + - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + +# ERS SAPStartSrv resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPStartSrv for Enqueue Replication Service (ERS)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" + vars: + __resource_sapstartsrv: + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" + agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" + instance_attrs: + - attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + when: + - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + + +# SCS instance resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for ABAP SAP Central Service (SCS)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" + vars: + __resource_sapinstance: + id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + agent: "ocf:heartbeat:SAPInstance" + instance_attrs: + - attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + - name: START_PROFILE + value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + - name: AUTOMATIC_RECOVER + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" + - name: MINIMAL_PROBE + value: true + meta_attrs: + - attrs: + - name: resource-stickiness + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + operations: + # TODO: Add values for start and stop when they are published. + - action: monitor + attrs: + - name: interval + value: 11 + - name: on-fail + value: restart + - name: timeout + value: 60 + when: + - __resource_sapinstance.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + + +# ERS instance resource definition +- name: "SAP HA Prepare Pacemaker - Add resource: SAPInstance for Enqueue Replication Service (ERS)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" + vars: + __resource_sapinstance_ers: + id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + agent: "ocf:heartbeat:SAPInstance" + instance_attrs: + - attrs: + - name: InstanceName + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + - name: START_PROFILE + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + - name: AUTOMATIC_RECOVER + value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + - name: IS_ERS + value: true + - name: MINIMAL_PROBE + value: true + operations: + # TODO: Add values for start and stop when they are published. + - action: monitor + attrs: + - name: interval + value: 11 + - name: on-fail + value: restart + - name: timeout + value: 60 + when: + - __resource_sapinstance_ers.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) + + +### Groups +# SCS group consists of resources in this order: +# - SCS VIP +# - SCS SAPStartSrv +# - SCS SAPInstance +- name: "SAP HA Prepare Pacemaker - Add resource group for SCS resources" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__scs_group] }}" + vars: + __scs_group: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + resource_ids: | + {% set resource_ids_list = [] %} + {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, + sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name, + sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} + {%- if resource | length > 0 + and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} + {%- set ids = resource_ids_list.append(resource) %} + {%- endif %} + {%- endfor %} + {{ resource_ids_list }} + meta_attrs: + - attrs: + - name: resource-stickiness + value: "{{ sap_ha_pacemaker_cluster_nwas_cs_group_stickiness }}" + when: + - __scs_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) + + +# ERS group consists of resources in this order: +# - ERS VIP +# - ERS SAPStartSrv +# - ERS SAPInstance +- name: "SAP HA Prepare Pacemaker - Add resource group for ERS resources" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" + vars: + __ers_group: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + resource_ids: | + {% set resource_ids_list = [] %} + {%- for resource in + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + {%- if resource | length > 0 + and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} + {%- set ids = resource_ids_list.append(resource) %} + {%- endif %} + {%- endfor %} + {{ resource_ids_list }} + when: + - __ers_group.id is not in (__sap_ha_pacemaker_cluster_resource_groups | map(attribute='id')) + +- name: "SAP HA Prepare Pacemaker - Display VIP resource group definition if any were built" + ansible.builtin.debug: + var: __sap_ha_pacemaker_cluster_resource_groups + when: + - __sap_ha_pacemaker_cluster_resource_groups is defined + - __sap_ha_pacemaker_cluster_resource_groups | length > 0 + + +### Constraints +# ERS and SCS resource groups should try to avoid running on the same node +- name: "SAP HA Prepare Pacemaker - Add colocation constraint: ERS avoids to run on the SCS node" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" + vars: + __constraint_colo_ers: + id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" + resource_leader: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + role: started + resource_follower: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + options: + - name: score + value: -5000 + when: + - __constraint_colo_ers.resource_follower not in (__sap_ha_pacemaker_cluster_constraints_colocation | map(attribute='resource_follower')) + +# Optional: SCS should be started before ERS +- name: "SAP HA Prepare Pacemaker - Add order constraint: first start SCS group, then ERS group" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_scs_ers] }}" + vars: + __constraint_order_scs_ers: + id: "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" + resource_first: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + role: started + resource_then: + id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + options: + - name: symmetrical + value: "false" + - name: kind + value: Optional + when: + - __constraint_order_scs_ers.resource_then not in (__sap_ha_pacemaker_cluster_constraints_order | map(attribute='resource_then')) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml index daf3c7217..ba47aae02 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_stonith.yml @@ -70,7 +70,7 @@ - sap_ha_pacemaker_cluster_cluster_properties is iterable - sap_ha_pacemaker_cluster_cluster_properties | length > 0 ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties | default([]) + __stonith_properties }}" + __sap_ha_pacemaker_cluster_cluster_properties: "{{ __sap_ha_pacemaker_cluster_cluster_properties | d([]) + __stonith_properties }}" vars: __stonith_properties: - attrs: |- @@ -99,10 +99,10 @@ - sap_ha_pacemaker_cluster_stonith_custom is not defined or sap_ha_pacemaker_cluster_stonith_custom | length == 0 - (hostvars[stonith_host_item].__sap_ha_pacemaker_cluster_stonith_default).id - not in (__sap_ha_pacemaker_cluster_stonith_resource | default([])| map(attribute='id')) + not in (__sap_ha_pacemaker_cluster_stonith_resource | d([])| map(attribute='id')) ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_stonith_resource: - "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + "{{ __sap_ha_pacemaker_cluster_stonith_resource | d([]) + [hostvars[stonith_host_item].__sap_ha_pacemaker_cluster_stonith_default] }}" loop: "{{ ansible_play_hosts_all }}" loop_control: @@ -218,9 +218,9 @@ - stonith_item.name is defined and stonith_item.name | length > 0 and stonith_item.options is defined and stonith_item.options | length > 0 # Keep following conditional after removing Tech Debt - - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([]) | map(attribute='id')) + - __stonith_resource_element.id not in (__sap_ha_pacemaker_cluster_stonith_resource | d([]) | map(attribute='id')) ansible.builtin.set_fact: - __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [__stonith_resource_element] }}" + __sap_ha_pacemaker_cluster_stonith_resource: "{{ __sap_ha_pacemaker_cluster_stonith_resource | d([]) + [__stonith_resource_element] }}" vars: __stonith_resource_element: # Ensure that resource name conforms with naming convention rsc_ @@ -251,10 +251,10 @@ and sap_ha_pacemaker_cluster_stonith_custom is iterable and sap_ha_pacemaker_cluster_stonith_custom is not string - stonith_item.id is defined and stonith_item.id | length > 0 - - stonith_item.id not in (__sap_ha_pacemaker_cluster_stonith_resource | default([]) | map(attribute='id')) + - stonith_item.id not in (__sap_ha_pacemaker_cluster_stonith_resource | d([]) | map(attribute='id')) ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_stonith_resource: - "{{ __sap_ha_pacemaker_cluster_stonith_resource | default([]) + [stonith_item] }}" + "{{ __sap_ha_pacemaker_cluster_stonith_resource | d([]) + [stonith_item] }}" loop: "{{ sap_ha_pacemaker_cluster_stonith_custom }}" loop_control: label: "{{ stonith_item.name if stonith_item.name is defined else stonith_item.id }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml index d8be1d4b7..8f3e4449d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml @@ -18,14 +18,14 @@ vip_hc_resources: - "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name }}" + - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" + - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" vip_hc_resources: - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml index 43176a186..850f1f86d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml @@ -15,17 +15,31 @@ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port } }}" + nwas_abap_ascs_ers: "{{ { - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name: - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name: - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port + sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: + sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | regex_replace('/.*', ''), + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: + sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), + sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: + sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port } }}" + + nwas_java_scs_ers: "{{ + { + sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: + sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | regex_replace('/.*', ''), + sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: + sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), + sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: + sap_ha_pacemaker_cluster_healthcheck_nwas_scs_port, + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port + } }}" + nwas_abap_pas_aas: "{{ { sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: @@ -63,7 +77,7 @@ - name: "SAP HA Prepare Pacemaker - Combine VIP parameters" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_vip_resource_definition: - "{{ __sap_ha_pacemaker_cluster_vip_resource_definition | default({}) + "{{ __sap_ha_pacemaker_cluster_vip_resource_definition | d({}) | combine(__sap_ha_pacemaker_cluster_all_vip_fact[vip_item]) | dict2items | rejectattr('value', 'equalto', '') | list | items2dict }}" loop: "{{ sap_ha_pacemaker_cluster_host_type }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml index 446e2c981..459882b83 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml @@ -33,3 +33,119 @@ else sap_ha_pacemaker_cluster_cluster_properties }}" when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 + + +# Calculate private variables +- name: "SAP HA Prepare Pacemaker - Set primary variables (HANA)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_hana_sid: + "{{ sap_ha_pacemaker_cluster_hana_sid | d(sap_hana_sid) | d('') | upper }}" + + # TODO: Remove backwards compatibility sap_ha_pacemaker_cluster_hana_instance_number + __sap_ha_pacemaker_cluster_hana_instance_nr: + "{{ sap_ha_pacemaker_cluster_hana_instance_nr | d(sap_ha_pacemaker_cluster_hana_instance_number) + | d(sap_hana_instance_number) | d('') }}" + + +- name: "SAP HA Prepare Pacemaker - Set cluster resource variables: Primitives (HANA)" + ansible.builtin.set_fact: + # SAP Hana + __sap_ha_pacemaker_cluster_hana_resource_name: + "{{ sap_ha_pacemaker_cluster_hana_resource_name + | d('rsc_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hana_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name + | d('cln_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: + "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name + | d('msl_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + # SAP Hana Controller + __sap_ha_pacemaker_cluster_hanacontroller_resource_name: + "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_name + | d('rsc_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name + | d('mst_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + # SAP Hana Topology + __sap_ha_pacemaker_cluster_hana_topology_resource_name: + "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name + | d('rsc_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name + | d('cln_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + # SAP Hana Filesystem + __sap_ha_pacemaker_cluster_hana_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_name + | d('rsc_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name + | d('cln_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + +- name: "SAP HA Prepare Pacemaker - Set cluster resource variables: Constraints (HANA)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_hana_order_topology_hana_name: + "{{ sap_ha_pacemaker_cluster_hana_order_topology_hana_name + | d('ord_saphana_saphanatop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + + __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name: + "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name + | d('col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + + __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name: + "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name + | d('col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + + __sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name: + "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name + | d('ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + + __sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name: + "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name + | d('ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + + +- name: "SAP HA Prepare Pacemaker - Set cluster resource variables: VIP (HANA)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_vip_hana_primary_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | d('') }}" + + __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: + "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + + __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: + "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + + __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | d('') }}" + + __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: + "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + + __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: + "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + + __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id: + "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id | d(__sap_ha_pacemaker_cluster_hana_sid ~ 'prim') }}" + + __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id: + "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id | d(__sap_ha_pacemaker_cluster_hana_sid ~ 'ro') }}" + + +- name: "SAP HA Prepare Pacemaker - Set variables: Other (HANA)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_hana_global_ini_path: + "{{ sap_ha_pacemaker_cluster_hana_global_ini_path + | d('/usr/sap/' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '/SYS/global/hdb/custom/config/global.ini') }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml index 388ef55d9..d4fb4bc53 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml @@ -12,3 +12,333 @@ - "{{ sap_ha_pacemaker_cluster_host_type }}" when: - "(role_path + '/vars/' + include_item + '.yml') is file" + + +# Calculate private variables +- name: "SAP HA Prepare Pacemaker - Set primary variables (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_sid: + "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | d(sap_swpm_sid) | d('') | upper + if sap_ha_pacemaker_cluster_nwas_sid | length == 0 else sap_ha_pacemaker_cluster_nwas_sid | upper }}" + + __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | d(sap_swpm_ascs_instance_nr) | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + + __sap_ha_pacemaker_cluster_nwas_scs_instance_nr: + "{{ sap_ha_pacemaker_cluster_nwas_scs_instance_nr | d(sap_swpm_java_scs_instance_nr) | d('') }}" + + # Assign from sap_swpm variables based on host type + __sap_ha_pacemaker_cluster_nwas_ers_instance_nr: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | d(sap_swpm_ers_instance_nr) | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 and sap_ha_pacemaker_cluster_host_type == 'nwas_abap_ascs_ers' + else (sap_swpm_ers_instance_nr | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 and sap_ha_pacemaker_cluster_host_type == 'nwas_java_scs_ers' + else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + # __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: + # "{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr | d(sap_swpm_pas_instance_nr) | d('') }}" + + # __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: + # "{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr | d(sap_swpm_aas_instance_nr) | d('') }}" + + +- name: "SAP HA Prepare Pacemaker - Set cluster resource variable: VIP (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + # ASCS + __sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address }}" + + __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name | d('') + if sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + # SCS + __sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | d('') }}" + + __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + # ERS + __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | d('') }}" + + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name | d('') + if sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + # # PAS + # __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: + # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | d('') }}" + + # __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: + # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name + # | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr) }}" + + # __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: + # "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name + # | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr) }}" + + # # AAS + # __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: + # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | d('') }}" + + # __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: + # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name + # | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr) }}" + + # __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: + # "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name + # | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr) }}" + +# Currently not implemented +# - name: "SAP HA Prepare Pacemaker - Set cluster resource variable: VIP Health Checks (Netweaver)" +# ansible.builtin.set_fact: +# # TODO: Remove backwards compatibility to nwas_abap_ascs +# __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: +# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | d(sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id) +# | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ascs') }}" + +# __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: +# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'scs') }}" + +# __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: +# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | d(sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id) +# | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ers') }}" + +# __sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: +# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'pas') }}" + +# __sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: +# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'aas') }}" + + +- name: "SAP HA Prepare Pacemaker - Set cluster resource variable: Filesystem (Netweaver)" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt') }}" + + __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name + | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt') }}" + + __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans') }}" + + __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name + | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans') }}" + + __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys') }}" + + __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name: + "{{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name + | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys') }}" + + +- name: "SAP HA Prepare Pacemaker - Set variable: Instance names (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name + | d(sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name) | d('') }}" + + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name: + "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name | d('') }}" + + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | d('') + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name + | d(sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name) | d('') }}" + + +- name: "SAP HA Prepare Pacemaker - Set variable: Instance profile paths (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string + | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') + ~ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name}}" + + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string: + "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string + | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') + ~ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name}}" + + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string | d('') + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string + | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') + ~ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name}}" + + +- name: "SAP HA Prepare Pacemaker - Set variables for ASCS resources (Netweaver)" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name + | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name + | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name + | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name: + "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name + | d('col_ascs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + + __sap_ha_pacemaker_cluster_nwas_order_ascs_first_name: + "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name + | d('ord_ascs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + + +- name: "SAP HA Prepare Pacemaker - Set variables for SCS resources (Netweaver)" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name + | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name + | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name + | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name: + "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name + | d('col_scs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + + __sap_ha_pacemaker_cluster_nwas_order_scs_first_name: + "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name + | d('ord_scs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + + +- name: "SAP HA Prepare Pacemaker - Set variables for ERS resources (Netweaver)" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name + | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name | d('') + if sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name + | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name | d('') + if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name + | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool | d(false) + if not sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool }}" + + +- name: "SAP HA Prepare Pacemaker - Set variables for Central Services parameters (Netweaver)" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | d(false) + if not sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool + else sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool }}" + + __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness | d(5000) + if sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness != 5000 + else sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + +- name: Pause + ansible.builtin.pause: + minutes: 1200 + +# TODO: Add PAS and AAS variables +# sap_ha_pacemaker_cluster_nwas_abap_pas_filesystem_resource_name: > +# "Filesystem_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +# sap_ha_pacemaker_cluster_nwas_abap_pas_sapinstance_resource_name: > +# "SAPInstance_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +# sap_ha_pacemaker_cluster_nwas_abap_aas_filesystem_resource_name: > +# "Filesystem_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +# sap_ha_pacemaker_cluster_nwas_abap_aas_sapinstance_resource_name: > +# "SAPInstance_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/main.yml b/roles/sap_ha_pacemaker_cluster/tasks/main.yml index 673225be8..1a81211aa 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/main.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/main.yml @@ -48,8 +48,8 @@ - name: "SAP HA Prepare Pacemaker - Include variable construction for VIP resources" ansible.builtin.import_tasks: include_construct_vip_resources.yml -# Include construction task files for different scenarios. +# SAP HANA Scenarios - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP HANA common" ansible.builtin.include_tasks: file: construct_vars_hana_common.yml @@ -70,23 +70,31 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 - __sap_ha_pacemaker_cluster_saphanasr_angi_available + +# Common variables for Netweaver scenarios - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver common" ansible.builtin.include_tasks: - file: construct_vars_nwas_common.yml + file: "{{ item }}" + loop: + - construct_vars_nwas_common.yml + - gather_vars_nwas.yml when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 + -- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ABAP ASCS/ERS" +# SAP ASCS/ERS Scenarios +- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ASCS/ERS" ansible.builtin.include_tasks: file: construct_vars_nwas_abap_ascs_ers.yml loop: "{{ sap_ha_pacemaker_cluster_host_type }}" loop_control: loop_var: nwas_build_item when: - - "'nwas_abap_ascs' in nwas_build_item" - - not sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount + - "'nwas_abap_ascs_ers' in nwas_build_item" + - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount -- name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ABAP ASCS/ERS +- name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ASCS/ERS Simple Mount Simple Mount # noqa name[template] ansible.builtin.include_tasks: file: construct_vars_nwas_abap_ascs_ers_simple_mount.yml @@ -94,28 +102,43 @@ loop_control: loop_var: nwas_build_item when: - - "'nwas_abap_ascs' in nwas_build_item" - - sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount - # TODO: Remove rule when SAPStartSrv resource agents are available on Red Hat - - ansible_os_family == 'Suse' + - "'nwas_abap_ascs_ers' in nwas_build_item" + - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount -- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ABAP PAS/AAS" + +# SAP SCS/ERS Scenarios +- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver SCS/ERS" ansible.builtin.include_tasks: - file: construct_vars_nwas_abap_pas_aas.yml + file: construct_vars_nwas_java_scs_ers.yml loop: "{{ sap_ha_pacemaker_cluster_host_type }}" loop_control: loop_var: nwas_build_item when: - - "'nwas_abap_pas' in nwas_build_item" + - "'nwas_java_scs_ers' in nwas_build_item" + - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount -- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver Java SCS/ERS" +- name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver SCS/ERS Simple Mount + Simple Mount # noqa name[template] ansible.builtin.include_tasks: - file: construct_vars_nwas_java_scs_ers.yml + file: construct_vars_nwas_java_scs_ers_simple_mount.yml loop: "{{ sap_ha_pacemaker_cluster_host_type }}" loop_control: loop_var: nwas_build_item when: - - "'nwas_java' in nwas_build_item" + - "'nwas_java_scs_ers' in nwas_build_item" + - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + + +# SAP PAS/AAS Scenarios +- name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ABAP PAS/AAS" + ansible.builtin.include_tasks: + file: construct_vars_nwas_abap_pas_aas.yml + loop: "{{ sap_ha_pacemaker_cluster_host_type }}" + loop_control: + loop_var: nwas_build_item + when: + - "'nwas_abap_pas' in nwas_build_item" + # Include constraints construction after the related resources were constructed. - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP Hana VIP constraints" @@ -183,6 +206,16 @@ owner: root mode: "0600" + + # TODO REMOVE + - name: Debug __sap_ha_pacemaker_cluster_resource_primitives + ansible.builtin.debug: + var: __sap_ha_pacemaker_cluster_resource_primitives + - name: Pause + ansible.builtin.pause: + minutes: 1200 + + # Cluster installation and configuration through the dedicated # linux system role 'ha_cluster' - name: "SAP HA Install Pacemaker - Include System Role 'ha_cluster'" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml index 4877e7cdc..2940192bf 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml @@ -58,9 +58,9 @@ {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name and sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port | length > 4 -%} {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name -%} + {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name -%} + {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }} {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_id }} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml index 3ddec3b6f..0944a5796 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml @@ -35,9 +35,9 @@ {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name and sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port | length > 4 -%} {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name -%} + {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name -%} + {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }} {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_id }} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index 242c42a98..4e3a5e42d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -62,11 +62,11 @@ ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_ascs: - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port }}" - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port }}" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" @@ -148,7 +148,7 @@ loop_var: haproxy_item label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - name: "SAP HA Install Pacemaker - GCP CE VM - Ensure that haproxy service is running" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml index e9603fe6f..243cce6b4 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml @@ -94,11 +94,11 @@ ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_ascs: - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port }}" - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" - port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port }}" + port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port }}" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" ansible.builtin.blockinfile: @@ -178,7 +178,7 @@ loop_var: haproxy_item label: "{{ haproxy_item.name }}: {{ haproxy_item.port }}" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 # - name: "SAP HA Prepare Pacemaker - IBM Cloud VS - haproxy listener configuration" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml index f1090d416..676677ea3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml @@ -8,7 +8,7 @@ - sap_ha_pacemaker_cluster_hana_sid not in __sap_ha_pacemaker_cluster_sid_prohibited fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Requires 'sap_ha_pacemaker_cluster_hana_sid' to be defined! + Requires:'sap_ha_pacemaker_cluster_hana_sid' to be defined as 3 capital letters! when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 @@ -34,46 +34,167 @@ when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 + +# - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP System ID" +# ansible.builtin.assert: +# that: +# - sap_ha_pacemaker_cluster_nwas_sid | length == 3 +# - sap_ha_pacemaker_cluster_nwas_sid not in __sap_ha_pacemaker_cluster_sid_prohibited +# fail_msg: | +# Host type = {{ sap_ha_pacemaker_cluster_host_type }} +# Requires 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! +# when: +# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 + +# TODO: Remove backwards compatibility to nwas_abap_ascs - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP System ID" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_nwas_abap_sid | length == 3 - - sap_ha_pacemaker_cluster_nwas_abap_sid not in __sap_ha_pacemaker_cluster_sid_prohibited + - __nwas_sid | length == 3 + - __nwas_sid not in __sap_ha_pacemaker_cluster_sid_prohibited fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Requires 'sap_ha_pacemaker_cluster_nwas_abap_sid' to be defined! + Current value: {{ __nwas_sid }} + Requires 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 + vars: + __nwas_sid: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | d(sap_swpm_sid) | d('') + if sap_ha_pacemaker_cluster_nwas_sid | length == 0 else sap_ha_pacemaker_cluster_nwas_sid }}" + + +# TODO: Remove backwards compatibility to nwas_abap_ascs +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Backwards compatibility: Instance Number ASCS/ERS" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + ansible.builtin.set_fact: + sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | d(sap_swpm_ascs_instance_nr) | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 + and sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr is defined + and sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | length > 0 + else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + + sap_ha_pacemaker_cluster_nwas_ers_instance_nr: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | d(sap_swpm_ers_instance_nr) | d('') + if sap_ha_pacemaker_cluster_nwas_ers_instance_nr | length == 0 + and sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr is defined + and sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | length > 0 + else sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + +# Validate SAP Instance Number - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP Instance Number" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 + - __instance_nr | length > 0 ansible.builtin.assert: that: - - ( - ascs_ers_nr_item | type_debug != 'int' - and ascs_ers_nr_item | length == 2 - ) - or - ( - ascs_ers_nr_item | type_debug == 'int' - and ascs_ers_nr_item is regex("^[0-9][0-9]$") - ) + - (__instance_nr | string) | length == 2 + - (__instance_nr | string) is match('^[0-9]{2}$') fail_msg: | - Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Requires the ASCS/ERS instance numbers to be defined: - - sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr - - sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr - The instance number must be exactly 2 digits. Add quotes if the number starts with a 0! + Required: + {% if sap_ha_pacemaker_cluster_host_type == 'nwas_abap_ascs_ers' %} + - sap_ha_pacemaker_cluster_nwas_ascs_instance_nr + - sap_ha_pacemaker_cluster_nwas_ers_instance_nr + + {% elif sap_ha_pacemaker_cluster_host_type == 'nwas_java_scs_ers' %} + - sap_ha_pacemaker_cluster_nwas_scs_instance_nr + - sap_ha_pacemaker_cluster_nwas_ers_instance_nr + + {% elif sap_ha_pacemaker_cluster_host_type == 'nwas_abap_pas_aas' %} + - sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + - sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + + {% else %} + Invalid sap_ha_pacemaker_cluster_host_type provided. + {% endif %} + loop: - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" + - sap_ha_pacemaker_cluster_nwas_ascs_instance_nr + - sap_ha_pacemaker_cluster_nwas_scs_instance_nr + - sap_ha_pacemaker_cluster_nwas_ers_instance_nr + - sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + - sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr loop_control: - loop_var: ascs_ers_nr_item + loop_var: item + vars: + __instance_nr: "{{ lookup('ansible.builtin.vars', item) }}" + + +# Ensure that storage definition is provided for Filesystem based scenarios +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate storage definition" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 + - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + ansible.builtin.assert: + that: + - sap_ha_pacemaker_cluster_storage_definition is defined + - sap_ha_pacemaker_cluster_storage_definition | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Classic cluster without Simple Mount requires: + - sap_ha_pacemaker_cluster_storage_definition + + +# TODO: Remove backwards compatibility to nwas_abap_ascs +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Backwards compatibility: Instance Names" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + ansible.builtin.set_fact: + sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | d('') + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length == 0 + and sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name is defined + and sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | length > 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + + sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | d('') + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length == 0 + and sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name is defined + and sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | length > 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + +# Ensure that SAP profile names are defined +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver ASCS) Validate SAP instance name" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + ansible.builtin.assert: + that: + - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name is defined + - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + ASCS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name + +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver SCS) Validate SAP instance name" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + ansible.builtin.assert: + that: + - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name is defined + - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + SCS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name + +- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver ERS) Validate SAP instance name" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 + ansible.builtin.assert: + that: + - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name is defined + - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + ERS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name # NIC definition validation @@ -112,35 +233,45 @@ - name: "SAP HA Prepare Pacemaker - (NetWeaver ASCS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address' is not defined." + - sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address is defined + - sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | length > 0 + fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address' is not defined." when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs') | length > 0 - -# - name: "SAP HA Prepare Pacemaker - (NetWeaver ERS) Verify that the VIP is defined" -# ansible.builtin.assert: -# that: -# - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address is defined -# - sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | length > 0 -# fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address' is not defined." -# when: -# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 -- name: "SAP HA Prepare Pacemaker - (NetWeaver PAS) Verify that the VIP is defined" +- name: "SAP HA Prepare Pacemaker - (NetWeaver SCS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address' is not defined." + - sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address is defined + - sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | length > 0 + fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address' is not defined." when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 -- name: "SAP HA Prepare Pacemaker - (NetWeaver AAS) Verify that the ERS VIP is defined" +- name: "SAP HA Prepare Pacemaker - (NetWeaver ERS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address' is not defined." + - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address is defined + - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | length > 0 + fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address' is not defined." when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + +# - name: "SAP HA Prepare Pacemaker - (NetWeaver PAS) Verify that the VIP is defined" +# ansible.builtin.assert: +# that: +# - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address is defined +# - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | length > 0 +# fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address' is not defined." +# when: +# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas') | length > 0 + +# - name: "SAP HA Prepare Pacemaker - (NetWeaver AAS) Verify that the ERS VIP is defined" +# ansible.builtin.assert: +# that: +# - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address is defined +# - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | length > 0 +# fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address' is not defined." +# when: +# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 diff --git a/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 b/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 index 98c536090..14f18adcc 100644 --- a/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 +++ b/roles/sap_ha_pacemaker_cluster/templates/cluster_create_config.j2 @@ -6,58 +6,58 @@ # Created by: {{ ansible_role_name }} # The name of the cluster -ha_cluster_cluster_name: {{ ha_cluster_cluster_name | default('') }} +ha_cluster_cluster_name: {{ ha_cluster_cluster_name | d('') }} # Properties that enable and control cluster behavior ha_cluster_cluster_properties: -{{ ha_cluster_cluster_properties | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_cluster_properties | d() | to_nice_yaml(indent=2) }} # Definition of resource defaults ha_cluster_resource_defaults: -{{ ha_cluster_resource_defaults | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_resource_defaults | d() | to_nice_yaml(indent=2) }} # Definition of operation defaults ha_cluster_resource_operation_defaults: -{{ ha_cluster_resource_operation_defaults | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_resource_operation_defaults | d() | to_nice_yaml(indent=2) }} # Definition of resources which depend on other resources ha_cluster_constraints_colocation: -{{ ha_cluster_constraints_colocation | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_constraints_colocation | d() | to_nice_yaml(indent=2) }} # Definition of resources which have specific location dependencies or preferences ha_cluster_constraints_location: -{{ ha_cluster_constraints_location | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_constraints_location | d() | to_nice_yaml(indent=2) }} # Definition of an order in which resources must be started. # They are automatically stopped in reverse order. ha_cluster_constraints_order: -{{ ha_cluster_constraints_order | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_constraints_order | d() | to_nice_yaml(indent=2) }} # Extra packages that are needed for this HA environment ha_cluster_extra_packages: -{{ ha_cluster_extra_packages | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_extra_packages | d() | to_nice_yaml(indent=2) }} # Fence agent package(s) for this HA environment ha_cluster_fence_agent_packages: -{{ ha_cluster_fence_agent_packages | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_fence_agent_packages | d() | to_nice_yaml(indent=2) }} # Definition of repositories to enable (if disable) to ensure # access to all required packages __ha_cluster_repos: -{{ __ha_cluster_repos | default() | to_nice_yaml(indent=2) }} +{{ __ha_cluster_repos | d() | to_nice_yaml(indent=2) }} # Definition of resources that are cloned and monitored on all nodes ha_cluster_resource_clones: -{{ ha_cluster_resource_clones | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_resource_clones | d() | to_nice_yaml(indent=2) }} # Definition of resources that are grouped together ha_cluster_resource_groups: -{{ ha_cluster_resource_groups | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_resource_groups | d() | to_nice_yaml(indent=2) }} # Definition of all cluster resources ha_cluster_resource_primitives: -{{ ha_cluster_resource_primitives | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_resource_primitives | d() | to_nice_yaml(indent=2) }} # Definition of corosync totem settings ha_cluster_totem: -{{ ha_cluster_totem | default() | to_nice_yaml(indent=2) }} +{{ ha_cluster_totem | d() | to_nice_yaml(indent=2) }} diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml index 1002e9f61..3cd70e66f 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleout_perf.yml @@ -8,7 +8,7 @@ # minimal base packages required for all scenarios # scenario specific packages __sap_ha_pacemaker_cluster_sap_extra_packages: "{{ - __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | default([]) + __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | d([]) + (__sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_angi if __sap_ha_pacemaker_cluster_saphanasr_angi_available else __sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_scaleout) }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml index dcc1539a1..d471f5f73 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/hana_scaleup_perf.yml @@ -8,7 +8,7 @@ # minimal base packages required for all scenarios # scenario specific packages __sap_ha_pacemaker_cluster_sap_extra_packages: "{{ - __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | default([]) + __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | d([]) + (__sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_angi if __sap_ha_pacemaker_cluster_saphanasr_angi_available else __sap_ha_pacemaker_cluster_sap_extra_packages_dict.hana_scaleup) }}" @@ -30,9 +30,9 @@ __sap_ha_pacemaker_cluster_hana_hook_chksrv: __sap_ha_pacemaker_cluster_hana_hooks: "{{ lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).saphanasr + (lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).tkover - | default([]) if __sap_ha_pacemaker_cluster_hana_hook_tkover else []) + | d([]) if __sap_ha_pacemaker_cluster_hana_hook_tkover else []) + (lookup('ansible.builtin.vars', __sap_ha_pacemaker_cluster_hana_hook_dictionary).chksrv - | default([]) if __sap_ha_pacemaker_cluster_hana_hook_chksrv else []) + | d([]) if __sap_ha_pacemaker_cluster_hana_hook_chksrv else []) }}" # Define sap_ha_pacemaker_cluster_hadr_provider_name for jinja2 template diff --git a/roles/sap_ha_pacemaker_cluster/vars/main.yml b/roles/sap_ha_pacemaker_cluster/vars/main.yml index 2e682ca4d..6c56b4d09 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/main.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/main.yml @@ -45,16 +45,16 @@ __sap_ha_pacemaker_cluster_available_vip_agents: __sap_ha_pacemaker_cluster_vip_resource_list: - "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" - "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_resource_list: - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }}" - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" + - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name }}" - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name }}" @@ -64,8 +64,13 @@ __sap_ha_pacemaker_cluster_healthcheck_resource_list: # includes when not overridden. sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: '' sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: '' -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port: '' -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: '' +# TODO: Remove backwards compatibility to nwas_abap_ascs +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port | d('') }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_scs_port: '' +# TODO: Remove backwards compatibility to nwas_abap_ascs +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port | d('') }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: '' sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: '' diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml index b98247c7e..7c3607cc2 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml @@ -3,12 +3,12 @@ # The following directories are appended to the 'nfs_path' of the '/usr/sap' storage # definition. # Therefore, the /usr/sap prefix must be left out of the listed path items. -__sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_filesystems: - - "{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}/ASCS{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_abap_sid }}/ERS{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" +__sap_ha_pacemaker_cluster_nwas_ascs_ers_filesystems: + - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ASCS{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ERS{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" # List of ASCS/ERS profile names. # Used in tasks/configure_nwas_postinstallation.yml for sap_cluster_connector setup. -__sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_profile_paths: - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string }}" - - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string }}" +__sap_ha_pacemaker_cluster_nwas_ascs_ers_profile_paths: + - "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml index 9ad1bd68c..4523021b6 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_common.yml @@ -9,7 +9,7 @@ # scenario specific packages # halib package if selected __sap_ha_pacemaker_cluster_sap_extra_packages: "{{ - __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | default([]) + __sap_ha_pacemaker_cluster_sap_extra_packages_dict.minimal | d([]) + ([__sap_ha_pacemaker_cluster_halib_package] if sap_ha_pacemaker_cluster_enable_cluster_connector else []) + __sap_ha_pacemaker_cluster_sap_extra_packages_dict.nwas | unique }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml new file mode 100644 index 000000000..984aecdd5 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# The following directories are appended to the 'nfs_path' of the '/usr/sap' storage +# definition. +# Therefore, the /usr/sap prefix must be left out of the listed path items. +__sap_ha_pacemaker_cluster_nwas_scs_ers_filesystems: + - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SCS{{ sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" + - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ERS{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + +# List of SCS/ERS profile names. +# Used in tasks/configure_nwas_postinstallation.yml for sap_cluster_connector setup. +__sap_ha_pacemaker_cluster_nwas_scs_ers_profile_paths: + - "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml index de28edbf1..dec30bea7 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_aws_ec2_vs.yml @@ -6,13 +6,13 @@ # Package definition __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws_ec2_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_aws_ec2_vs | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws_ec2_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_aws_ec2_vs | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_aws_ec2_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_aws_ec2_vs | d([]) }}" # Stonith dictionary for default stonith agents. @@ -219,7 +219,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_aws_ec2_vs | default('aws_vpc_move_ip') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_aws_ec2_vs | d('aws_vpc_move_ip') }}" sap_ha_pacemaker_cluster_vip_group_prefix: '' # the default supported VIP agent is a single resource only __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index e5edfac7c..7484bf95c 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -5,13 +5,13 @@ # TODO: make sure to first respect 'ha_cluster' native variables __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp_ce_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_gcp_ce_vm | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp_ce_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_gcp_ce_vm | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_gcp_ce_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_gcp_ce_vm | d([]) }}" # Stonith dictionary for default stonith agents. @@ -96,8 +96,8 @@ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" @@ -110,7 +110,7 @@ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker # RHEL - VIP: IPaddr2, Healthcheck: haproxy # HANA: https://cloud.google.com/solutions/sap/docs/sap-hana-ha-config-rhel#create_a_virtual_ip_address_resource # NWAS: https://cloud.google.com/solutions/sap/docs/netweaver-ha-config-rhel#create_a_virtual_ip_address_resource -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_gcp_ce_vm | default('gcp_nlb_reserved_ip_haproxy') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_gcp_ce_vm | d('gcp_nlb_reserved_ip_haproxy') }}" sap_ha_pacemaker_cluster_vip_group_prefix: group_ diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml index 8c1c5237f..477d39235 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_powervs.yml @@ -5,13 +5,13 @@ # TODO: make sure to first respect 'ha_cluster' native variables __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_powervs | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_powervs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_powervs | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_powervs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_powervs | d([]) }}" # Stonith dictionary for default stonith agents. @@ -40,12 +40,12 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: # Dependent on network interface attachments, if no public network interface # then 'private' value must be provided. - name: api-type - value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | default('public') }}" + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type | d('public') }}" # Dependent on network interface attachments, if no public network interface # then a valid HTTP Proxy URL value must be provided. - name: proxy - value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | default('') }}" + value: "{{ sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url | d('') }}" # String of cluster hosts defined in include_vars_platform - name: pcmk_host_map @@ -74,7 +74,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_powervs | default('ipaddr_custom') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_powervs | d('ipaddr_custom') }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index 5663889b5..dfb63f3bc 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -5,13 +5,13 @@ # TODO: make sure to first respect 'ha_cluster' native variables __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_ibmcloud_vs | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_ibmcloud_vs | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_vs | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_ibmcloud_vs | d([]) }}" # Stonith dictionary for default stonith agents. @@ -50,7 +50,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_vs | default('ibmcloud_alb_haproxy') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_ibmcloud_vs | d('ibmcloud_alb_haproxy') }}" # For HAPROXY an non-empty port default is required to enter the resource creation flow. # TODO: task logic that configures actual haproxy listening ports, @@ -60,8 +60,8 @@ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index e34e3975d..e17436e36 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -8,13 +8,13 @@ # Any packages that are pre-requisites for variable construction must be installed before, e.g. # in the preconfigure-* tasks. __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.cloud_msazure_vm | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_msazure_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.cloud_msazure_vm | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_msazure_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.cloud_msazure_vm | d([]) }}" # Stonith dictionary for default stonith agents. @@ -118,7 +118,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_msazure_vm | default('azure_lb') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.cloud_msazure_vm | d('azure_lb') }}" # The VIP layer consists of 2 components - the VIP and the health check resource sap_ha_pacemaker_cluster_vip_group_prefix: group_ @@ -128,8 +128,8 @@ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml index af4b1e665..55b34a1e3 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_hyp_ibmpower_vm.yml @@ -5,13 +5,13 @@ # TODO: make sure to first respect 'ha_cluster' native variables __sap_ha_pacemaker_cluster_fence_agent_packages_platform: - "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_fence_agent_packages_dict.hyp_ibmpower_vm | d([]) }}" __sap_ha_pacemaker_cluster_platform_extra_packages: - "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.hyp_ibmpower_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_platform_extra_packages_dict.hyp_ibmpower_vm | d([]) }}" __sap_ha_pacemaker_cluster_repos: - "{{ __sap_ha_pacemaker_cluster_repos_dict.hyp_ibmpower_vm | default([]) }}" + "{{ __sap_ha_pacemaker_cluster_repos_dict.hyp_ibmpower_vm | d([]) }}" # Stonith dictionary for default stonith agents. @@ -31,7 +31,7 @@ __sap_ha_pacemaker_cluster_stonith_default_dict: - name: password value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_login_password }}" - name: hmc_version - value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | default('4') }}" + value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_host_version | d('4') }}" - name: managed value: "{{ sap_ha_pacemaker_cluster_ibmpower_vm_hmc_system_host_mtms }}" @@ -70,7 +70,7 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # Platform specific VIP handling -sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.hyp_ibmpower_vm | default('ipaddr') }}" +sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_dict.hyp_ibmpower_vm | d('ipaddr') }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 65a47cb23..6c6309f23 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -138,6 +138,6 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: [] __sap_ha_pacemaker_cluster_hana_hook_tkover: false __sap_ha_pacemaker_cluster_hana_hook_chksrv: false -# Enable ASCS/ERS Simple Mount as default +# Central Services Cluster Simple Mount: Enabled as default # TODO: Enable when SAPStartSrv resource agents are available on Red Hat -sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount: false +sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: false diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index 658cb64f9..5fe416c01 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -140,5 +140,5 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: [] sap_ha_pacemaker_cluster_hana_resource_clone_name: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" -# Enable ASCS/ERS Simple Mount as default -sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount: true +# Central Services Cluster Simple Mount: Enabled as default +sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: true From 54c4ed728d74b1b5f6ddcd3f23773da30ffde599 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 28 Oct 2024 16:36:34 +0100 Subject: [PATCH 178/210] sap_swpm: Add support for HA virtual hostname resolution Signed-off-by: Bernd Finger --- roles/sap_swpm/README.md | 6 ++- roles/sap_swpm/defaults/main.yml | 2 +- roles/sap_swpm/tasks/pre_install.yml | 12 +++++ .../assert_hostname_resolution_for_ha.yml | 48 +++++++++++++++++++ 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml diff --git a/roles/sap_swpm/README.md b/roles/sap_swpm/README.md index 04c7360a8..aafa3f751 100644 --- a/roles/sap_swpm/README.md +++ b/roles/sap_swpm/README.md @@ -414,7 +414,9 @@ Define DDIC user password in client 000 for new install, or existing for restore - _Type:_ `string` Define virtual hostname when installing High Available instances (e.g. SAP ASCS/ERS cluster). - +The role attempts to resolve `sap_swpm_virtual_hostname` on the managed node, using DNS and /etc/hosts, and will fail +if this hostname resolution fails. The role will also fail if the IPv4 address for `sap_swpm_virtual_hostname` is +not part of the IPv4 addresses of the managed node. ### Variables specific to SAP HANA Database Installation @@ -856,4 +858,4 @@ Set owner for all non-SAPCAR files in `sap_swpm_software_path` and for SWPM*.SAR - _Default:_ `root` Set group ownership for all non-SAPCAR files in `sap_swpm_software_path` and for SWPM*.SAR files in `sap_swpm_swpm_path`. - \ No newline at end of file + diff --git a/roles/sap_swpm/defaults/main.yml b/roles/sap_swpm/defaults/main.yml index 726342fcd..28913cb74 100644 --- a/roles/sap_swpm/defaults/main.yml +++ b/roles/sap_swpm/defaults/main.yml @@ -241,7 +241,7 @@ sap_swpm_ddic_000_password: # initial = not an HA setup # set this in the input file when installing ascs, ers to indicate an HA setup -sap_swpm_virtual_hostname: "initial" +sap_swpm_virtual_hostname: ######################################## diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 803ad9c96..23bdbfb70 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -147,6 +147,18 @@ # /etc/hosts +- name: SAP SWPM Pre Install - Assert hostname resolution for HA + ansible.builtin.include_tasks: + file: pre_install/assert_hostname_resolution_for_ha.yml + apply: + tags: sap_swpm_update_etchosts + when: + - sap_swpm_run_sapinst + - sap_swpm_update_etchosts + - sap_swpm_virtual_hostname | type_debug != 'NoneType' + - sap_swpm_virtual_hostname | length > 0 + tags: sap_swpm_update_etchosts + - name: SAP SWPM Pre Install - Update /etc/hosts ansible.builtin.include_tasks: file: pre_install/update_etchosts.yml diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml new file mode 100644 index 000000000..af8d26c06 --- /dev/null +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# Assert HA settings + +- name: SAP SWPM Pre Install - HA settings - Ensure the dig command is present + ansible.builtin.package: + name: bind-utils + state: present + +- name: SAP SWPM Pre Install - HA settings - Try to resolve sap_swpm_virtual_hostname from DNS + ansible.builtin.command: dig +short +tries=1 +time=1 "{{ sap_swpm_virtual_hostname }}" + register: __sap_swpm_register_virtual_ip_dns + changed_when: false + failed_when: false + +- name: SAP SWPM Pre Install - HA settings - Assign sap_swpm_virtual_ip from DNS + ansible.builtin.set_fact: + __sap_swpm_fact_virtual_ip: "{{ __sap_swpm_register_virtual_ip_dns.stdout_lines[-1] }}" + when: __sap_swpm_register_virtual_ip_dns.stdout_lines | length > 0 + +- name: SAP SWPM Pre Install - HA settings - Try using /etc/hosts for name resolution + when: __sap_swpm_register_virtual_ip_dns.stdout_lines | length == 0 + block: + + - name: SAP SWPM Pre Install - HA settings - Try to resolve sap_swpm_virtual_hostname from /etc/hosts + ansible.builtin.shell: | + awk '/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/{print $1}' /etc/hosts + register: __sap_swpm_register_virtual_ip_etc_hosts + changed_when: false + failed_when: false + + - name: SAP SWPM Pre Install - HA settings - Assign sap_swpm_virtual_ip from /etc/hosts + ansible.builtin.set_fact: + __sap_swpm_fact_virtual_ip: "{{ __sap_swpm_register_virtual_ip_etc_hosts.stdout_lines[-1] }}" + when: __sap_swpm_register_virtual_ip_etc_hosts.stdout_lines | length > 0 + +- name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_virtual_hostname can be resolved + ansible.builtin.assert: + that: __sap_swpm_fact_virtual_ip | length > 0 + fail_msg: "FAIL: sap_swpm_virtual_hostname cannot be resolved!" + success_msg: "PASS: sap_swpm__virtual_hostname can be resolved." + +- name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses + ansible.builtin.assert: + that: __sap_swpm_fact_virtual_ip in ansible_all_ipv4_addresses + fail_msg: "FAIL: __sap_swpm_fact_virtual_ip is not part of ansible_all_ipv4_addresses!" + success_msg: "PASS: __sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses." From b2f7bc4d15bc5d9d6b28fa3ae06caf3101da3330 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 31 Oct 2024 10:01:51 +0100 Subject: [PATCH 179/210] sap_swpm: remove roles/sap_swpm/requirements.yml This file should only exist on the collection level. Signed-off-by: Bernd Finger --- roles/sap_swpm/requirements.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 roles/sap_swpm/requirements.yml diff --git a/roles/sap_swpm/requirements.yml b/roles/sap_swpm/requirements.yml deleted file mode 100644 index 57520f357..000000000 --- a/roles/sap_swpm/requirements.yml +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- -collections: - - name: https://github.com/ansible-collections/community.general - type: git - version: main From 4b0c1cdaa5411b997cba312a7929a5d12f63318d Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 31 Oct 2024 10:16:35 +0100 Subject: [PATCH 180/210] collection: Specify minimum version for dependent collections Solves issue #883. Signed-off-by: Bernd Finger --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 16eeebcac..b5e6df5ca 100644 --- a/requirements.yml +++ b/requirements.yml @@ -5,5 +5,5 @@ collections: version: '>=1.13.0' type: galaxy - name: community.general - version: latest + version: '>=9.5.0' type: galaxy From aa2b99a7bfdeb4bb762fc7e43d8921b4d93e4cf4 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 4 Nov 2024 11:57:48 +0100 Subject: [PATCH 181/210] collection: Use 9.0.0 for the minimum required community.general version Signed-off-by: Bernd Finger --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index b5e6df5ca..f5fb3c623 100644 --- a/requirements.yml +++ b/requirements.yml @@ -5,5 +5,5 @@ collections: version: '>=1.13.0' type: galaxy - name: community.general - version: '>=9.5.0' + version: '>=9.0.0' type: galaxy From 87188fa09948e4d1819a0b2c5df473ad167dd044 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 4 Nov 2024 13:33:09 +0100 Subject: [PATCH 182/210] sap_swpm: Implement changes requested for virtual IP checks Signed-off-by: Bernd Finger --- .../pre_install/assert_hostname_resolution_for_ha.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml index af8d26c06..87f318978 100644 --- a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -37,12 +37,12 @@ - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_virtual_hostname can be resolved ansible.builtin.assert: - that: __sap_swpm_fact_virtual_ip | length > 0 - fail_msg: "FAIL: sap_swpm_virtual_hostname cannot be resolved!" - success_msg: "PASS: sap_swpm__virtual_hostname can be resolved." + that: __sap_swpm_fact_virtual_ip is defined and __sap_swpm_fact_virtual_ip | length > 0 + fail_msg: "FAIL: {{ sap_swpm_virtual_hostname }} cannot be resolved!" + success_msg: "PASS: {{ sap_swpm_virtual_hostname }} can be resolved." - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses ansible.builtin.assert: that: __sap_swpm_fact_virtual_ip in ansible_all_ipv4_addresses - fail_msg: "FAIL: __sap_swpm_fact_virtual_ip is not part of ansible_all_ipv4_addresses!" - success_msg: "PASS: __sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses." + fail_msg: "FAIL: {{ __sap_swpm_fact_virtual_ip }} is not part of ansible_all_ipv4_addresses!" + success_msg: "PASS: {{ __sap_swpm_fact_virtual_ip }} is part of ansible_all_ipv4_addresses." From 0034767e68579a3687e943ad8c650423e0220ee5 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 4 Nov 2024 13:41:48 +0100 Subject: [PATCH 183/210] sap_swpm: Run the virtual IP checks before the swpm_prepare tasks Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install.yml | 29 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install.yml b/roles/sap_swpm/tasks/pre_install.yml index 23bdbfb70..9d406993f 100644 --- a/roles/sap_swpm/tasks/pre_install.yml +++ b/roles/sap_swpm/tasks/pre_install.yml @@ -119,6 +119,23 @@ sap_swpm_inifile_parameters_dict: "{{ sap_swpm_inifile_parameters_dict | d({}) }}" tags: always +# Assert correct hostname and IP resolution of virtual hostname and IP if: +# - sapinst is requested to be run, and +# - /etc/hosts file is requested to be updated, and +# - sap_swpm_virtual_hostname has been defined + +- name: SAP SWPM Pre Install - Assert hostname resolution for HA + ansible.builtin.include_tasks: + file: pre_install/assert_hostname_resolution_for_ha.yml + apply: + tags: sap_swpm_update_etchosts + when: + - sap_swpm_run_sapinst + - sap_swpm_update_etchosts + - sap_swpm_virtual_hostname | type_debug != 'NoneType' + - sap_swpm_virtual_hostname | length > 0 + tags: sap_swpm_update_etchosts + ################ # Run Preinstallation Steps Based on Run Mode ################ @@ -147,18 +164,6 @@ # /etc/hosts -- name: SAP SWPM Pre Install - Assert hostname resolution for HA - ansible.builtin.include_tasks: - file: pre_install/assert_hostname_resolution_for_ha.yml - apply: - tags: sap_swpm_update_etchosts - when: - - sap_swpm_run_sapinst - - sap_swpm_update_etchosts - - sap_swpm_virtual_hostname | type_debug != 'NoneType' - - sap_swpm_virtual_hostname | length > 0 - tags: sap_swpm_update_etchosts - - name: SAP SWPM Pre Install - Update /etc/hosts ansible.builtin.include_tasks: file: pre_install/update_etchosts.yml From 3508e01fda422fc3003541060221a721a974c5a5 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 4 Nov 2024 14:29:41 +0100 Subject: [PATCH 184/210] sap_swpm: Perform additional assertions for the install type ... and for the presence of sap_swpm_virtual_hostname in case of HA installation types Signed-off-by: Bernd Finger --- .../tasks/pre_install/install_type.yml | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/install_type.yml b/roles/sap_swpm/tasks/pre_install/install_type.yml index 10936a31c..869f90f8b 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type.yml @@ -58,11 +58,41 @@ # Run Installation Type Steps ################ -- name: SAP SWPM Pre Install - Display the Installation Type - ansible.builtin.debug: - msg: "The Installation Type is: '{{ sap_swpm_swpm_installation_type }}'" - when: "sap_swpm_swpm_installation_type | length > 0" +- name: SAP SWPM Pre Install - Assert installation type is defined (including empty) + ansible.builtin.assert: + that: + - sap_swpm_swpm_installation_type is defined + fail_msg: + - "The installation type (variable 'sap_swpm_swpm_installation_type') is not defined!" + success_msg: + - "The installation type (variable 'sap_swpm_swpm_installation_type') is defined (including an empty string)." + +- name: SAP SWPM Pre Install - Assert supported installation types + ansible.builtin.assert: + that: + - sap_swpm_swpm_installation_type == '' or + sap_swpm_swpm_installation_type == 'restore' or + sap_swpm_swpm_installation_type == 'ha' or + sap_swpm_swpm_installation_type == 'maint_plan_stack' or + sap_swpm_swpm_installation_type == 'ha_maint_plan_stack' + fail_msg: + - "The specified installation type, '{{ sap_swpm_swpm_installation_type }}', is not supported!" + - "The following installation types are supported:" + - "- '' (empty string, the default)" + - "- 'restore'" + - "- 'ha'" + - "- 'maint_plan_stack'" + - "- 'ha_maint_plan_stack'" + success_msg: + - "The specified installation type, '{{ sap_swpm_swpm_installation_type }}', is supported." + +- name: SAP SWPM Pre Install - Assert that necessary variable for HA is defined + ansible.builtin.assert: + that: sap_swpm_virtual_hostname is defined and sap_swpm_virtual_hostname + fail_msg: "FAIL: {{ sap_swpm_virtual_hostname }} is not defined!" + success_msg: "PASS: The variable 'sap_swpm_virtual_hostname' is defined, as '{{ sap_swpm_virtual_hostname }}'." + when: + - sap_swpm_swpm_installation_type | regex_search('ha') - name: SAP SWPM Pre Install - Run Installation Type Steps ansible.builtin.include_tasks: "install_type/{{ sap_swpm_swpm_installation_type }}_install.yml" - when: "sap_swpm_swpm_installation_type | length > 0" From 262ca2ed519dd9c646386eb26fc094164aca349c Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 5 Nov 2024 16:09:19 +0100 Subject: [PATCH 185/210] sap_swpm: Do not include the installation type file for default case Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install/install_type.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/sap_swpm/tasks/pre_install/install_type.yml b/roles/sap_swpm/tasks/pre_install/install_type.yml index 869f90f8b..b5afe12f0 100644 --- a/roles/sap_swpm/tasks/pre_install/install_type.yml +++ b/roles/sap_swpm/tasks/pre_install/install_type.yml @@ -94,5 +94,10 @@ when: - sap_swpm_swpm_installation_type | regex_search('ha') +################ +# Installation Type file will not be included if install type is empty (= the default): +################ + - name: SAP SWPM Pre Install - Run Installation Type Steps ansible.builtin.include_tasks: "install_type/{{ sap_swpm_swpm_installation_type }}_install.yml" + when: "sap_swpm_swpm_installation_type | length > 0" From e5f65eba4c114df4f14c3495286b53fb6117df07 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 5 Nov 2024 16:55:06 +0100 Subject: [PATCH 186/210] feat: refactored vars replaced, SCS validated --- .../defaults/main.yml | 21 +- .../tasks/RedHat/post_steps_hana_scaleup.yml | 12 +- .../tasks/Suse/post_steps_hana_scaleup.yml | 12 +- .../Suse/post_steps_nwas_java_scs_ers.yml | 97 +++++ .../tasks/Suse/pre_steps_hana.yml | 3 +- .../tasks/ascertain_sap_landscape.yml | 2 +- ...igure_nwas_abap_ascs_ers_post_install.yml} | 80 ++-- ...nfigure_nwas_java_scs_ers_post_install.yml | 375 ++++++++++++++++++ .../tasks/configure_srhook.yml | 10 +- .../tasks/construct_vars_hana_scaleup.yml | 38 +- .../construct_vars_hana_scaleup_angi.yml | 36 +- ...onstruct_vars_haproxy_constraints_hana.yml | 14 +- .../construct_vars_nwas_abap_ascs_ers.yml | 80 ++-- ...t_vars_nwas_abap_ascs_ers_simple_mount.yml | 58 +-- .../tasks/construct_vars_nwas_common.yml | 30 +- .../construct_vars_nwas_java_scs_ers.yml | 82 ++-- ...ct_vars_nwas_java_scs_ers_simple_mount.yml | 58 +-- .../construct_vars_vip_constraints_hana.yml | 78 ++-- .../tasks/construct_vars_vip_groups.yml | 44 +- .../tasks/include_construct_vip_resources.yml | 77 ++-- .../tasks/include_vars_hana.yml | 118 ++++-- .../tasks/include_vars_nwas.yml | 371 +++++++++-------- roles/sap_ha_pacemaker_cluster/tasks/main.yml | 85 ++-- ...uct_vars_vip_resources_cloud_gcp_ce_vm.yml | 24 +- ...t_vars_vip_resources_cloud_ibmcloud_vs.yml | 24 +- .../platform/preconfigure_cloud_gcp_ce_vm.yml | 10 +- .../preconfigure_cloud_ibmcloud_vs.yml | 10 +- .../tasks/validate_input_parameters.yml | 174 +++----- .../templates/sudofile_20-saphana.j2 | 14 +- roles/sap_ha_pacemaker_cluster/vars/main.yml | 17 - .../vars/nwas_abap_ascs_ers.yml | 8 +- .../vars/nwas_java_scs_ers.yml | 8 +- .../vars/platform_cloud_gcp_ce_vm.yml | 14 +- .../vars/platform_cloud_ibmcloud_vs.yml | 14 +- .../vars/platform_cloud_msazure_vm.yml | 14 +- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 3 +- roles/sap_ha_pacemaker_cluster/vars/suse.yml | 8 +- 37 files changed, 1301 insertions(+), 822 deletions(-) create mode 100644 roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml rename roles/sap_ha_pacemaker_cluster/tasks/{configure_nwas_ascs_ers_postinstallation.yml => configure_nwas_abap_ascs_ers_post_install.yml} (78%) create mode 100644 roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 8e644c952..7fe1cbe00 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -111,7 +111,7 @@ sap_ha_pacemaker_cluster_hana_prefer_site_takeover: true # SAP HANA - Resource IDs (names) as convenience parameters. sap_ha_pacemaker_cluster_hana_resource_name: '' # Default: rsc_SAPHana__HDB sap_ha_pacemaker_cluster_hana_resource_clone_name: '' # Default: cln_SAPHana__HDB -sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: '' # (SUSE Specific) Default: msl_SAPHana__HDB +sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: '' # Default: msl_SAPHana__HDB sap_ha_pacemaker_cluster_hanacontroller_resource_name: '' # Default: rsc_SAPHanaCon__HDB sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: '' # Default: cln_SAPHanaCon__HDB sap_ha_pacemaker_cluster_hana_topology_resource_name: '' # Default: rsc_SAPHanaTop__HDB @@ -160,8 +160,7 @@ sap_ha_pacemaker_cluster_saphanasr_angi_detection: true # Default will be ENSA2. To configure HA resources for ENSA1, # set this parameter to 'true'. -# TODO: Remove backwards compatibility to nwas_abap_ascs -sap_ha_pacemaker_cluster_nwas_cs_ensa1: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 | d(false) }}" +sap_ha_pacemaker_cluster_nwas_cs_ensa1: false # Enable ENSA2 simple mount configuration sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: true @@ -214,11 +213,11 @@ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: '' sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: '' # Default: rsc_vip__AAS sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: '' # Default: rsc_vip_health_check__AAS -# sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: '' -# sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: '' -# sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: '' -# sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: '' -# sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: '' +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: '' +sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: '' +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: '' +sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: '' +sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: '' # SAP NetWeaver common - Resource IDs (names) as convenience parameters # for the following filesystems: @@ -245,8 +244,10 @@ sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed: false ################################################################################ # TODO: Remove backwards compatibility to nwas_abap_ascs -sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: false -sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: 5000 +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | d(false) }}" +sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness | d(5000) }}" sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold | d(1) }}" sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml index 1ec71cf64..9ed648b2e 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/RedHat/post_steps_hana_scaleup.yml @@ -9,16 +9,16 @@ - name: "SAP HA Install Pacemaker - SAPHana pcs resource cleanup" ansible.builtin.command: - cmd: pcs resource cleanup {{ sap_ha_pacemaker_cluster_hana_resource_name + cmd: pcs resource cleanup {{ __sap_ha_pacemaker_cluster_hana_resource_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_name }} + else __sap_ha_pacemaker_cluster_hanacontroller_resource_name }} changed_when: true - name: "SAP HA Install Pacemaker - SAPHana clone pcs resource refresh" ansible.builtin.command: - cmd: pcs resource refresh {{ sap_ha_pacemaker_cluster_hana_resource_clone_name + cmd: pcs resource refresh {{ __sap_ha_pacemaker_cluster_hana_resource_clone_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} + else __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} changed_when: true # Sleep 30 is added to leave enough time for agents to load data from HANA. @@ -30,7 +30,7 @@ - name: "SAP HA Install Pacemaker - SAPHana clone pcs resource meta maintenance=false" ansible.builtin.command: - cmd: pcs resource meta {{ sap_ha_pacemaker_cluster_hana_resource_clone_name + cmd: pcs resource meta {{ __sap_ha_pacemaker_cluster_hana_resource_clone_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} maintenance=false + else __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} maintenance=false changed_when: true diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml index 0efb5b50e..9d9dbf162 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_hana_scaleup.yml @@ -8,16 +8,16 @@ - name: "SAP HA Install Pacemaker - SAPHana crm resource cleanup" ansible.builtin.command: - cmd: crm resource cleanup {{ sap_ha_pacemaker_cluster_hana_resource_name + cmd: crm resource cleanup {{ __sap_ha_pacemaker_cluster_hana_resource_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_name }} + else __sap_ha_pacemaker_cluster_hanacontroller_resource_name }} changed_when: true - name: "SAP HA Install Pacemaker - SAPHana clone crm resource refresh" ansible.builtin.command: - cmd: crm resource refresh {{ sap_ha_pacemaker_cluster_hana_resource_clone_name + cmd: crm resource refresh {{ __sap_ha_pacemaker_cluster_hana_resource_clone_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} + else __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} changed_when: true - name: "SAP HA Install Pacemaker - Wait for SAP HANA to become idle" @@ -27,7 +27,7 @@ - name: "SAP HA Install Pacemaker - SAPHana crm resource maintenance off" ansible.builtin.command: - cmd: crm resource maintenance {{ sap_ha_pacemaker_cluster_hana_resource_clone_name + cmd: crm resource maintenance {{ __sap_ha_pacemaker_cluster_hana_resource_clone_name if not __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} off + else __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }} off changed_when: true diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml new file mode 100644 index 000000000..695e937d1 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# Recent crmsh changes have added default behavior, where all default metadata +# op parameters are added and it cannot be controlled. Not adding them during +# creation, will forcefully add them regardless. + +# Following steps are similar to crmsh code in ha_cluster role, but they are +# too SAP specific, so they are added here instead of there. + +# Python3-pip and pexpect are required for ansible.builtin.expect +# Python installation was removed from sap_swpm role in PR#720 +- name: "SAP HA Install Pacemaker - Install required python3-pip" + ansible.builtin.package: + name: + - python3-pip + state: present + +- name: "SAP HA Install Pacemaker - Install required pip pexpect" + ansible.builtin.pip: + name: + - pexpect + +- name: Block to ensure that changes are executed only once + run_once: true # noqa: run_once[task] + block: + + - name: "SAP HA Install Pacemaker - Create file for CIB backup" + ansible.builtin.tempfile: + state: file + suffix: _sap_ha_pacemaker_cluster_cib_xml_backup + register: __sap_ha_pacemaker_cluster_cib_xml_backup + + - name: "SAP HA Install Pacemaker - Put cluster in maintenance mode" + ansible.builtin.expect: + command: crm configure property maintenance-mode=true + responses: + ".*is-managed.*": "n" + ".*already.*": "n" + check_mode: false + changed_when: true + + - name: "SAP HA Install Pacemaker - Verify that maintenance-mode is true" + ansible.builtin.command: + cmd: crm status + register: __sap_ha_pacemaker_cluster_crm_status_maint + retries: 10 + delay: 5 + until: + '"Resource management is DISABLED" in __sap_ha_pacemaker_cluster_crm_status_maint.stdout' + check_mode: false + changed_when: false + run_once: true # noqa: run_once[task] + + - name: "SAP HA Install Pacemaker - Fetch CIB configuration" + ansible.builtin.command: + cmd: cibadmin --query + register: __sap_ha_pacemaker_cluster_cib_query + check_mode: false + changed_when: false + + - name: "SAP HA Install Pacemaker - Save CIB configuration" + ansible.builtin.copy: + content: "{{ __sap_ha_pacemaker_cluster_cib_query.stdout }}" + dest: "{{ __sap_ha_pacemaker_cluster_cib_xml_backup.path }}" + owner: root + group: root + mode: '0600' + check_mode: false + + # SAPStartSrv - Remove monitor, start, stop operations from SAPStartSrv + # These operations are not supported and not recommended. + # TODO: Limit deletion in future, when more supported is added in Resource Agent + - name: "SAP HA Install Pacemaker - Remove operations for SAPStartSrv" + ansible.builtin.command: + cmd: cibadmin -d --force --xpath "//primitive[@type='SAPStartSrv']//operations" + when: sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + changed_when: true + + # SAPInstance - Remove default operations: promote, demote, start, stop + - name: "SAP HA Install Pacemaker - Remove operations for SAPInstance" + ansible.builtin.command: + cmd: cibadmin -d --force --xpath "//primitive[@type='SAPInstance']//op[{{ item }}]" + loop: + - "@name='promote' and @interval='0s'" + - "@name='demote' and @interval='0s'" + - "@name='start' and @interval='0s'" + - "@name='stop' and @interval='0s'" + changed_when: true + + - name: "SAP HA Install Pacemaker - Disable maintenance mode" + ansible.builtin.expect: + command: crm configure property maintenance-mode=false + responses: + ".*is-managed.*": "n" + ".*already.*": "n" + check_mode: false + changed_when: true diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml index 080839e8c..6f6d031e2 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/pre_steps_hana.yml @@ -7,7 +7,7 @@ # without proper migration from SAPHanaSR to SAPHanaSR-angi! - name: "SAP HA Prepare Pacemaker - Block for detection of SAPHanaSR-angi" - when: sap_ha_pacemaker_cluster_saphanasr_angi_detection + when: (sap_ha_pacemaker_cluster_saphanasr_angi_detection | bool) block: # Requirement for package_facts Ansible Module # SLES: Ensure OS Package for Python Lib of rpm bindings is enabled for System Python @@ -15,7 +15,6 @@ ansible.builtin.package: name: python3-rpm state: present - when: ansible_os_family == "Suse" - name: "SAP HA Prepare Pacemaker - Gather installed packages facts" ansible.builtin.package_facts: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml b/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml index eec0d36c5..26cdb2be4 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/ascertain_sap_landscape.yml @@ -36,7 +36,7 @@ ansible.builtin.include_tasks: file: include_vars_hana.yml when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 - name: "SAP HA Prepare Pacemaker - Include NETWEAVER specific variables" ansible.builtin.include_tasks: diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml similarity index 78% rename from roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml rename to roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml index 478fe11ef..e65f4d2f2 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_ascs_ers_postinstallation.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml @@ -6,7 +6,7 @@ - name: "SAP HA Pacemaker - (ASCS profile) Prevent automatic restart of enqueue server" ansible.builtin.replace: - path: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" + path: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" backup: true regexp: 'Restart_Program_01' replace: 'Start_Program_01' @@ -17,7 +17,7 @@ - name: "SAP HA Pacemaker - (ERS profile) Prevent automatic restart" ansible.builtin.replace: - path: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + path: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" backup: true regexp: 'Restart_Program_00' replace: 'Start_Program_00' @@ -36,20 +36,20 @@ regexp: '^([^#\n].+{{ sapserv_item }}.+)$' replace: '# \1' loop: - - "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" loop_control: loop_var: sapserv_item - name: "SAP HA Pacemaker - (systemd) Check for ASCS/ERS services" ansible.builtin.stat: - path: "/etc/systemd/system/SAP{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" loop: - - "{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" loop_control: loop_var: systemd_item - label: "SAP{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" register: __sap_ha_pacemaker_cluster_register_instance_service - name: "SAP HA Pacemaker - (systemd) Save found ASCS/ERS services" @@ -117,10 +117,10 @@ - sap_ha_pacemaker_cluster_enable_cluster_connector block: - - name: "SAP HA Pacemaker - (SAP HA Interface) Add {{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm + - name: "SAP HA Pacemaker - (SAP HA Interface) Add {{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm user to 'haclient' group" # noqa name[template] ansible.builtin.user: - name: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + name: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" groups: haclient append: true state: present @@ -145,19 +145,19 @@ # Sleep added to resolve issue with WaitforStarted finishing before resources are available. - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ASCS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ascs ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ers ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false @@ -167,20 +167,20 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_restart_ascs ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function RestartService + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function RestartService changed_when: __sap_ha_pacemaker_cluster_register_restart_ascs.rc == 0 - name: "SAP HA Pacemaker - (SAP HA Interface) Restart the ERS service" when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_restart_ers ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function RestartService + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function RestartService changed_when: __sap_ha_pacemaker_cluster_register_restart_ers.rc == 0 @@ -188,21 +188,21 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config ansible.builtin.shell: | sleep 10 - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig changed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for ERS" when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig changed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Display HAGetFailoverConfig results" @@ -218,10 +218,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_check_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig changed_when: false failed_when: false @@ -245,12 +245,12 @@ or (__sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout is defined and 'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout)" vars: - __rsc_ascs: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name + __rsc_ascs: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" - __rsc_ers: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name + else __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + __rsc_ers: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + else __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" block: - name: "SAP HA Pacemaker - (SAP HA Interface) Restart ASCS ERS resources" ansible.builtin.shell: | @@ -266,19 +266,19 @@ - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ASCS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ascs_restart ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_where_ers_restart ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 changed_when: false failed_when: false @@ -293,11 +293,11 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_check_config ansible.builtin.shell: | sleep 30 - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HACheckConfig changed_when: false failed_when: - "'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout" @@ -306,10 +306,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_check_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HACheckConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HACheckConfig changed_when: false failed_when: - "'ERROR' in __sap_ha_pacemaker_cluster_register_ers_ha_check_config.stdout" @@ -319,10 +319,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ascs.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }} -function HAGetFailoverConfig changed_when: false # failed_when: # - __sap_ha_pacemaker_cluster_register_ascs_ha_failover_config.stdout is defined @@ -332,10 +332,10 @@ when: - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 become: true - become_user: "{{ sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config ansible.builtin.shell: | - /usr/sap/hostctrl/exe/sapcontrol -nr {{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig changed_when: false # failed_when: # - __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout is defined diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml new file mode 100644 index 000000000..175119218 --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml @@ -0,0 +1,375 @@ +# SPDX-License-Identifier: Apache-2.0 +--- +# After NetWeaver SCS/ERS instances were configured in the cluster, +# they must be disabled from automatically (re)starting outside of +# cluster control. + +- name: "SAP HA Pacemaker - (SCS profile) Prevent automatic restart of enqueue server" + ansible.builtin.replace: + path: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + backup: true + regexp: 'Restart_Program_01' + replace: 'Start_Program_01' + # Throttle and retry loop was added to combat NFS write lockups on Azure NFS + throttle: 1 + retries: 30 + delay: 10 + +- name: "SAP HA Pacemaker - (ERS profile) Prevent automatic restart" + ansible.builtin.replace: + path: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + backup: true + regexp: 'Restart_Program_00' + replace: 'Start_Program_00' + # Throttle and retry loop was added to combat NFS write lockups on Azure NFS + throttle: 1 + retries: 30 + delay: 10 + +# Comment out lines in /usr/sap/sapservices, which +# - contain the target instance profile names +# - are not commented out yet +- name: "SAP HA Pacemaker - Update /usr/sap/sapservices" + ansible.builtin.replace: + path: /usr/sap/sapservices + backup: true + regexp: '^([^#\n].+{{ sapserv_item }}.+)$' + replace: '# \1' + loop: + - "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + loop_control: + loop_var: sapserv_item + +- name: "SAP HA Pacemaker - (systemd) Check for SCS/ERS services" + ansible.builtin.stat: + path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + loop: + - "{{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + loop_control: + loop_var: systemd_item + label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + register: __sap_ha_pacemaker_cluster_register_instance_service + +- name: "SAP HA Pacemaker - (systemd) Save found SCS/ERS services" + ansible.builtin.set_fact: + sap_ha_pacemaker_cluster_instance_services_fact: "{{ + __sap_ha_pacemaker_cluster_register_instance_service.results + | selectattr('stat.exists') + | map(attribute='stat.path') + | regex_replace('/etc/systemd/system/', '') + }}" + +# BLOCK: +# When the systemd based SAP startup framework is used, make sure that the +# instance services do not auto-start. +- name: "SAP HA Pacemaker - Block to disable systemd auto-start of instances" + when: + - sap_ha_pacemaker_cluster_instance_services_fact is defined + - sap_ha_pacemaker_cluster_instance_services_fact | length > 0 + block: + + - name: "SAP HA Pacemaker - (systemd) Disable SCS/ERS instance service" + ansible.builtin.service: + name: "{{ instance_srv_item }}" + enabled: false + loop: "{{ sap_ha_pacemaker_cluster_instance_services_fact }}" + loop_control: + loop_var: instance_srv_item + + # Creates a config file for the services. + # Parent directories will be created when missing. + - name: "SAP HA Pacemaker - (systemd) Create SCS/ERS instance unit config file" + ansible.builtin.lineinfile: + create: true + path: "/etc/systemd/system/{{ dropfile_item }}.d/HA.conf" + line: "[Service]" + owner: root + group: root + mode: '0644' + loop: "{{ sap_ha_pacemaker_cluster_instance_services_fact }}" + loop_control: + loop_var: dropfile_item + + - name: "SAP HA Pacemaker - (systemd) Disable SCS/ERS instance unit auto-restart" + ansible.builtin.lineinfile: + path: "/etc/systemd/system/{{ dropfile_item }}.d/HA.conf" + regex: '^Restart\s*=\s*no' + insertafter: '^[Service]$' + line: "Restart=no" + owner: root + group: root + mode: '0644' + loop: "{{ sap_ha_pacemaker_cluster_instance_services_fact }}" + loop_control: + loop_var: dropfile_item + +### END of BLOCK for systemd setup. + + +# Block for configuring the SAP HA Interface (sap_cluster_connector). +# +# The 'sap-cluster-connector' package is already optionally added to +# '__sap_ha_pacemaker_cluster_sap_extra_packages'. +- name: "SAP HA Pacemaker - (SAP HA Interface) Configure SAP HA Interface" + when: + - sap_ha_pacemaker_cluster_enable_cluster_connector + block: + + - name: "SAP HA Pacemaker - (SAP HA Interface) Add {{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm + user to 'haclient' group" # noqa name[template] + ansible.builtin.user: + name: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + groups: haclient + append: true + state: present + + # Using 'lineinfile' with a nested loop to avoid duplicate entries for existing configuration. + - name: "SAP HA Pacemaker - (SAP HA Interface) Add connector to start profiles" + ansible.builtin.lineinfile: + backup: true + path: "{{ nwas_profile_item.0 }}" + line: "{{ nwas_profile_item.1 }}" + loop: "{{ __sap_ha_pacemaker_cluster_nwas_scs_ers_profile_paths + | product(__sap_ha_pacemaker_cluster_connector_config_lines) + }}" + loop_control: + loop_var: nwas_profile_item + label: "{{ nwas_profile_item.0 }} -> {{ nwas_profile_item.1 }}" + # Throttle and retry loop was added to combat NFS write lockups on Azure NFS + throttle: 1 + retries: 30 + delay: 10 + + # Sleep added to resolve issue with WaitforStarted finishing before resources are available. + - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for SCS to be up and running" + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_where_scs + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function WaitforStarted 600 30 + changed_when: false + failed_when: false + + - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_where_ers + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 + changed_when: false + failed_when: false + + # NOTE: RestartService can cause fencing lockup and hang forever, + # it might be good to remove them in future and leave reload to "SCS ERS restart" block. + - name: "SAP HA Pacemaker - (SAP HA Interface) Restart the SCS service" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_restart_scs + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function RestartService + changed_when: __sap_ha_pacemaker_cluster_register_restart_scs.rc == 0 + + - name: "SAP HA Pacemaker - (SAP HA Interface) Restart the ERS service" + when: + - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_restart_ers + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function RestartService + changed_when: __sap_ha_pacemaker_cluster_register_restart_ers.rc == 0 + + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for SCS" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_scs_ha_failover_config + ansible.builtin.shell: | + sleep 10 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function HAGetFailoverConfig + changed_when: false + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for ERS" + when: + - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig + changed_when: false + + - name: "SAP HA Pacemaker - (SAP HA Interface) Display HAGetFailoverConfig results" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + - __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout_lines is defined + ansible.builtin.debug: + msg: | + {{ __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout_lines }} + + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HACheckConfig for SCS" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_scs_ha_check_config + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function HACheckConfig + changed_when: false + failed_when: false + + - name: "SAP HA Pacemaker - (SAP HA Interface) Display HACheckConfig results" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + - __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout_lines is defined + ansible.builtin.debug: + msg: | + {{ __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout_lines }} + + + # Block to restart cluster resources if RestartService is not enough. + # This is required for SUSE, where SAP needs full restart to load HAlib. + - name: "SAP HA Pacemaker - (SAP HA Interface) Block for SCS ERS restart" + when: + - "(__sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout is defined + and 'FALSE' in __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout) + or (__sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout is defined + and 'FALSE' in __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout) + or (__sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout is defined + and 'ERROR' in __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout)" + vars: + __rsc_scs: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + else __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + __rsc_ers: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name + if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + else __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + block: + - name: "SAP HA Pacemaker - (SAP HA Interface) Restart SCS ERS resources" + ansible.builtin.shell: | + {{ __sap_ha_pacemaker_cluster_command.resource_restart }} {{ restart_item }} + loop: + - "{{ __rsc_scs }}" + - "{{ __rsc_ers }}" + loop_control: + loop_var: restart_item + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + changed_when: true + + - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for SCS to be up and running" + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_where_scs_restart + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function WaitforStarted 600 30 + changed_when: false + failed_when: false + + - name: "SAP HA Pacemaker - (SAP HA Interface) Wait for ERS to be up and running" + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_where_ers_restart + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function WaitforStarted 600 30 + changed_when: false + failed_when: false + + # Ensure there are no errors after resources were restarted + - name: "SAP HA Install Pacemaker - Cluster resource cleanup after restart" + ansible.builtin.shell: | + {{ __sap_ha_pacemaker_cluster_command.resource_cleanup }} + changed_when: true + + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HACheckConfig for SCS" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_scs_ha_check_config + ansible.builtin.shell: | + sleep 30 + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function HACheckConfig + changed_when: false + failed_when: + - "'ERROR' in __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout" + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HACheckConfig for ERS" + when: + - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_ers_ha_check_config + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HACheckConfig + changed_when: false + failed_when: + - "'ERROR' in __sap_ha_pacemaker_cluster_register_ers_ha_check_config.stdout" + + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for SCS" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_scs_ha_failover_config + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }} -function HAGetFailoverConfig + changed_when: false + # failed_when: + # - __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout is defined + # and 'FALSE' in __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout + + - name: "SAP HA Pacemaker - (SAP HA Interface) Get HAGetFailoverConfig for ERS" + when: + - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 + become: true + become_user: "{{ __sap_ha_pacemaker_cluster_nwas_sid | lower }}adm" + register: __sap_ha_pacemaker_cluster_register_ers_ha_failover_config + ansible.builtin.shell: | + /usr/sap/hostctrl/exe/sapcontrol -nr {{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }} -function HAGetFailoverConfig + changed_when: false + # failed_when: + # - __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout is defined + # and 'FALSE' in __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout + + + # HAGetFailoverConfig is not consistent and it can show FALSE on one of nodes + - name: "SAP HA Pacemaker - (SAP HA Interface) Display HAGetFailoverConfig results on SCS" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + - __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout_lines is defined + ansible.builtin.debug: + msg: | + {{ __sap_ha_pacemaker_cluster_register_scs_ha_failover_config.stdout_lines }} + + # HAGetFailoverConfig is not consistent and it can show FALSE on one of nodes + - name: "SAP HA Pacemaker - (SAP HA Interface) Display HAGetFailoverConfig results on ERS" + when: + - __sap_ha_pacemaker_cluster_register_where_ers.rc == 0 + - __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout_lines is defined + ansible.builtin.debug: + msg: | + {{ __sap_ha_pacemaker_cluster_register_ers_ha_failover_config.stdout_lines }} + + # HACheckConfig shows same statues on both nodes, therefore only SCS is shown + - name: "SAP HA Pacemaker - (SAP HA Interface) Display HACheckConfig results" + when: + - __sap_ha_pacemaker_cluster_register_where_scs.rc == 0 + - __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout_lines is defined + ansible.builtin.debug: + msg: | + {{ __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout_lines }} + + + # TODO: verification checks that the instances are running and HA Interface is enabled + +### END of BLOCK for sap_cluster_connector. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml index 94a4f86fa..aac210639 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_srhook.yml @@ -2,13 +2,13 @@ --- - name: "SAP HA Pacemaker srHook - Check presence of global.ini" ansible.builtin.stat: - path: "{{ sap_ha_pacemaker_cluster_hana_global_ini_path }}" + path: "{{ __sap_ha_pacemaker_cluster_hana_global_ini_path }}" register: __sap_ha_pacemaker_cluster_global_ini failed_when: not __sap_ha_pacemaker_cluster_global_ini.stat.exists - name: "SAP HA Pacemaker srHook - Get contents of global.ini" ansible.builtin.command: - cmd: cat "{{ sap_ha_pacemaker_cluster_hana_global_ini_path }}" + cmd: cat "{{ __sap_ha_pacemaker_cluster_hana_global_ini_path }}" register: __sap_ha_pacemaker_cluster_global_ini_contents changed_when: false @@ -42,7 +42,7 @@ - name: "SAP HA Pacemaker srHook - Update srHook providers in global.ini" ansible.builtin.blockinfile: - path: "{{ sap_ha_pacemaker_cluster_hana_global_ini_path }}" + path: "{{ __sap_ha_pacemaker_cluster_hana_global_ini_path }}" marker: "" block: | [ha_dr_provider_{{ srhook_item.provider }}] @@ -61,7 +61,7 @@ # Separate task to create [trace] block so hooks can be appended to it - name: "SAP HA Pacemaker srHook - Add [trace] block in global.ini" ansible.builtin.blockinfile: - path: "{{ sap_ha_pacemaker_cluster_hana_global_ini_path }}" + path: "{{ __sap_ha_pacemaker_cluster_hana_global_ini_path }}" marker: "" block: | [trace] @@ -71,7 +71,7 @@ # Append hooks to [trace] block if they are not present already - name: "SAP HA Pacemaker srHook - Update srHooks trace in global.ini" ansible.builtin.lineinfile: - path: "{{ sap_ha_pacemaker_cluster_hana_global_ini_path }}" + path: "{{ __sap_ha_pacemaker_cluster_hana_global_ini_path }}" insertafter: "^\\[trace\\]" line: "ha_dr_{{ srhook_item.provider }} = info" loop: "{{ __sap_ha_pacemaker_cluster_hana_hooks }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml index 2cfd1fab5..46e15c6eb 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup.yml @@ -5,14 +5,14 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_hana_topology] }}" vars: __resource_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.saphanatopology }}" instance_attrs: - attrs: - name: SID - value: "{{ sap_ha_pacemaker_cluster_hana_sid }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_sid }}" - name: InstanceNumber - value: "{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" operations: - action: start attrs: @@ -37,14 +37,14 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_hana] }}" vars: __resource_hana: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.saphana }}" instance_attrs: - attrs: - name: SID - value: "{{ sap_ha_pacemaker_cluster_hana_sid }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_sid }}" - name: InstanceNumber - value: "{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" - name: AUTOMATED_REGISTER value: "{{ sap_ha_pacemaker_cluster_hana_automated_register | string }}" - name: DUPLICATE_PRIMARY_TIMEOUT @@ -98,8 +98,8 @@ __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana_topology] }}" vars: __clone_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_name }}" meta_attrs: - attrs: - name: clone-max @@ -111,6 +111,13 @@ when: - __clone_hana_topology.resource_id not in (__sap_ha_pacemaker_cluster_resource_clones | map(attribute='resource_id')) +# (SUSE Specific) Change SAP HANA Clone name to MSL +- name: "SAP HA Prepare Pacemaker - Define SAP HANA MSL Clone name" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_hana_resource_clone_name: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" + when: + - ansible_os_family == 'Suse' + - name: "SAP HA Prepare Pacemaker - Add resource clone: SAP HANA DB" ansible.builtin.set_fact: @@ -118,8 +125,8 @@ "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana] }}" vars: __clone_hana: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hana_resource_name }}" meta_attrs: - attrs: - name: clone-max @@ -143,8 +150,8 @@ "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana] }}" vars: __clone_hana: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hana_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hana_resource_name }}" meta_attrs: - attrs: - name: clone-max @@ -169,14 +176,13 @@ "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_hana_topology] }}" vars: __constraint_order_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_order_topology_hana_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_order_topology_hana_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" action: start resource_then: # SUSE SAPHanaSR is using Master Slave clone using Master/Slave roles - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name - if ansible_os_family != 'Suse' else sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" action: start options: - name: symmetrical diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml index 479475806..109535268 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_hana_scaleup_angi.yml @@ -5,14 +5,14 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_hana_topology] }}" vars: __resource_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.saphanatopology }}" instance_attrs: - attrs: - name: SID - value: "{{ sap_ha_pacemaker_cluster_hana_sid }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_sid }}" - name: InstanceNumber - value: "{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" operations: - action: start attrs: @@ -37,14 +37,14 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_hana] }}" vars: __resource_hana: - id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.saphanacontroller }}" instance_attrs: - attrs: - name: SID - value: "{{ sap_ha_pacemaker_cluster_hana_sid }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_sid }}" - name: InstanceNumber - value: "{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" - name: AUTOMATED_REGISTER value: "{{ sap_ha_pacemaker_cluster_hana_automated_register | string }}" - name: DUPLICATE_PRIMARY_TIMEOUT @@ -97,14 +97,14 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_hana_filesystem] }}" vars: __resource_hana_filesystem: - id: "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_filesystem_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.saphanafilesystem }}" instance_attrs: - attrs: - name: SID - value: "{{ sap_ha_pacemaker_cluster_hana_sid }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_sid }}" - name: InstanceNumber - value: "{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" + value: "{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" - name: ON_FAIL_ACTION value: fence operations: @@ -135,8 +135,8 @@ __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana_topology] }}" vars: __clone_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_name }}" meta_attrs: - attrs: - name: clone-max @@ -155,8 +155,8 @@ "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana] }}" vars: __clone_hana: - id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_name }}" meta_attrs: - attrs: - name: clone-max @@ -177,8 +177,8 @@ __sap_ha_pacemaker_cluster_resource_clones: "{{ __sap_ha_pacemaker_cluster_resource_clones + [__clone_hana_filesystem] }}" vars: __clone_hana_filesystem: - id: "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name }}" - resource_id: "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name }}" + resource_id: "{{ __sap_ha_pacemaker_cluster_hana_filesystem_resource_name }}" meta_attrs: - attrs: - name: clone-node-max @@ -195,12 +195,12 @@ "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_hana_topology] }}" vars: __constraint_order_hana_topology: - id: "{{ sap_ha_pacemaker_cluster_hana_order_topology_hana_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_order_topology_hana_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" action: start resource_then: - id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}" action: start options: - name: symmetrical diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml index e3b235b35..ac93121a1 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_haproxy_constraints_hana.yml @@ -9,7 +9,7 @@ vars: __constraint_order_haproxy: resource_first: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" action: promote resource_then: id: "{{ vip_list_item.key }}" @@ -24,10 +24,10 @@ vars: __constraint_colo_haproxy: resource_leader: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" role: promoted resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" options: - name: score value: "{{ sap_ha_pacemaker_cluster_constraint_colo_base_score }}" @@ -41,14 +41,14 @@ vars: __constraint_colo_haproxy: resource_leader: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" role: unpromoted resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" options: - name: score value: "{{ sap_ha_pacemaker_cluster_constraint_colo_base_score }}" when: - __constraint_colo_haproxy.resource_follower not in (__sap_ha_pacemaker_cluster_constraints_colocation | map(attribute='resource_follower')) - - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address is defined - - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address != '' + - __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address != '' diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml index 059e7f2de..71e5e6aa0 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml @@ -2,28 +2,28 @@ --- ### Different SAPInstance resource attributes for ENSA1 and ENSA2 - name: "SAP HA Prepare Pacemaker - Define default ASCS/ERS instance attributes (ENSA2)" - when: not sap_ha_pacemaker_cluster_nwas_cs_ensa1 + when: not __sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: "SAP HA Prepare Pacemaker - Define ASCS/ERS instance attributes (ENSA1)" - when: sap_ha_pacemaker_cluster_nwas_cs_ensa1 + when: __sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" - name: migration-threshold value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold }}" - name: failure-timeout @@ -31,11 +31,11 @@ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true @@ -49,9 +49,9 @@ __resource_filesystem: id: |- {%- if '/ASCS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name %} {%- elif '/ERS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} {%- endif -%} {{ idname }} agent: "ocf:heartbeat:Filesystem" @@ -146,16 +146,16 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" meta_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_meta_attrs }}" operations: @@ -189,7 +189,7 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs }}" @@ -228,14 +228,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ascs_group] }}" vars: __ascs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, - sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, + __sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name, + __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -260,14 +260,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -292,12 +292,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" vars: __constraint_colo_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -310,12 +310,12 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_ascs_ers] }}" vars: __constraint_order_ascs_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" @@ -331,13 +331,13 @@ vars: __constraint_location_ascs_ers: resource: - id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" - rule: "runs_ers_{{ sap_ha_pacemaker_cluster_nwas_sid }} eq 1" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + rule: "runs_ers_{{ __sap_ha_pacemaker_cluster_nwas_sid }} eq 1" options: - name: score value: 2000 when: - - sap_ha_pacemaker_cluster_nwas_cs_ensa1 + - __sap_ha_pacemaker_cluster_nwas_cs_ensa1 # When /sapmnt is managed by the cluster, @@ -348,10 +348,10 @@ vars: __constraint_order_sapmnt: resource_first: - id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed @@ -361,9 +361,9 @@ vars: __constraint_order_sapmnt: resource_first: - id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml index a86dd0526..22b0878e2 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers_simple_mount.yml @@ -9,12 +9,12 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) @@ -24,12 +24,12 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) @@ -40,22 +40,22 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" - name: MINIMAL_PROBE value: true meta_attrs: - attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" operations: # TODO: Add values for start and stop when they are published. - action: monitor @@ -76,16 +76,16 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: MINIMAL_PROBE @@ -114,14 +114,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ascs_group] }}" vars: __ascs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, - sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name, + __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name, + __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -145,14 +145,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -177,12 +177,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" vars: __constraint_colo_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -195,12 +195,12 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_ascs_ers] }}" vars: __constraint_order_ascs_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 5a42064e5..8ed64fee3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -78,11 +78,11 @@ __resource_filesystem: id: |- {%- if '/sapmnt' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} + {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -125,13 +125,13 @@ __nfs_server: "{{ commonfs_item.nfs_server | d(sap_ha_pacemaker_cluster_storage_nfs_server) | regex_replace('/$', '') }}" __nfs_path: |- {%- if '/usr/sap' in commonfs_item.nfs_path and '/usr/sap/trans' not in commonfs_item.nfs_path -%} - {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }} {%- endif %} __mountpoint: |- {%- if commonfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfs_item.mountpoint | regex_replace('/$', '') }} {%- endif %} @@ -159,19 +159,19 @@ __clone_common_filesystem: id: |- {%- if '/sapmnt' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} + {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} + {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- {%- if '/sapmnt' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} + {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} - {{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} + {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: - attrs: @@ -180,7 +180,7 @@ __mountpoint: |- {%- if commonfsclone_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS {%- else -%} {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }} {%- endif %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml index ce1b35ce9..791a0f198 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml @@ -2,28 +2,28 @@ --- ### Different SAPInstance resource attributes for ENSA1 and ENSA2 - name: "SAP HA Prepare Pacemaker - Define default SCS/ERS instance attributes (ENSA2)" - when: not sap_ha_pacemaker_cluster_nwas_cs_ensa1 + when: not __sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: "SAP HA Prepare Pacemaker - Define SCS/ERS instance attributes (ENSA1)" - when: sap_ha_pacemaker_cluster_nwas_cs_ensa1 + when: __sap_ha_pacemaker_cluster_nwas_cs_ensa1 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" - name: migration-threshold value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold }}" - name: failure-timeout @@ -31,11 +31,11 @@ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true @@ -50,9 +50,9 @@ __resource_filesystem: id: |- {%- if '/SCS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name %} {%- elif '/ERS' in __mountpoint -%} - {% set idname = sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} + {% set idname = __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name %} {%- endif -%} {{ idname }} agent: "ocf:heartbeat:Filesystem" @@ -147,16 +147,16 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" meta_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_meta_attrs }}" operations: @@ -190,7 +190,7 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_attrs }}" @@ -229,15 +229,15 @@ ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__scs_group] }}" vars: - __acs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + __scs_group: + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, - sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, + __sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name, + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -262,14 +262,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -294,12 +294,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" vars: __constraint_colo_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -312,12 +312,12 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_scs_ers] }}" vars: __constraint_order_scs_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" @@ -333,13 +333,13 @@ vars: __constraint_location_scs_ers: resource: - id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" - rule: "runs_ers_{{ sap_ha_pacemaker_cluster_nwas_sid }} eq 1" + id: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + rule: "runs_ers_{{ __sap_ha_pacemaker_cluster_nwas_sid }} eq 1" options: - name: score value: 2000 when: - - sap_ha_pacemaker_cluster_nwas_cs_ensa1 + - __sap_ha_pacemaker_cluster_nwas_cs_ensa1 # When /sapmnt is managed by the cluster, @@ -350,10 +350,10 @@ vars: __constraint_order_sapmnt: resource_first: - id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed @@ -363,9 +363,9 @@ vars: __constraint_order_sapmnt: resource_first: - id: "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" when: - sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml index a69ac19b9..7b95d59f0 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers_simple_mount.yml @@ -9,12 +9,12 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) @@ -24,12 +24,12 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapstartsrv] }}" vars: __resource_sapstartsrv: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" agent: "{{ __sap_ha_pacemaker_cluster_resource_agents.sapstartsrv }}" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" when: - __resource_sapstartsrv.id not in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) @@ -40,22 +40,22 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance] }}" vars: __resource_sapinstance: - id: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | string }}" - name: MINIMAL_PROBE value: true meta_attrs: - attrs: - name: resource-stickiness - value: "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" operations: # TODO: Add values for start and stop when they are published. - action: monitor @@ -76,16 +76,16 @@ __sap_ha_pacemaker_cluster_resource_primitives: "{{ __sap_ha_pacemaker_cluster_resource_primitives + [__resource_sapinstance_ers] }}" vars: __resource_sapinstance_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" agent: "ocf:heartbeat:SAPInstance" instance_attrs: - attrs: - name: InstanceName - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - name: START_PROFILE - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: AUTOMATIC_RECOVER - value: "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" + value: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | string }}" - name: IS_ERS value: true - name: MINIMAL_PROBE @@ -114,14 +114,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__scs_group] }}" vars: __scs_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, - sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name, + __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name, + __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -145,14 +145,14 @@ __sap_ha_pacemaker_cluster_resource_groups: "{{ __sap_ha_pacemaker_cluster_resource_groups + [__ers_group] }}" vars: __ers_group: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" resource_ids: | {% set resource_ids_list = [] %} {%- for resource in - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name, + __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name, + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name %} {%- if resource | length > 0 and resource in (__sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id')) %} {%- set ids = resource_ids_list.append(resource) %} @@ -177,12 +177,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_ers] }}" vars: __constraint_colo_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" resource_leader: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" role: started resource_follower: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: score value: -5000 @@ -195,12 +195,12 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_scs_ers] }}" vars: __constraint_order_scs_ers: - id: "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" + id: "{{ __sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" role: started resource_then: - id: "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" + id: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" options: - name: symmetrical value: "false" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml index bf3fd7a7a..5c1681fad 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_constraints_hana.yml @@ -7,9 +7,9 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_vip] }}" vars: __constraint_order_vip: - id: "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" action: promote resource_then: id: "{{ __res_or_grp }}" @@ -23,14 +23,14 @@ __res_or_grp: |- {% if sap_ha_pacemaker_cluster_vip_group_prefix | length > 0 and __sap_ha_pacemaker_cluster_resource_groups | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} + | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} + {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }} {%- else -%} none_found {%- endif -%} @@ -46,9 +46,9 @@ __sap_ha_pacemaker_cluster_constraints_order: "{{ __sap_ha_pacemaker_cluster_constraints_order + [__constraint_order_vip] }}" vars: __constraint_order_vip: - id: "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name }}" resource_first: - id: "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" action: start resource_then: id: "{{ __res_or_grp }}" @@ -62,14 +62,14 @@ __res_or_grp: |- {% if sap_ha_pacemaker_cluster_vip_group_prefix | length > 0 and __sap_ha_pacemaker_cluster_resource_groups | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} + | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} + {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }} {%- else -%} none_found {%- endif -%} @@ -86,11 +86,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_vip] }}" vars: __constraint_colo_vip: - id: "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name }}" resource_leader: # SAPHana is replaced by SAP HANA Controller for SAPHanaSR-angi - id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name if __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name + if __sap_ha_pacemaker_cluster_saphanasr_angi_available + else __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" # SUSE SAPHanaSR is using Master Slave clone using Master/Slave roles role: "{{ 'master' if ansible_os_family == 'Suse' and not __sap_ha_pacemaker_cluster_saphanasr_angi_available else 'promoted' }}" @@ -110,14 +111,14 @@ __res_or_grp: |- {% if sap_ha_pacemaker_cluster_vip_group_prefix | length > 0 and __sap_ha_pacemaker_cluster_resource_groups | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} + | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} + {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }} {%- else -%} none_found {%- endif -%} @@ -127,7 +128,7 @@ {% if __sap_ha_pacemaker_cluster_resource_groups | length > 0 -%} {% for group in __sap_ha_pacemaker_cluster_resource_groups -%} {% if group.id == (sap_ha_pacemaker_cluster_vip_group_prefix - + sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} + + __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name) -%} {{ (group.resource_ids | length * 1000) + sap_ha_pacemaker_cluster_constraint_colo_base_score }} {%- endif %} {%- endfor %} @@ -146,11 +147,12 @@ __sap_ha_pacemaker_cluster_constraints_colocation: "{{ __sap_ha_pacemaker_cluster_constraints_colocation + [__constraint_colo_vip] }}" vars: __constraint_colo_vip: - id: "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name }}" resource_leader: # SAPHana is replaced by SAP HANA Controller for SAPHanaSR-angi - id: "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name if __sap_ha_pacemaker_cluster_saphanasr_angi_available - else sap_ha_pacemaker_cluster_hana_resource_clone_name }}" + id: "{{ __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name + if __sap_ha_pacemaker_cluster_saphanasr_angi_available + else __sap_ha_pacemaker_cluster_hana_resource_clone_name }}" # SUSE SAPHanaSR is using Master Slave clone using Master/Slave roles role: "{{ 'slave' if ansible_os_family == 'Suse' and not __sap_ha_pacemaker_cluster_saphanasr_angi_available else 'unpromoted' }}" @@ -169,14 +171,14 @@ __res_or_grp: |- {% if sap_ha_pacemaker_cluster_vip_group_prefix | length > 0 and __sap_ha_pacemaker_cluster_resource_groups | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} + | select('match', sap_ha_pacemaker_cluster_vip_group_prefix + __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} + {{ sap_ha_pacemaker_cluster_vip_group_prefix }}{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }} {%- elif __sap_ha_pacemaker_cluster_resource_primitives | map(attribute='id') - | select('match', sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name) -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }} + | select('match', __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name) -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }} {%- else -%} none_found {%- endif -%} @@ -186,7 +188,7 @@ {% if __sap_ha_pacemaker_cluster_resource_groups | length > 0 -%} {% for group in __sap_ha_pacemaker_cluster_resource_groups -%} {% if group.id == (sap_ha_pacemaker_cluster_vip_group_prefix - + sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} + + __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name) -%} {{ (group.resource_ids | length * 1000) + sap_ha_pacemaker_cluster_constraint_colo_base_score }} {%- endif %} {%- endfor %} @@ -196,6 +198,6 @@ when: - __constraint_colo_vip.resource_follower not in (__sap_ha_pacemaker_cluster_constraints_colocation | map(attribute='resource_follower')) - - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address is defined - - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address != '' + - __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address != '' - __res_or_grp != 'none_found' # fallback skip if there was neither a group nor any VIP/HC resources found diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml index 8f3e4449d..3d7600d79 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_vip_groups.yml @@ -10,30 +10,30 @@ resource_ids: "{{ group_item.vip_hc_resources }}" __instance: - - name: "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" + - name: "{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" + - "{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }}" + - name: "{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" - vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" - vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" - vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name }}" - - name: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" - vip_hc_resources: - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name }}" + - "{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" + # - name: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" + # vip_hc_resources: + # - "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" + # - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" + # - name: "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" + # vip_hc_resources: + # - "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" + # - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" + # - name: "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" + # vip_hc_resources: + # - "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" + # - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name }}" + # - name: "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" + # vip_hc_resources: + # - "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" + # - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name }}" loop: "{{ __instance }}" loop_control: loop_var: group_item diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml index 850f1f86d..6a5517cb4 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_construct_vip_resources.yml @@ -6,51 +6,51 @@ __sap_ha_pacemaker_cluster_all_vip_fact: # noqa jinja[spacing] hana_scaleup_perf: "{{ { - sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: - sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: - sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: + __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: + __sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: + __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: sap_ha_pacemaker_cluster_healthcheck_hana_primary_port, - sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: + __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port - } }}" + } if sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup_perf') | length > 0 else omit }}" nwas_abap_ascs_ers: "{{ { - sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port - } }}" + } if sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 else omit }}" nwas_java_scs_ers: "{{ { - sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_scs_port, - sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port - } }}" + } if sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 else omit }}" nwas_abap_pas_aas: "{{ { - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | regex_replace('/.*', ''), - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: + __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | regex_replace('/.*', ''), + __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port, - sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: + __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port - } }}" + } if sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 else omit }}" ### Maintenance note # @@ -101,6 +101,27 @@ # The VIP resource construction files are included in a loop to allow # for multiple IPs to be configured in cluster resources +# Create list of VIP resource names to distinguish between VIP and HC resources +- name: "SAP HA Prepare Pacemaker - Prepare list of VIP resource names" + ansible.builtin.set_fact: + __sap_ha_pacemaker_cluster_vip_resource_list: + - "{{ __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name | d('') }}" + + __sap_ha_pacemaker_cluster_healthcheck_resource_list: + - "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name | d('') }}" + - "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name | d('') }}" + # Repeat the VIP resource definition in a loop over the above combined possible parameters. # Applies to systems with no particular platform detected. # VIP resources creation only. diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml index 459882b83..cf7d537da 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_hana.yml @@ -35,82 +35,105 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 +# Private variables are assigned following logic: +# 1. Use backwards compatible var if new var is empty +# 2. Use user input if new var is not empty +# 3. Use default (results in failed assert in validation tasks if default is empty string) + + # Calculate private variables - name: "SAP HA Prepare Pacemaker - Set primary variables (HANA)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_hana_sid: - "{{ sap_ha_pacemaker_cluster_hana_sid | d(sap_hana_sid) | d('') | upper }}" + "{{ sap_hana_sid | d('') | upper + if sap_ha_pacemaker_cluster_hana_sid | string | length == 0 + else sap_ha_pacemaker_cluster_hana_sid | upper }}" # TODO: Remove backwards compatibility sap_ha_pacemaker_cluster_hana_instance_number __sap_ha_pacemaker_cluster_hana_instance_nr: - "{{ sap_ha_pacemaker_cluster_hana_instance_nr | d(sap_ha_pacemaker_cluster_hana_instance_number) - | d(sap_hana_instance_number) | d('') }}" + "{{ sap_ha_pacemaker_cluster_hana_instance_number | d(sap_hana_instance_number) | d('') + if sap_ha_pacemaker_cluster_hana_instance_nr | string | length == 0 + else sap_ha_pacemaker_cluster_hana_instance_nr }}" - name: "SAP HA Prepare Pacemaker - Set cluster resource variables: Primitives (HANA)" ansible.builtin.set_fact: # SAP Hana __sap_ha_pacemaker_cluster_hana_resource_name: - "{{ sap_ha_pacemaker_cluster_hana_resource_name - | d('rsc_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'rsc_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_resource_name }}" __sap_ha_pacemaker_cluster_hana_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_hana_resource_clone_name - | d('cln_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'cln_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_resource_clone_name }}" __sap_ha_pacemaker_cluster_hana_resource_clone_msl_name: - "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name - | d('msl_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'msl_SAPHana_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_resource_clone_msl_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" # SAP Hana Controller __sap_ha_pacemaker_cluster_hanacontroller_resource_name: - "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_name - | d('rsc_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'rsc_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hanacontroller_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_hanacontroller_resource_name }}" __sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name - | d('mst_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'mst_SAPHanaCon_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name }}" # SAP Hana Topology __sap_ha_pacemaker_cluster_hana_topology_resource_name: - "{{ sap_ha_pacemaker_cluster_hana_topology_resource_name - | d('rsc_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'rsc_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_topology_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_topology_resource_name }}" __sap_ha_pacemaker_cluster_hana_topology_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_hana_topology_resource_clone_name - | d('cln_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'cln_SAPHanaTop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_topology_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_topology_resource_clone_name }}" # SAP Hana Filesystem __sap_ha_pacemaker_cluster_hana_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_name - | d('rsc_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'rsc_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name - | d('cln_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'cln_SAPHanaFil_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name }}" - name: "SAP HA Prepare Pacemaker - Set cluster resource variables: Constraints (HANA)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_hana_order_topology_hana_name: - "{{ sap_ha_pacemaker_cluster_hana_order_topology_hana_name - | d('ord_saphana_saphanatop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) }}" + "{{ 'ord_saphana_saphanatop_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr + if sap_ha_pacemaker_cluster_hana_order_topology_hana_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_order_topology_hana_name }}" __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name: - "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name - | d('col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + "{{ 'col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_primary' + if sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name }}" __sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name: - "{{ sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name - | d('col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + "{{ 'col_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_readonly' + if sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name }}" __sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name: - "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name - | d('ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + "{{ 'ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_primary' + if sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name }}" __sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name: - "{{ sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name - | d('ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + "{{ 'ord_saphana_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_readonly' + if sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name | string | length == 0 + else sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name }}" - name: "SAP HA Prepare Pacemaker - Set cluster resource variables: VIP (HANA)" @@ -119,33 +142,42 @@ "{{ sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | d('') }}" __sap_ha_pacemaker_cluster_vip_hana_primary_resource_name: - "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name - | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + "{{ 'rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_primary' + if sap_ha_pacemaker_cluster_vip_hana_primary_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name: - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name - | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_primary' }}" + "{{ 'rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_primary' + if sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }}" __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address: "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | d('') }}" __sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name: - "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name - | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + "{{ 'rsc_vip_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_readonly' + if sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name: - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name - | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr) ~ '_readonly' }}" + "{{ 'rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '_HDB' ~ __sap_ha_pacemaker_cluster_hana_instance_nr ~ '_readonly' + if sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id: - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id | d(__sap_ha_pacemaker_cluster_hana_sid ~ 'prim') }}" + "{{ __sap_ha_pacemaker_cluster_hana_sid ~ 'prim' + if sap_ha_pacemaker_cluster_healthcheck_hana_primary_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id: - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id | d(__sap_ha_pacemaker_cluster_hana_sid ~ 'ro') }}" + "{{ __sap_ha_pacemaker_cluster_hana_sid ~ 'ro' + if sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" - name: "SAP HA Prepare Pacemaker - Set variables: Other (HANA)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_hana_global_ini_path: - "{{ sap_ha_pacemaker_cluster_hana_global_ini_path - | d('/usr/sap/' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '/SYS/global/hdb/custom/config/global.ini') }}" + "{{ '/usr/sap/' ~ __sap_ha_pacemaker_cluster_hana_sid ~ '/SYS/global/hdb/custom/config/global.ini' + if sap_ha_pacemaker_cluster_hana_global_ini_path | string | length == 0 + else sap_ha_pacemaker_cluster_hana_global_ini_path }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml index d4fb4bc53..baa6ecb92 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml @@ -14,34 +14,50 @@ - "(role_path + '/vars/' + include_item + '.yml') is file" +# Private variables are assigned following logic: +# 1. Use backwards compatible var if new var is empty +# 2. Use user input if new var is not empty +# 3. Use default (results in failed assert in validation tasks if default is empty string) + + # Calculate private variables - name: "SAP HA Prepare Pacemaker - Set primary variables (Netweaver)" ansible.builtin.set_fact: # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_sid: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | d(sap_swpm_sid) | d('') | upper - if sap_ha_pacemaker_cluster_nwas_sid | length == 0 else sap_ha_pacemaker_cluster_nwas_sid | upper }}" + if sap_ha_pacemaker_cluster_nwas_sid | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_sid | upper }}" __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | d(sap_swpm_ascs_instance_nr) | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" __sap_ha_pacemaker_cluster_nwas_scs_instance_nr: - "{{ sap_ha_pacemaker_cluster_nwas_scs_instance_nr | d(sap_swpm_java_scs_instance_nr) | d('') }}" + "{{ sap_swpm_ascs_instance_nr | d('') + if sap_ha_pacemaker_cluster_nwas_scs_instance_nr | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" # Assign from sap_swpm variables based on host type __sap_ha_pacemaker_cluster_nwas_ers_instance_nr: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | d(sap_swpm_ers_instance_nr) | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 and sap_ha_pacemaker_cluster_host_type == 'nwas_abap_ascs_ers' + if sap_ha_pacemaker_cluster_nwas_ers_instance_nr | string | length == 0 + and sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 else (sap_swpm_ers_instance_nr | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 and sap_ha_pacemaker_cluster_host_type == 'nwas_java_scs_ers' - else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + if sap_ha_pacemaker_cluster_nwas_ers_instance_nr | string | length == 0 + and sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + else sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" - # __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: - # "{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr | d(sap_swpm_pas_instance_nr) | d('') }}" + __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr: + "{{ sap_swpm_pas_instance_nr | d('') + if sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" - # __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: - # "{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr | d(sap_swpm_aas_instance_nr) | d('') }}" + __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: + "{{ sap_swpm_aas_instance_nr | d('') + if sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" - name: "SAP HA Prepare Pacemaker - Set cluster resource variable: VIP (Netweaver)" @@ -50,122 +66,146 @@ # ASCS __sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address }}" + if sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address }}" __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name - | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name: - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name | d('') - if sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | length == 0 - else sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name - | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" # SCS __sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address: "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | d('') }}" __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name - | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name: - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name - | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name }}" # ERS __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address: "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | d('') }}" + if sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address }}" __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name - | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name + | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name: - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name | d('') - if sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | length == 0 - else sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name - | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" - - # # PAS - # __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: - # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | d('') }}" - - # __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: - # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name - # | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name + | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" - # __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: - # "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name - # | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr) }}" + # PAS + __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | d('') }}" - # # AAS - # __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: - # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | d('') }}" + __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name: + "{{ 'rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + if sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" - # __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: - # "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name - # | d('rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr) }}" + __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name: + "{{ 'rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_PAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + if sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name }}" - # __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: - # "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name - # | d('rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr) }}" + # AAS + __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address: + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | d('') }}" -# Currently not implemented -# - name: "SAP HA Prepare Pacemaker - Set cluster resource variable: VIP Health Checks (Netweaver)" -# ansible.builtin.set_fact: -# # TODO: Remove backwards compatibility to nwas_abap_ascs -# __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: -# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | d(sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id) -# | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ascs') }}" + __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name: + "{{ 'rsc_vip_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + if sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" -# __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: -# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'scs') }}" + __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name: + "{{ 'rsc_vip_health_check_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_AAS' ~ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + if sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name }}" -# __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: -# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | d(sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id) -# | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ers') }}" -# __sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: -# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'pas') }}" - -# __sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: -# "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'aas') }}" +- name: "SAP HA Prepare Pacemaker - Set cluster resource variable: VIP Health Checks (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to nwas_abap_ascs + __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ascs') + if sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id: + "{{ __sap_ha_pacemaker_cluster_nwas_sid ~ 'scs' + if sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_scs_id }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id: + "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id | d(__sap_ha_pacemaker_cluster_nwas_sid ~ 'ers') + if sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | string | length == 0 + and sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + else (__sap_ha_pacemaker_cluster_nwas_sid ~ 'ers' + if sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | string | length == 0 + and sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id) }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id: + "{{ __sap_ha_pacemaker_cluster_nwas_sid ~ 'pas' + if sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id }}" + + __sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id: + "{{ __sap_ha_pacemaker_cluster_nwas_sid ~ 'aas' + if sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id | string | length == 0 + else sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id }}" - name: "SAP HA Prepare Pacemaker - Set cluster resource variable: Filesystem (Netweaver)" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt') }}" + "{{ 'rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt' + if sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name - | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt') }}" + "{{ 'cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sapmnt' + if sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }}" __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans') }}" + "{{ 'rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans' + if sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name - | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans') }}" + "{{ 'cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_trans' + if sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }}" __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys') }}" + "{{ 'rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys' + if sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name - | d('cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys') }}" + "{{ 'cln_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_sys' + if sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }}" - name: "SAP HA Prepare Pacemaker - Set variable: Instance names (Netweaver)" @@ -173,41 +213,37 @@ # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name - | d(sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name) | d('') }}" + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | d('') }}" __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name: "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name | d('') }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | d('') - if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name - | d(sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name) | d('') }}" + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | d('') }}" - name: "SAP HA Prepare Pacemaker - Set variable: Instance profile paths (Netweaver)" ansible.builtin.set_fact: # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | length == 0 - else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string - | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') - ~ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name}}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string + | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/' ~ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name) + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string: - "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string - | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') - ~ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name}}" + "{{ '/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/' ~ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name + if sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string | d('') - if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | length == 0 - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string - | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/') - ~ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name}}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string + | d('/sapmnt/' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '/profile/' ~ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name) + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" - name: "SAP HA Prepare Pacemaker - Set variables for ASCS resources (Netweaver)" @@ -216,36 +252,38 @@ ansible.builtin.set_fact: # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name - | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name + | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name - | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name + | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name }}" __sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name - | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name + | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ASCS' ~ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr) + if sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name }}" __sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name: - "{{ sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name - | d('col_ascs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + "{{ 'col_ascs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid + if sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name }}" __sap_ha_pacemaker_cluster_nwas_order_ascs_first_name: - "{{ sap_ha_pacemaker_cluster_nwas_order_ascs_first_name - | d('ord_ascs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + "{{ 'ord_ascs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid + if sap_ha_pacemaker_cluster_nwas_order_ascs_first_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_order_ascs_first_name }}" - name: "SAP HA Prepare Pacemaker - Set variables for SCS resources (Netweaver)" @@ -253,28 +291,34 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name - | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name - | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name }}" __sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name - | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr) }}" + "{{ 'grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_SCS' ~ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + if sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name }}" __sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name: - "{{ sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name - | d('col_scs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + "{{ 'col_scs_separate_' ~ __sap_ha_pacemaker_cluster_nwas_sid + if sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name }}" __sap_ha_pacemaker_cluster_nwas_order_scs_first_name: - "{{ sap_ha_pacemaker_cluster_nwas_order_scs_first_name - | d('ord_scs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid) }}" + "{{ 'ord_scs_first_' ~ __sap_ha_pacemaker_cluster_nwas_sid + if sap_ha_pacemaker_cluster_nwas_order_scs_first_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_order_scs_first_name }}" - name: "SAP HA Prepare Pacemaker - Set variables for ERS resources (Netweaver)" @@ -284,33 +328,31 @@ ansible.builtin.set_fact: # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name - | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name + | d('rsc_fs_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name - | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name + | d('rsc_SAPInstance_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name | d('') - if sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | length == 0 - else sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name - | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name + | d('rsc_SAPStartSrv_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | string | length == 0 + else sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name }}" __sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name: - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name | d('') - if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | length == 0 - else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name - | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) }}" + "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name + | d('grp_' ~ __sap_ha_pacemaker_cluster_nwas_sid ~ '_ERS' ~ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr) + if sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | string | length == 0 + else sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name }}" __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool | d(false) - if not sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool }}" + "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool | d(false) }}" - name: "SAP HA Prepare Pacemaker - Set variables for Central Services parameters (Netweaver)" @@ -320,25 +362,22 @@ ansible.builtin.set_fact: # TODO: Remove backwards compatibility to nwas_abap_ascs __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | d(false) - if not sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool - else sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool }}" + "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | d(false) }}" __sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness | d(5000) - if sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness != 5000 - else sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness }}" + "{{ sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness | d(5000) }}" -- name: Pause - ansible.builtin.pause: - minutes: 1200 + __sap_ha_pacemaker_cluster_nwas_cs_ensa1: + "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 is defined and sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 + else sap_ha_pacemaker_cluster_nwas_cs_ensa1 | d(false) }}" # TODO: Add PAS and AAS variables # sap_ha_pacemaker_cluster_nwas_abap_pas_filesystem_resource_name: > -# "Filesystem_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +# "Filesystem_NWAS_ABAP_PAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" # sap_ha_pacemaker_cluster_nwas_abap_pas_sapinstance_resource_name: > -# "SAPInstance_NWAS_ABAP_PAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +# "SAPInstance_NWAS_ABAP_PAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" # sap_ha_pacemaker_cluster_nwas_abap_aas_filesystem_resource_name: > -# "Filesystem_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +# "Filesystem_NWAS_ABAP_AAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" # sap_ha_pacemaker_cluster_nwas_abap_aas_sapinstance_resource_name: > -# "SAPInstance_NWAS_ABAP_AAS_{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +# "SAPInstance_NWAS_ABAP_AAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/main.yml b/roles/sap_ha_pacemaker_cluster/tasks/main.yml index 1a81211aa..1359a7ee7 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/main.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/main.yml @@ -16,9 +16,6 @@ # TODO: Build all resource/constraint configuration variables based on # simpler user input (think: drop-down options in a UI) -- name: "SAP HA Prepare Pacemaker - Include parameter validation tasks" - ansible.builtin.import_tasks: validate_input_parameters.yml - # Make sure that all parameters already set for 'ha_cluster' are also inherited. # Add to this file a task for EACH parameter which this SAP cluster role # supports. @@ -32,6 +29,10 @@ - name: "SAP HA Prepare Pacemaker - Include tasks for SAP landscape calculation" ansible.builtin.import_tasks: ascertain_sap_landscape.yml +# Validate input variables after processing in include_vars_ tasks. +- name: "SAP HA Prepare Pacemaker - Include parameter validation tasks" + ansible.builtin.import_tasks: validate_input_parameters.yml + # Determine if we are on a cloud platform. - name: "SAP HA Prepare Pacemaker - Include tasks for platform detection" ansible.builtin.import_tasks: platform/ascertain_platform_type.yml @@ -74,10 +75,7 @@ # Common variables for Netweaver scenarios - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver common" ansible.builtin.include_tasks: - file: "{{ item }}" - loop: - - construct_vars_nwas_common.yml - - gather_vars_nwas.yml + file: construct_vars_nwas_common.yml when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 @@ -92,7 +90,7 @@ loop_var: nwas_build_item when: - "'nwas_abap_ascs_ers' in nwas_build_item" - - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + - not (sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool) - name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ASCS/ERS Simple Mount Simple Mount # noqa name[template] @@ -103,7 +101,7 @@ loop_var: nwas_build_item when: - "'nwas_abap_ascs_ers' in nwas_build_item" - - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool # SAP SCS/ERS Scenarios @@ -115,7 +113,7 @@ loop_var: nwas_build_item when: - "'nwas_java_scs_ers' in nwas_build_item" - - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + - not (sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool) - name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver SCS/ERS Simple Mount Simple Mount # noqa name[template] @@ -126,7 +124,7 @@ loop_var: nwas_build_item when: - "'nwas_java_scs_ers' in nwas_build_item" - - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool # SAP PAS/AAS Scenarios @@ -144,6 +142,8 @@ - name: "SAP HA Prepare Pacemaker - Include variable construction for SAP Hana VIP constraints" ansible.builtin.include_tasks: file: construct_vars_vip_constraints_hana.yml + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 # All of the SAP HA role constructed parameters must be translated to # 'ha_cluster' Linux System Role parameters. @@ -207,15 +207,6 @@ mode: "0600" - # TODO REMOVE - - name: Debug __sap_ha_pacemaker_cluster_resource_primitives - ansible.builtin.debug: - var: __sap_ha_pacemaker_cluster_resource_primitives - - name: Pause - ansible.builtin.pause: - minutes: 1200 - - # Cluster installation and configuration through the dedicated # linux system role 'ha_cluster' - name: "SAP HA Install Pacemaker - Include System Role 'ha_cluster'" @@ -223,32 +214,6 @@ name: "{{ sap_ha_pacemaker_cluster_system_roles_collection }}.ha_cluster" no_log: "{{ __sap_ha_pacemaker_cluster_no_log }}" # some parameters contain secrets - # # Resource defaults settings were added to "ha_cluster" in Apr 2023 (GH version 1.9.0) - # # https://github.com/linux-system-roles/ha_cluster#ha_cluster_resource_defaults - # # Keeping separate for compatibility with older versions of the ha_cluster role. - # # TODO: Change resource defaults update to "ha_cluster" native syntax. - # - name: "SAP HA Install Pacemaker - Check resource defaults" - # ansible.builtin.command: - # cmd: | - # {{ __sap_ha_pacemaker_cluster_command.resource_defaults_show }} - # register: __sap_ha_pacemaker_cluster_check_resource_defaults - # run_once: true - # changed_when: false - # check_mode: false - - # - name: "SAP HA Install Pacemaker - Update resource default attributes" - # when: - # - item.key ~ '=' ~ item.value not in __sap_ha_pacemaker_cluster_check_resource_defaults.stdout - # - __sap_ha_pacemaker_cluster_resource_defaults is defined - # - __sap_ha_pacemaker_cluster_resource_defaults | length > 0 - # ansible.builtin.command: - # cmd: | - # {{ __sap_ha_pacemaker_cluster_command.resource_defaults_update }} {{ item.key }}={{ item.value }} - # loop: "{{ __sap_ha_pacemaker_cluster_resource_defaults | dict2items }}" - # loop_control: - # label: "{{ item.key }}={{ item.value }}" - # run_once: true - # changed_when: true # Corosync post-inst - name: "SAP HA Install Pacemaker - Make sure corosync systemd directory exists" @@ -291,23 +256,43 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 run_once: true - # Post steps for ACS ERS crmsh cluster to remove unsupported operations + + # Post steps for ASCS/ERS crmsh cluster to remove unsupported operations - name: "SAP HA Install Pacemaker - Include NetWeaver ASCS/ERS post steps OS specific" ansible.builtin.include_tasks: file: "{{ ansible_facts['os_family'] }}/post_steps_nwas_abap_ascs_ers.yml" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - ansible_os_family == 'Suse' run_once: true + # Post steps for SCS/ERS crmsh cluster to remove unsupported operations + - name: "SAP HA Install Pacemaker - Include NetWeaver SCS/ERS post steps OS specific" + ansible.builtin.include_tasks: + file: "{{ ansible_facts['os_family'] }}/post_steps_nwas_java_scs_ers.yml" + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 + - ansible_os_family == 'Suse' + run_once: true + + - name: "SAP HA Install Pacemaker - Include NetWeaver ASCS/ERS post steps" ansible.builtin.include_tasks: - file: configure_nwas_ascs_ers_postinstallation.yml + file: configure_nwas_abap_ascs_ers_post_install.yml + apply: + tags: nwas_postinst + tags: nwas_postinst + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + + - name: "SAP HA Install Pacemaker - Include NetWeaver SCS/ERS post steps" + ansible.builtin.include_tasks: + file: configure_nwas_java_scs_ers_post_install.yml apply: tags: nwas_postinst tags: nwas_postinst when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 ### END OF BLOCK: prerequisite changes and cluster setup diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml index 2940192bf..50979c707 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_gcp_ce_vm.yml @@ -53,19 +53,19 @@ value: 20 __haproxy_id: >- - {% if vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name + {% if vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name and sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port | length > 4 -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_id }} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id }} {%- else -%} {%- endif %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml index 0944a5796..713635e35 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/construct_vars_vip_resources_cloud_ibmcloud_vs.yml @@ -30,19 +30,19 @@ value: 20 __haproxy_id: >- - {% if vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name + {% if vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name and sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port | length > 4 -%} - {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_id }} - {%- elif vip_list_item.key == sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name -%} - {{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_id }} + {{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_pas_id }} + {%- elif vip_list_item.key == __sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name -%} + {{ __sap_ha_pacemaker_cluster_healthcheck_nwas_aas_id }} {%- else -%} {%- endif %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index 4e3a5e42d..d04162b0c 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -46,13 +46,13 @@ - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for HANA" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_hana: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_port }}" # If no custom port is defined, calculate the port for the secondary # by adding 10, to avoid a conflict with the port for the primary hc port. - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + {% if __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port }} {%- else %}0{%- endif %} when: @@ -61,9 +61,9 @@ - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for NW ASCS/ERS" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_ascs: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port }}" - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port }}" when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml index 243cce6b4..f8675baa8 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml @@ -78,13 +78,13 @@ - name: "SAP HA Install Pacemaker - IBM Cloud VS - Define healthcheck details for HANA" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_hana: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_primary_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_port }}" # If no custom port is defined, calculate the port for the secondary # by adding 10, to avoid a conflict with the port for the primary hc port. - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_hana_secondary_id }}" port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + {% if __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} {{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port }} {%- else %}0{%- endif %} when: @@ -93,9 +93,9 @@ - name: "SAP HA Install Pacemaker - IBM Cloud VS - Define healthcheck details for NW ASCS/ERS" ansible.builtin.set_fact: __sap_ha_pacemaker_cluster_healthcheck_list_ascs: - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port }}" - - name: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id }}" + - name: "{{ __sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id }}" port: "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port }}" when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 diff --git a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml index 676677ea3..9496046e8 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml @@ -4,8 +4,8 @@ - name: "SAP HA Prepare Pacemaker - (SAP HANA) Validate SAP System ID" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_hana_sid | length == 3 - - sap_ha_pacemaker_cluster_hana_sid not in __sap_ha_pacemaker_cluster_sid_prohibited + - __sap_ha_pacemaker_cluster_hana_sid | length == 3 + - __sap_ha_pacemaker_cluster_hana_sid not in __sap_ha_pacemaker_cluster_sid_prohibited fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} Requires:'sap_ha_pacemaker_cluster_hana_sid' to be defined as 3 capital letters! @@ -15,15 +15,8 @@ - name: "SAP HA Prepare Pacemaker - (SAP HANA) Validate SAP Instance Number" ansible.builtin.assert: that: - - ( - sap_ha_pacemaker_cluster_hana_instance_nr | type_debug != 'int' - and sap_ha_pacemaker_cluster_hana_instance_nr | length == 2 - ) - or - ( - sap_ha_pacemaker_cluster_hana_instance_nr | type_debug == 'int' - and sap_ha_pacemaker_cluster_hana_instance_nr is regex("^[0-9][0-9]$") - ) + - (__sap_ha_pacemaker_cluster_hana_instance_nr | string) | length == 2 + - (__sap_ha_pacemaker_cluster_hana_instance_nr | string) is match('^[0-9]{2}$') fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} @@ -35,52 +28,17 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 -# - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP System ID" -# ansible.builtin.assert: -# that: -# - sap_ha_pacemaker_cluster_nwas_sid | length == 3 -# - sap_ha_pacemaker_cluster_nwas_sid not in __sap_ha_pacemaker_cluster_sid_prohibited -# fail_msg: | -# Host type = {{ sap_ha_pacemaker_cluster_host_type }} -# Requires 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! -# when: -# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 - -# TODO: Remove backwards compatibility to nwas_abap_ascs - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate SAP System ID" ansible.builtin.assert: that: - - __nwas_sid | length == 3 - - __nwas_sid not in __sap_ha_pacemaker_cluster_sid_prohibited + - __sap_ha_pacemaker_cluster_nwas_sid | length == 3 + - __sap_ha_pacemaker_cluster_nwas_sid not in __sap_ha_pacemaker_cluster_sid_prohibited fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Current value: {{ __nwas_sid }} + Current value: {{ __sap_ha_pacemaker_cluster_nwas_sid }} Requires 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 - vars: - __nwas_sid: "{{ sap_ha_pacemaker_cluster_nwas_abap_sid | d(sap_swpm_sid) | d('') - if sap_ha_pacemaker_cluster_nwas_sid | length == 0 else sap_ha_pacemaker_cluster_nwas_sid }}" - - -# TODO: Remove backwards compatibility to nwas_abap_ascs -- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Backwards compatibility: Instance Number ASCS/ERS" - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - ansible.builtin.set_fact: - sap_ha_pacemaker_cluster_nwas_ascs_instance_nr: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | d(sap_swpm_ascs_instance_nr) | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | length == 0 - and sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr is defined - and sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | length > 0 - else sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" - - sap_ha_pacemaker_cluster_nwas_ers_instance_nr: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | d(sap_swpm_ers_instance_nr) | d('') - if sap_ha_pacemaker_cluster_nwas_ers_instance_nr | length == 0 - and sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr is defined - and sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | length > 0 - else sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" # Validate SAP Instance Number @@ -98,15 +56,15 @@ Add quotes if the number starts with a 0! Required: - {% if sap_ha_pacemaker_cluster_host_type == 'nwas_abap_ascs_ers' %} + {% if sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 %} - sap_ha_pacemaker_cluster_nwas_ascs_instance_nr - sap_ha_pacemaker_cluster_nwas_ers_instance_nr - {% elif sap_ha_pacemaker_cluster_host_type == 'nwas_java_scs_ers' %} + {% elif sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 %} - sap_ha_pacemaker_cluster_nwas_scs_instance_nr - sap_ha_pacemaker_cluster_nwas_ers_instance_nr - {% elif sap_ha_pacemaker_cluster_host_type == 'nwas_abap_pas_aas' %} + {% elif sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 %} - sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr - sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr @@ -115,11 +73,11 @@ {% endif %} loop: - - sap_ha_pacemaker_cluster_nwas_ascs_instance_nr - - sap_ha_pacemaker_cluster_nwas_scs_instance_nr - - sap_ha_pacemaker_cluster_nwas_ers_instance_nr - - sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr - - sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr + - __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr + - __sap_ha_pacemaker_cluster_nwas_scs_instance_nr + - __sap_ha_pacemaker_cluster_nwas_ers_instance_nr + # - __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr + # - __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr loop_control: loop_var: item vars: @@ -141,34 +99,14 @@ - sap_ha_pacemaker_cluster_storage_definition -# TODO: Remove backwards compatibility to nwas_abap_ascs -- name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Backwards compatibility: Instance Names" - when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 - ansible.builtin.set_fact: - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | d('') - if sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length == 0 - and sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name is defined - and sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | length > 0 - else sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name }}" - - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name: - "{{ sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | d('') - if sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length == 0 - and sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name is defined - and sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | length > 0 - else sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name }}" - # Ensure that SAP profile names are defined - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver ASCS) Validate SAP instance name" when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name is defined - - sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length > 0 + - __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name is defined + - __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | length > 0 fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} ASCS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name @@ -178,20 +116,20 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name is defined - - sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name | length > 0 + - __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name is defined + - __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name | length > 0 fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} SCS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver ERS) Validate SAP instance name" when: - - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap') | length > 0 - or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java') | length > 0 + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 + or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name is defined - - sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length > 0 + - __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name is defined + - __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | length > 0 fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} ERS Instance Name is mandatory: sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name @@ -203,7 +141,7 @@ that: - sap_ha_pacemaker_cluster_vip_client_interface is defined - sap_ha_pacemaker_cluster_vip_client_interface | length > 0 - fail_msg: + fail_msg: | Multiple interfaces are found on the system. {{ ansible_interfaces | to_nice_yaml }} @@ -224,54 +162,62 @@ - name: "SAP HA Prepare Pacemaker - (HANA primary) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_hana_primary_ip_address is defined - - sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_hana_primary_ip_address' is not defined." + - __sap_ha_pacemaker_cluster_vip_hana_primary_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_hana_primary_ip_address | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Required input 'sap_ha_pacemaker_cluster_vip_hana_primary_ip_address' is not defined or empty. when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 - name: "SAP HA Prepare Pacemaker - (NetWeaver ASCS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address' is not defined." + - __sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Required input 'sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address' is not defined or empty. when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 - name: "SAP HA Prepare Pacemaker - (NetWeaver SCS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address' is not defined." + - __sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Required input 'sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address' is not defined or empty. when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 - name: "SAP HA Prepare Pacemaker - (NetWeaver ERS) Verify that the VIP is defined" ansible.builtin.assert: that: - - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address is defined - - sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | length > 0 - fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address' is not defined." + - __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | length > 0 + fail_msg: | + Host type = {{ sap_ha_pacemaker_cluster_host_type }} + Required input 'sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address' is not defined or empty. when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 or sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_java_scs_ers') | length > 0 -# - name: "SAP HA Prepare Pacemaker - (NetWeaver PAS) Verify that the VIP is defined" -# ansible.builtin.assert: -# that: -# - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address is defined -# - sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | length > 0 -# fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address' is not defined." -# when: -# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas') | length > 0 +- name: "SAP HA Prepare Pacemaker - (NetWeaver PAS) Verify that the VIP is defined" + ansible.builtin.assert: + that: + - __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address | length > 0 + fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address' is not defined." + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas') | length > 0 -# - name: "SAP HA Prepare Pacemaker - (NetWeaver AAS) Verify that the ERS VIP is defined" -# ansible.builtin.assert: -# that: -# - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address is defined -# - sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | length > 0 -# fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address' is not defined." -# when: -# - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 +- name: "SAP HA Prepare Pacemaker - (NetWeaver AAS) Verify that the ERS VIP is defined" + ansible.builtin.assert: + that: + - __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address is defined + - __sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address | length > 0 + fail_msg: "Host type = '{{ sap_ha_pacemaker_cluster_host_type }}', but 'sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address' is not defined." + when: + - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_pas_aas') | length > 0 diff --git a/roles/sap_ha_pacemaker_cluster/templates/sudofile_20-saphana.j2 b/roles/sap_ha_pacemaker_cluster/templates/sudofile_20-saphana.j2 index fbd8eb9c1..3b2547842 100644 --- a/roles/sap_ha_pacemaker_cluster/templates/sudofile_20-saphana.j2 +++ b/roles/sap_ha_pacemaker_cluster/templates/sudofile_20-saphana.j2 @@ -6,23 +6,23 @@ # to update the SAP HANA cluster resource status. {% for node in sap_ha_pacemaker_cluster_cluster_nodes %} -Cmnd_Alias {{ node.hana_site | upper }}_SOK = /usr/sbin/crm_attribute -n hana_{{ sap_ha_pacemaker_cluster_hana_sid | lower }}_site_srHook_{{ node.hana_site }} -v SOK -t crm_config -s {{ sap_ha_pacemaker_cluster_hadr_provider_name }} -Cmnd_Alias {{ node.hana_site | upper }}_SFAIL = /usr/sbin/crm_attribute -n hana_{{ sap_ha_pacemaker_cluster_hana_sid | lower }}_site_srHook_{{ node.hana_site }} -v SFAIL -t crm_config -s {{ sap_ha_pacemaker_cluster_hadr_provider_name }} +Cmnd_Alias {{ node.hana_site | upper }}_SOK = /usr/sbin/crm_attribute -n hana_{{ __sap_ha_pacemaker_cluster_hana_sid | lower }}_site_srHook_{{ node.hana_site }} -v SOK -t crm_config -s {{ sap_ha_pacemaker_cluster_hadr_provider_name }} +Cmnd_Alias {{ node.hana_site | upper }}_SFAIL = /usr/sbin/crm_attribute -n hana_{{ __sap_ha_pacemaker_cluster_hana_sid | lower }}_site_srHook_{{ node.hana_site }} -v SFAIL -t crm_config -s {{ sap_ha_pacemaker_cluster_hadr_provider_name }} {% endfor %} {% if __sap_ha_pacemaker_cluster_hana_hook_tkover and __sap_ha_pacemaker_cluster_saphanasr_angi_available %} -Cmnd_Alias HOOK_HELPER = /usr/bin/SAPHanaSR-hookHelper --sid={{ sap_ha_pacemaker_cluster_hana_sid | upper }} --case=checkTakeover +Cmnd_Alias HOOK_HELPER = /usr/bin/SAPHanaSR-hookHelper --sid={{ __sap_ha_pacemaker_cluster_hana_sid | upper }} --case=checkTakeover -{{ sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER +{{ __sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER Defaults!{% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER !requiretty {% elif __sap_ha_pacemaker_cluster_hana_hook_tkover and not __sap_ha_pacemaker_cluster_saphanasr_angi_available %} -Cmnd_Alias HOOK_HELPER = /usr/sbin/SAPHanaSR-hookHelper --sid={{ sap_ha_pacemaker_cluster_hana_sid | upper }} --case=checkTakeover +Cmnd_Alias HOOK_HELPER = /usr/sbin/SAPHanaSR-hookHelper --sid={{ __sap_ha_pacemaker_cluster_hana_sid | upper }} --case=checkTakeover -{{ sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER +{{ __sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER Defaults!{% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %}, HOOK_HELPER !requiretty {% else %} -{{ sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %} +{{ __sap_ha_pacemaker_cluster_hana_sid | lower }}adm ALL=(ALL) NOPASSWD: {% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %} Defaults!{% for node in sap_ha_pacemaker_cluster_cluster_nodes %}{{ node.hana_site | upper }}_SOK, {{ node.hana_site | upper }}_SFAIL{{ ", " if not loop.last else "" }}{% endfor %} !requiretty {% endif %} diff --git a/roles/sap_ha_pacemaker_cluster/vars/main.yml b/roles/sap_ha_pacemaker_cluster/vars/main.yml index 6c56b4d09..3ea75301e 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/main.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/main.yml @@ -41,23 +41,6 @@ __sap_ha_pacemaker_cluster_available_vip_agents: ipaddr: agent: "ocf:heartbeat:IPaddr2" -# For convenience to distinguish between VIP and HC resources: -__sap_ha_pacemaker_cluster_vip_resource_list: - - "{{ sap_ha_pacemaker_cluster_vip_hana_primary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name }}" - -__sap_ha_pacemaker_cluster_healthcheck_resource_list: - - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name }}" - - "{{ sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name }}" - # Health check default port as string # Note: difference between HANA primary and read-only required # Ports must be pre-defined empty to skip entering construct_vars_vip_resources_* diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml index 7c3607cc2..d5f438467 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_abap_ascs_ers.yml @@ -4,11 +4,11 @@ # definition. # Therefore, the /usr/sap prefix must be left out of the listed path items. __sap_ha_pacemaker_cluster_nwas_ascs_ers_filesystems: - - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ASCS{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ERS{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_sid }}/ASCS{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_sid }}/ERS{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" # List of ASCS/ERS profile names. # Used in tasks/configure_nwas_postinstallation.yml for sap_cluster_connector setup. __sap_ha_pacemaker_cluster_nwas_ascs_ers_profile_paths: - - "{{ sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" - - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml index 984aecdd5..2bcf7a325 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/nwas_java_scs_ers.yml @@ -4,11 +4,11 @@ # definition. # Therefore, the /usr/sap prefix must be left out of the listed path items. __sap_ha_pacemaker_cluster_nwas_scs_ers_filesystems: - - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/SCS{{ sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" - - "{{ sap_ha_pacemaker_cluster_nwas_sid | upper }}/ERS{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_sid }}/SCS{{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_sid }}/ERS{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" # List of SCS/ERS profile names. # Used in tasks/configure_nwas_postinstallation.yml for sap_cluster_connector setup. __sap_ha_pacemaker_cluster_nwas_scs_ers_profile_paths: - - "{{ sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" - - "{{ sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string }}" + - "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string }}" diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml index 7484bf95c..3ab8fc99d 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_gcp_ce_vm.yml @@ -91,15 +91,15 @@ __sap_ha_pacemaker_cluster_corosync_totem_platform: # GCP needs haproxy and ports defined -sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} - 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} + {% if __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + 620{{ __sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" # Platform specific VIP handling diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml index dfb63f3bc..bd49ffdc4 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_ibmcloud_vs.yml @@ -55,15 +55,15 @@ sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_d # For HAPROXY an non-empty port default is required to enter the resource creation flow. # TODO: task logic that configures actual haproxy listening ports, # otherwise pairs like ASCS/ERS will conflict -sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} - 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} + {% if __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + 620{{ __sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml index e17436e36..e1f271d18 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/platform_cloud_msazure_vm.yml @@ -123,15 +123,15 @@ sap_ha_pacemaker_cluster_vip_method: "{{ __sap_ha_pacemaker_cluster_vip_method_d # The VIP layer consists of 2 components - the VIP and the health check resource sap_ha_pacemaker_cluster_vip_group_prefix: group_ -sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ sap_ha_pacemaker_cluster_hana_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_hana_primary_port: "620{{ __sap_ha_pacemaker_cluster_hana_instance_nr }}" sap_ha_pacemaker_cluster_healthcheck_hana_secondary_port: >- - {% if sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} - 620{{ sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} + {% if __sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address | length > 0 -%} + 620{{ __sap_ha_pacemaker_cluster_hana_instance_nr | int + 1 }} {%- else %}{% endif %} -sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" -sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_ers_port: "620{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" +sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_port: "620{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" __sap_ha_pacemaker_cluster_available_vip_agents: diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 6c6309f23..7ce47c72f 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -43,8 +43,7 @@ __sap_ha_pacemaker_cluster_repos_dict: __sap_ha_pacemaker_cluster_halib_package: sap-cluster-connector -# List of configuration lines that must be added to the instance profiles. -# Used in tasks/configure_nwas_ascs_ers_postinstallation.yml for SAP HA Interface setup. +# List of configuration lines that must be added to the instance profiles for SAP HA Interface setup. __sap_ha_pacemaker_cluster_connector_config_lines: - "service/halib = $(DIR_EXECUTABLE)/saphascriptco.so" - "service/halib_cluster_connector = /usr/bin/sap_cluster_connector" diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index 5fe416c01..f4fef7d6e 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -6,8 +6,7 @@ __sap_ha_pacemaker_cluster_halib_package: sap-suse-cluster-connector -# List of configuration lines that must be added to the instance profiles. -# Used in tasks/configure_nwas_ascs_ers_postinstallation.yml for SAP HA Interface setup. +# List of configuration lines that must be added to the instance profiles for SAP HA Interface setup. __sap_ha_pacemaker_cluster_connector_config_lines: - "service/halib = $(DIR_EXECUTABLE)/saphascriptco.so" - "service/halib_cluster_connector = /usr/bin/sap_suse_cluster_connector" @@ -135,10 +134,5 @@ __sap_ha_pacemaker_cluster_hook_hana_scaleup_perf_angi: __sap_ha_pacemaker_cluster_hook_hana_scaleout: [] __sap_ha_pacemaker_cluster_hook_hana_scaleout_angi: [] -# Overwrite resource clone name for SAP HANA -# SAPHanaSR-angi uses different variables, so it applies only to classic HANA. -sap_ha_pacemaker_cluster_hana_resource_clone_name: - "{{ sap_ha_pacemaker_cluster_hana_resource_clone_msl_name }}" - # Central Services Cluster Simple Mount: Enabled as default sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: true From 37fff999b48097ea2c8fa02f639e2342896611c1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 6 Nov 2024 10:43:01 +0100 Subject: [PATCH 187/210] sap_swpm: Skip comments in /etc/hosts check Signed-off-by: Bernd Finger --- .../tasks/pre_install/assert_hostname_resolution_for_ha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml index 87f318978..c97fbcd43 100644 --- a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -25,7 +25,7 @@ - name: SAP SWPM Pre Install - HA settings - Try to resolve sap_swpm_virtual_hostname from /etc/hosts ansible.builtin.shell: | - awk '/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/{print $1}' /etc/hosts + awk '/^[^#]/&&(/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/){print $1}' /etc/hosts register: __sap_swpm_register_virtual_ip_etc_hosts changed_when: false failed_when: false From c1ec50309c86efcf87559c54f734d0cb3b693841 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 6 Nov 2024 11:12:36 +0100 Subject: [PATCH 188/210] sap_swpm: Fix /etc/hosts ip address resolution Also modify the fail_msg to not resolve sap_swpm_virtual_hostname Signed-off-by: Bernd Finger --- .../tasks/pre_install/assert_hostname_resolution_for_ha.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml index c97fbcd43..4f9e075a2 100644 --- a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -23,9 +23,10 @@ when: __sap_swpm_register_virtual_ip_dns.stdout_lines | length == 0 block: +# We assign the IP address only if there is exactly one line containing ipv4 and hostname: - name: SAP SWPM Pre Install - HA settings - Try to resolve sap_swpm_virtual_hostname from /etc/hosts ansible.builtin.shell: | - awk '/^[^#]/&&(/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/){print $1}' /etc/hosts + awk 'BEGIN{a=0}/^[^#]/&&(/\s{{ sap_swpm_virtual_hostname }}\./||/\s{{ sap_swpm_virtual_hostname }}/){a++; ipaddr=$1}END{if(a==1){print ipaddr}}' /etc/hosts register: __sap_swpm_register_virtual_ip_etc_hosts changed_when: false failed_when: false @@ -38,7 +39,7 @@ - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_virtual_hostname can be resolved ansible.builtin.assert: that: __sap_swpm_fact_virtual_ip is defined and __sap_swpm_fact_virtual_ip | length > 0 - fail_msg: "FAIL: {{ sap_swpm_virtual_hostname }} cannot be resolved!" + fail_msg: "FAIL: 'sap_swpm_virtual_hostname' is not defined or cannot be resolved correctly!" success_msg: "PASS: {{ sap_swpm_virtual_hostname }} can be resolved." - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses From f6034713d6f8708affbaec48346e91e5f80006ed Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 6 Nov 2024 13:46:02 +0100 Subject: [PATCH 189/210] sap_swpm: Improve the fail message for virt hostname resolution Signed-off-by: Bernd Finger --- .../tasks/pre_install/assert_hostname_resolution_for_ha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml index 4f9e075a2..97b7c594a 100644 --- a/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml +++ b/roles/sap_swpm/tasks/pre_install/assert_hostname_resolution_for_ha.yml @@ -39,7 +39,7 @@ - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_virtual_hostname can be resolved ansible.builtin.assert: that: __sap_swpm_fact_virtual_ip is defined and __sap_swpm_fact_virtual_ip | length > 0 - fail_msg: "FAIL: 'sap_swpm_virtual_hostname' is not defined or cannot be resolved correctly!" + fail_msg: "FAIL: 'sap_swpm_virtual_hostname' is not defined, cannot be resolved, or has multiple entries in /etc/hosts!" success_msg: "PASS: {{ sap_swpm_virtual_hostname }} can be resolved." - name: SAP SWPM Pre Install - HA settings - Assert that sap_swpm_fact_virtual_ip is part of ansible_all_ipv4_addresses From 53fc00beb295b81d803aa35114bc9fd81ff64727 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 7 Nov 2024 15:12:55 +0100 Subject: [PATCH 190/210] Update readme and argument_spec --- roles/sap_ha_pacemaker_cluster/README.md | 913 +++++++++--------- .../meta/argument_specs.yml | 7 +- 2 files changed, 451 insertions(+), 469 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index 2be284e0b..ff5823c1a 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -166,18 +166,8 @@ Minimum required parameters for all clusters: Additional minimum requirements depend on the type of cluster setup and on the target platform. -### sap_ha_pacemaker_cluster_hacluster_user_password - -- _Type:_ `string` - -**Mandatory Input Parameter.**
-The password of the `hacluster` user which is created during pacemaker installation.
-Inherits the value of `ha_cluster_hacluster_password`, when defined.
- - ### sap_ha_pacemaker_cluster_aws_access_key_id - -- _Type:_ `string` +- _Type:_ `string`
AWS access key to allow control of instances (for example for fencing operations).
Mandatory for the cluster nodes setup on AWS EC2 instances, when:
@@ -185,8 +175,7 @@ Mandatory for the cluster nodes setup on AWS EC2 instances, when:
2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
### sap_ha_pacemaker_cluster_aws_credentials_setup - -- _Type:_ `string` +- _Type:_ `string`
Set this parameter to 'true' to store AWS credentials into /root/.aws/credentials.
Requires: `sap_ha_pacemaker_cluster_aws_access_key_id` and `sap_ha_pacemaker_cluster_aws_secret_access_key`
@@ -194,15 +183,13 @@ Mandatory for the cluster nodes setup on AWS EC2 instances, when:
1. IAM Role or Instance profile is not attached to EC2 instance.
### sap_ha_pacemaker_cluster_aws_region - -- _Type:_ `string` +- _Type:_ `string`
The AWS region in which the instances to be used for the cluster setup are located.
Mandatory for cluster nodes setup on AWS EC2 instances.
### sap_ha_pacemaker_cluster_aws_secret_access_key - -- _Type:_ `string` +- _Type:_ `string`
AWS secret key, paired with the access key for instance control.
Mandatory for the cluster nodes setup on AWS EC2 instances, when:
@@ -210,24 +197,21 @@ Mandatory for the cluster nodes setup on AWS EC2 instances, when:
2. `sap_ha_pacemaker_cluster_aws_credentials_setup` is `true`
### sap_ha_pacemaker_cluster_aws_vip_update_rt - -- _Type:_ `string` +- _Type:_ `string`
List one more routing table IDs for managing Virtual IP failover through routing table changes.
Multiple routing tables must be defined as a comma-separated string (no spaces).
Mandatory for the VIP resource configuration in AWS EC2 environments.
### sap_ha_pacemaker_cluster_cluster_name - -- _Type:_ `string` +- _Type:_ `string`
The name of the pacemaker cluster.
Inherits the `ha_cluster` LSR native parameter `ha_cluster_cluster_name` if not defined.
If not defined, the `ha_cluster` Linux System Role default will be used.
### sap_ha_pacemaker_cluster_cluster_nodes - -- _Type:_ `list` +- _Type:_ `list`
List of cluster nodes and associated attributes to describe the target SAP HA environment.
This is required for the HANA System Replication configuration.
@@ -235,16 +219,16 @@ Synonym for this parameter is `sap_hana_cluster_nodes`.
Mandatory to be defined for HANA clusters.
- **hana_site**
- Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). +Site of the cluster and/or SAP HANA System Replication node (for example 'DC01').
Mandatory for HANA clusters (sudo config for system replication). - **node_ip**
- IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ +IP address of the node used for HANA System Replication.
_Optional. Currently not needed/used in cluster configuration._ - **node_name**
- Name of the cluster node, should match the remote systems' hostnames.
_Optional. Currently not needed/used in cluster configuration._ +Hostname of the cluster node.
_Optional. Currently not needed/used in cluster configuration._ - **node_role**
- Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ +_Choices:_ `primary, secondary`
+Role of the defined `node_name` in the SAP HANA cluster setup.
There must be only **one** primary, but there can be multiple secondary nodes.
_Optional. Currently not needed/used in cluster configuration._ Example: - ```yaml sap_ha_pacemaker_cluster_cluster_nodes: - hana_site: DC01 @@ -253,28 +237,23 @@ sap_ha_pacemaker_cluster_cluster_nodes: node_role: primary - hana_site: DC02 ``` - ### sap_ha_pacemaker_cluster_cluster_properties - -- _Type:_ `dict` -- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}` +- _Type:_ `dict`
+- _Default:_ `{'concurrent-fencing': True, 'stonith-enabled': True, 'stonith-timeout': 900}`
Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.
When no STONITH resource is defined, STONITH will be disabled and a warning displayed.
Example: - ```yaml sap_ha_pacemaker_cluster_cluster_properties: concurrent-fencing: true stonith-enabled: true stonith-timeout: 900 ``` - ### sap_ha_pacemaker_cluster_create_config_dest - -- _Type:_ `string` -- _Default:_ `review_resource_config.yml` +- _Type:_ `string`
+- _Default:_ `review_resource_config.yml`
The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.
Requires `sap_ha_pacemaker_cluster_create_config_varfile` to be enabled for generating the output file.
@@ -282,9 +261,8 @@ Specify a path/filename to save the file in a custom location.
The file can be used as input vars file for an Ansible playbook running the 'ha_cluster' Linux System Role.
### sap_ha_pacemaker_cluster_create_config_varfile - -- _Type:_ `bool` -- _Default:_ `False` +- _Type:_ `bool`
+- _Default:_ `False`
When enabled, all cluster configuration parameters this role constructs for executing the 'ha_cluster' Linux System role will be written into a file in Yaml format.
This allows using the output file later as input file for additional custom steps using the 'ha_cluster' role and covering the resource configuration in a cluster that was set up using this 'sap_ha_pacemaker_cluster' role.
@@ -292,23 +270,20 @@ When enabled this parameters file is also created when the playbook is run in ch WARNING! This report may include sensitive details like secrets required for certain cluster resources!
### sap_ha_pacemaker_cluster_enable_cluster_connector - -- _Type:_ `bool` -- _Default:_ `True` +- _Type:_ `bool`
+- _Default:_ `True`
Enables/Disables the SAP HA Interface for SAP ABAP application server instances, also known as `sap_cluster_connector`.
Set this parameter to 'false' if the SAP HA interface should not be installed and configured.
### sap_ha_pacemaker_cluster_extra_packages - -- _Type:_ `list` +- _Type:_ `list`
Additional extra packages to be installed, for instance specific resource packages.
For SAP clusters configured by this role, the relevant standard packages for the target scenario are automatically included.
### sap_ha_pacemaker_cluster_fence_agent_packages - -- _Type:_ `list` +- _Type:_ `list`
Additional fence agent packages to be installed.
This is automatically combined with default packages in:
@@ -316,22 +291,19 @@ This is automatically combined with default packages in:
`__sap_ha_pacemaker_cluster_fence_agent_packages_platform`
### sap_ha_pacemaker_cluster_gcp_project - -- _Type:_ `string` +- _Type:_ `string`
Google Cloud project name in which the target instances are installed.
Mandatory for the cluster setup on GCP instances.
### sap_ha_pacemaker_cluster_gcp_region_zone - -- _Type:_ `string` +- _Type:_ `string`
Google Cloud Platform region zone ID.
Mandatory for the cluster setup on GCP instances.
### sap_ha_pacemaker_cluster_ha_cluster - -- _Type:_ `dict` +- _Type:_ `dict`
The `ha_cluster` LSR native parameter `ha_cluster` can be used as a synonym.
Optional _**host_vars**_ parameter - if defined it must be set for each node.
@@ -340,7 +312,6 @@ Supported options can be reviewed in the `ha_cluster` Linux System Role [https:/ If not defined, the `ha_cluster` Linux System Role default will be used.
Example: - ```yaml sap_ha_pacemaker_cluster_ha_cluster: corosync_addresses: @@ -348,33 +319,35 @@ sap_ha_pacemaker_cluster_ha_cluster: - 192.168.2.10 node_name: nodeA ``` +### sap_ha_pacemaker_cluster_hacluster_user_password required +- **Required**
+- _Type:_ `string`
-### sap_ha_pacemaker_cluster_hana_automated_register +The password of the `hacluster` user which is created during pacemaker installation.
+Inherits the value of `ha_cluster_hacluster_password`, when defined.
-- _Type:_ `bool` -- _Default:_ `True` +### sap_ha_pacemaker_cluster_hana_automated_register +- _Type:_ `bool`
+- _Default:_ `True`
Parameter for the 'SAPHana' cluster resource.
Define if a former primary should be re-registered automatically as secondary.
### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_primary` +- _Type:_ `string`
+- _Default:_ `col_saphana_vip__HDB_primary`
Customize the cluster constraint name for VIP and SAPHana primary clone colocation.
### sap_ha_pacemaker_cluster_hana_colocation_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `col_saphana_vip__HDB_readonly` +- _Type:_ `string`
+- _Default:_ `col_saphana_vip__HDB_readonly`
Customize the cluster constraint name for VIP and SAPHana secondary clone colocation.
### sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout - -- _Type:_ `int` -- _Default:_ `7200` +- _Type:_ `int`
+- _Default:_ `7200`
Parameter for the 'SAPHana' cluster resource.
Time difference needed between to primary time stamps, if a dual-primary situation occurs.
@@ -382,46 +355,40 @@ If the time difference is less than the time gap, then the cluster holds one or This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.
### sap_ha_pacemaker_cluster_hana_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaFil__HDB` +- _Type:_ `string`
+- _Default:_ `cln_SAPHanaFil__HDB`
Customize the cluster resource name of the SAP HANA Filesystem clone.
### sap_ha_pacemaker_cluster_hana_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaFil__HDB` +- _Type:_ `string`
+- _Default:_ `rsc_SAPHanaFil__HDB`
Customize the cluster resource name of the SAP HANA Filesystem.
### sap_ha_pacemaker_cluster_hana_global_ini_path - -- _Type:_ `string` -- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini` +- _Type:_ `string`
+- _Default:_ `/usr/sap//SYS/global/hdb/custom/config/global.ini`
Path with location of global.ini for srHook update
### sap_ha_pacemaker_cluster_hana_hook_chksrv - -- _Type:_ `bool` -- _Default:_ `False` +- _Type:_ `bool`
+- _Default:_ `False`
Controls if ChkSrv srHook is enabled during srHook creation.
It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
### sap_ha_pacemaker_cluster_hana_hook_tkover - -- _Type:_ `bool` -- _Default:_ `False` +- _Type:_ `bool`
+- _Default:_ `False`
Controls if TkOver srHook is enabled during srHook creation.
It is ignored when sap_ha_pacemaker_cluster_hana_hooks is defined.
### sap_ha_pacemaker_cluster_hana_hooks - -- _Type:_ `list` -- _Default:_ `[]` +- _Type:_ `list`
+- _Default:_ `[]`
Customize required list of SAP HANA Hooks
Mandatory to include SAPHanaSR srHook in list.
@@ -429,753 +396,771 @@ Mandatory attributes are provider and path.
Example below shows mandatory SAPHanaSR, TkOver and ChkSrv hooks.
Example: - ```yaml sap_ha_pacemaker_cluster_hana_hooks: -- options: - - name: execution_order - value: 1 - path: /usr/share/SAPHanaSR/ - provider: SAPHanaSR -- options: - - name: execution_order - value: 2 - path: /usr/share/SAPHanaSR/ - provider: susTkOver -- options: - - name: execution_order - value: 3 - - name: action_on_lost - value: stop - path: /usr/share/SAPHanaSR/ - provider: susChkSrv + - options: + - name: execution_order + value: 1 + path: /usr/share/SAPHanaSR/ + provider: SAPHanaSR + - options: + - name: execution_order + value: 2 + path: /usr/share/SAPHanaSR/ + provider: susTkOver + - options: + - name: execution_order + value: 3 + - name: action_on_lost + value: stop + path: /usr/share/SAPHanaSR/ + provider: susChkSrv ``` - ### sap_ha_pacemaker_cluster_hana_instance_nr - -- _Type:_ `string` +- _Type:_ `string`
The instance number of the SAP HANA database which this role will configure in the cluster.
Inherits the value of `sap_hana_instance_number`, when defined.
-Mandatory for SAP HANA cluster setups.
+Mandatory for SAP HANA cluster scenarios.
### sap_ha_pacemaker_cluster_hana_order_hana_vip_primary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_primary` +- _Type:_ `string`
+- _Default:_ `ord_saphana_vip__HDB_primary`
Customize the cluster constraint name for VIP and SAPHana primary clone order.
### sap_ha_pacemaker_cluster_hana_order_hana_vip_secondary_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_vip__HDB_readonly` +- _Type:_ `string`
+- _Default:_ `ord_saphana_vip__HDB_readonly`
Customize the cluster constraint name for VIP and SAPHana secondary clone order.
### sap_ha_pacemaker_cluster_hana_order_topology_hana_name - -- _Type:_ `string` -- _Default:_ `ord_saphana_saphanatop__HDB` +- _Type:_ `string`
+- _Default:_ `ord_saphana_saphanatop__HDB`
Customize the cluster constraint name for SAPHana and Topology order.
### sap_ha_pacemaker_cluster_hana_prefer_site_takeover - -- _Type:_ `bool` -- _Default:_ `True` +- _Type:_ `bool`
+- _Default:_ `True`
Parameter for the 'SAPHana' cluster resource.
Set to "false" if the cluster should first attempt to restart the instance on the same node.
When set to "true" (default) a failover to secondary will be initiated on resource failure.
### sap_ha_pacemaker_cluster_hana_resource_clone_msl_name - -- _Type:_ `string` -- _Default:_ `msl_SAPHana__HDB` +- _Type:_ `string`
+- _Default:_ `msl_SAPHana__HDB`
Customize the cluster resource name of the SAP HANA DB resource master slave clone.
Master Slave clone is specific to Classic SAPHana resource on SUSE (non-angi).
### sap_ha_pacemaker_cluster_hana_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHana__HDB` +- _Type:_ `string`
+- _Default:_ `cln_SAPHana__HDB`
Customize the cluster resource name of the SAP HANA DB resource clone.
### sap_ha_pacemaker_cluster_hana_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHana__HDB` +- _Type:_ `string`
+- _Default:_ `rsc_SAPHana__HDB`
Customize the cluster resource name of the SAP HANA DB resource.
### sap_ha_pacemaker_cluster_hana_sid +- _Type:_ `string`
-- _Type:_ `string` - -The SAP HANA SID of the instance that will be configured in the cluster.
+The SAP HANA System ID (SID) of the instance that will be configured in the cluster.
The SID must follow SAP specifications - see SAP Note 1979280.
Inherits the value of `sap_hana_sid`, when defined.
-Mandatory for SAP HANA cluster setups.
+Mandatory for SAP HANA cluster scenarios.
### sap_ha_pacemaker_cluster_hana_topology_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaTop__HDB` +- _Type:_ `string`
+- _Default:_ `cln_SAPHanaTop__HDB`
Customize the cluster resource name of the SAP HANA Topology resource clone.
### sap_ha_pacemaker_cluster_hana_topology_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaTop__HDB` +- _Type:_ `string`
+- _Default:_ `rsc_SAPHanaTop__HDB`
Customize the cluster resource name of the SAP HANA Topology resource.
### sap_ha_pacemaker_cluster_hanacontroller_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_SAPHanaCon__HDB` +- _Type:_ `string`
+- _Default:_ `cln_SAPHanaCon__HDB`
Customize the cluster resource name of the SAP HANA Controller clone.
### sap_ha_pacemaker_cluster_hanacontroller_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPHanaCon__HDB` +- _Type:_ `string`
+- _Default:_ `rsc_SAPHanaCon__HDB`
Customize the cluster resource name of the SAP HANA Controller.
-### sap_ha_pacemaker_cluster_host_type +### sap_ha_pacemaker_cluster_healthcheck_hana_primary_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__HDB_primary`
+ +Name of the Virtual IP Health Check resource for primary HANA instance.
+ +### sap_ha_pacemaker_cluster_healthcheck_hana_secondary_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__HDB_readonly`
+ +Name of the Virtual IP Health Check resource for read-only HANA instance.
+ +### sap_ha_pacemaker_cluster_healthcheck_nwas_abap_aas_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__AAS`
+ +Name of the Virtual IP Health Check resource for NetWeaver AAS.
+ +### sap_ha_pacemaker_cluster_healthcheck_nwas_abap_pas_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__PAS`
+ +Name of the Virtual IP Health Check resource for NetWeaver PAS.
+ +### sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__ASCS`
+ +Name of the Virtual IP Health Check resource for NetWeaver ABAP Central Services (ASCS).
+ +### sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__ERS`
+ +Name of the Virtual IP Health Check resource for NetWeaver Enqueue Replication Service (ERS).
+ +### sap_ha_pacemaker_cluster_healthcheck_nwas_scs_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip_health_check__SCS`
+ +Name of the Virtual IP Health Check resource for NetWeaver Central Services (SCS).
-- _Type:_ `list` -- _Default:_ `hana_scaleup_perf` +### sap_ha_pacemaker_cluster_host_type +- _Type:_ `list`
+- _Default:_ `hana_scaleup_perf`
+- _Choices:_ `hana_scaleup_perf, nwas_abap_ascs_ers, nwas_java_scs_ers`
The SAP landscape to for which the cluster is to be configured.
The default is a 2-node SAP HANA scale-up cluster.
### sap_ha_pacemaker_cluster_ibmcloud_api_key - -- _Type:_ `string` +- _Type:_ `string`
The API key which is required to allow the control of instances (for example for fencing operations).
Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
### sap_ha_pacemaker_cluster_ibmcloud_powervs_api_type - -- _Type:_ `string` +- _Type:_ `string`
IBM Power Virtual Server API Endpoint type (public or private) dependent on network interface attachments for the target instances.
Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
### sap_ha_pacemaker_cluster_ibmcloud_powervs_forward_proxy_url - -- _Type:_ `string` +- _Type:_ `string`
IBM Power Virtual Server forward proxy url when IBM Power Virtual Server API Endpoint type is set to private.
When public network interface, can be ignored.
When private network interface, mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
### sap_ha_pacemaker_cluster_ibmcloud_powervs_workspace_crn - -- _Type:_ `string` +- _Type:_ `string`
IBM Power Virtual Server Workspace service cloud resource name (CRN) identifier which contains the target instances
Mandatory for the cluster setup on IBM Power Virtual Server from IBM Cloud.
### sap_ha_pacemaker_cluster_ibmcloud_region - -- _Type:_ `string` +- _Type:_ `string`
The IBM Cloud VS region name in which the instances are running.
Mandatory for the cluster setup on IBM Cloud Virtual Server instances or IBM Power Virtual Server on IBM Cloud.
### sap_ha_pacemaker_cluster_msazure_resource_group - -- _Type:_ `string` +- _Type:_ `string`
Resource group name/ID in which the target instances are defined.
Mandatory for the cluster setup on MS Azure instances.
### sap_ha_pacemaker_cluster_msazure_subscription_id - -- _Type:_ `string` +- _Type:_ `string`
Subscription ID of the MS Azure environment containing the target instances.
Mandatory for the cluster setup on MS Azure instances.
### sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr - -- _Type:_ `string` +- _Type:_ `string`
Instance number of the NetWeaver ABAP AAS instance.
Mandatory for NetWeaver AAS cluster configuration.
-### sap_ha_pacemaker_cluster_nwas_cs_ensa1 - -- _Type:_ `bool` -- _Default:_ `False` - -The standard NetWeaver Central Services (ASCS or SCS) cluster will be set up as ENSA2.
-Set this parameter to 'true' to configure it as ENSA1.
- -### sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - -- _Type:_ `bool` -- _Default:_ `True` - -Enables preferred method for Central Services (ASCS or SCS) ENSA2 clusters - Simple Mount.
-Set this parameter to 'true' to configure ENSA2 Simple Mount.
+### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name +Instance number of the NetWeaver ABAP PAS instance.
+Mandatory for NetWeaver PAS cluster configuration.
-- _Type:_ `string` -- _Default:_ `rsc_fs__ASCS` +### sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_fs__ASCS`
Name of the filesystem resource for the ASCS instance.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness - -- _Type:_ `string` -- _Default:_ `3000` - -NetWeaver ASCS resource group stickiness to prefer the ASCS group to stay on the node it was started on.
- ### sap_ha_pacemaker_cluster_nwas_ascs_instance_nr - -- _Type:_ `string` +- _Type:_ `string`
Instance number of the NetWeaver ABAP Central Services (ASCS) instance.
Mandatory for NetWeaver ASCS/ERS cluster configuration.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool - -- _Type:_ `bool` -- _Default:_ `False` +### sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name +- _Type:_ `string`
-NetWeaver ASCS instance resource option "AUTOMATIC_RECOVER".
+The name of the ASCS instance, typically the profile name.
+Mandatory for the NetWeaver ASCS/ERS cluster setup
+Recommended format _ASCS_
-### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout +### sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPInstance__ASCS`
-- _Type:_ `string` -- _Default:_ `60` +Name of the ASCS instance resource.
-NetWeaver Central Services (ASCS or SCS) instance failure-timeout attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
+### sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold +The full path and name of the ASCS instance profile.
+Mandatory for the NetWeaver ASCS/ERS cluster setup.
-- _Type:_ `string` -- _Default:_ `1` +### sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPStartSrv__ASCS`
-NetWeaver Central Services (ASCS or SCS) instance migration-threshold setting attribute.
-Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
+Name of the ASCS SAPStartSrv resource for simple mount.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name +### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name +- _Type:_ `string`
+- _Default:_ `col_ascs_separate_`
-- _Type:_ `string` +Customize the cluster constraint name for ASCS and ERS separation colocation.
-The name of the ASCS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup
-Recommended format _ASCS_.
+### sap_ha_pacemaker_cluster_nwas_colocation_scs_no_ers_name +- _Type:_ `string`
+- _Default:_ `col_ascs_separate_`
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name +Customize the cluster constraint name for SCS and ERS separation colocation.
-- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ASCS` +### sap_ha_pacemaker_cluster_nwas_cs_ensa1 +- _Type:_ `bool`
+- _Default:_ `False`
-Name of the ASCS instance resource.
+The standard NetWeaver Central Services cluster will be set up as ENSA2.
+Set this parameter to 'true' to configure it as ENSA1.
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness +### sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount +- _Type:_ `bool`
+- _Default:_ `True`
-- _Type:_ `string` -- _Default:_ `5000` +Enables preferred method for Central Services (ASCS or SCS) ENSA2 clusters - Simple Mount.
+Set this parameter to 'true' to configure ENSA2 Simple Mount.
-NetWeaver ASCS instance resource stickiness attribute.
+### sap_ha_pacemaker_cluster_nwas_cs_group_stickiness +- _Type:_ `string`
+- _Default:_ `3000`
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string +NetWeaver Central Services (ASCS and SCS) resource group stickiness.
+Defines how sticky is Central Services group to the node it was started on.
-- _Type:_ `string` +### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool +- _Type:_ `bool`
+- _Default:_ `False`
-The full path and name of the ASCS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
+NetWeaver Central Services (ASCS and SCS) instance resource option "AUTOMATIC_RECOVER".
-### sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name +### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout +- _Type:_ `string`
+- _Default:_ `60`
-- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ASCS` +NetWeaver Central Services (ASCS and SCS) instance failure-timeout attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
-Name of the ASCS SAPStartSrv resource for simple mount.
+### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold +- _Type:_ `string`
+- _Default:_ `1`
-### sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name +NetWeaver Central Services (ASCS and SCS) instance migration-threshold setting attribute.
+Only used for ENSA1 setups (see `sap_ha_pacemaker_cluster_nwas_cs_ensa1`). Default setup is ENSA2.
-- _Type:_ `string` -- _Default:_ `rsc_fs__ERS` +### sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness +- _Type:_ `string`
+- _Default:_ `5000`
-Name of the filesystem resource for the ERS instance.
+NetWeaver Central Services (ASCS and SCS) instance resource stickiness attribute.
-### sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr +### sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_fs__ERS`
-- _Type:_ `string` +Name of the filesystem resource for the ERS instance.
-Instance number of the NetWeaver ABAP ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster configuration.
+### sap_ha_pacemaker_cluster_nwas_ers_instance_nr +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_automatic_recover_bool +Instance number of the NetWeaver Enqueue Replication Service (ERS) instance.
+Mandatory for NetWeaver ASCS/ERS and SCS/ERS cluster configuration.
-- _Type:_ `bool` -- _Default:_ `False` +### sap_ha_pacemaker_cluster_nwas_ers_sapinstance_automatic_recover_bool +- _Type:_ `bool`
+- _Default:_ `False`
NetWeaver ERS instance resource option "AUTOMATIC_RECOVER".
-### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name - -- _Type:_ `string` +### sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name +- _Type:_ `string`
The name of the ERS instance, typically the profile name.
-Mandatory for the NetWeaver ASCS/ERS cluster setup.
+Mandatory for the NetWeaver ASCS/ERS and SCS/ERS clusters.
Recommended format _ERS_.
-### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_SAPInstance__ERS` +### sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPInstance__ERS`
Name of the ERS instance resource.
-### sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string - -- _Type:_ `string` +### sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string +- _Type:_ `string`
The full path and name of the ERS instance profile.
-Mandatory for the NetWeaver ASCS/ERS cluster.
- -### sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name +Mandatory for the NetWeaver ASCS/ERS and SCS/ERS clusters.
-- _Type:_ `string` -- _Default:_ `rsc_SAPStartSrv__ERS` +### sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPStartSrv__ERS`
Name of the ERS SAPstartSrv resource for simple mount.
-### sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr +### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name +- _Type:_ `string`
+- _Default:_ `ord_ascs_first_`
-- _Type:_ `string` +Customize the cluster constraint name for ASCS starting before ERS order.
-Instance number of the NetWeaver ABAP PAS instance.
-Mandatory for NetWeaver PAS cluster configuration.
+### sap_ha_pacemaker_cluster_nwas_order_scs_first_name +- _Type:_ `string`
+- _Default:_ `ord_ascs_first_`
-### sap_ha_pacemaker_cluster_nwas_sid +Customize the cluster constraint name for SCS starting before ERS order.
+ +### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name +- _Type:_ `string`
+- _Default:_ `cln_fs__sapmnt`
-- _Type:_ `string` +Filesystem resource clone name for the shared filesystem /sapmnt.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
-SID of the NetWeaver instances.
-Mandatory for NetWeaver cluster configuration.
-Uses `sap_swpm_sid` if defined.
-Mandatory for NetWeaver cluster setups.
+### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_fs__sapmnt`
-### sap_ha_pacemaker_cluster_nwas_colocation_ascs_no_ers_name +Filesystem resource name for the shared filesystem /sapmnt.
+Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
+Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
-- _Type:_ `string` -- _Default:_ `col_ascs_separate_` +### sap_ha_pacemaker_cluster_nwas_scs_filesystem_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_fs__SCS`
-Customize the cluster constraint name for ASCS and ERS separation colocation.
+Name of the filesystem resource for the SCS instance.
-### sap_ha_pacemaker_cluster_nwas_order_ascs_first_name +### sap_ha_pacemaker_cluster_nwas_scs_instance_nr +- _Type:_ `string`
-- _Type:_ `string` -- _Default:_ `ord_ascs_first_` +Instance number of the NetWeaver Central Services (SCS) instance.
+Mandatory for NetWeaver SCS/ERS cluster configuration.
-Customize the cluster constraint name for ASCS starting before ERS order.
+### sap_ha_pacemaker_cluster_nwas_scs_sapinstance_instance_name +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name +The name of the SCS instance, typically the profile name.
+Mandatory for the NetWeaver SCS/ERS cluster setup
+Recommended format _SCS_
-- _Type:_ `string` -- _Default:_ `cln_fs__sapmnt` +### sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPInstance__SCS`
-Filesystem resource clone name for the shared filesystem /sapmnt.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+Name of the SCS instance resource.
-### sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name +### sap_ha_pacemaker_cluster_nwas_scs_sapinstance_start_profile_string +- _Type:_ `string`
-- _Type:_ `string` -- _Default:_ `rsc_fs__sapmnt` +The full path and name of the SCS instance profile.
+Mandatory for the NetWeaver SCS/ERS cluster setup.
-Filesystem resource name for the shared filesystem /sapmnt.
-Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
-Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
+### sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_SAPStartSrv__SCS`
-### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed +Name of the SCS SAPStartSrv resource for simple mount.
-- _Type:_ `bool` -- _Default:_ `False` +### sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed +- _Type:_ `bool`
+- _Default:_ `False`
Change this parameter to 'true' if the 3 shared filesystems `/usr/sap/trans`, `/usr/sap//SYS` and '/sapmnt' shall be configured as cloned cluster resources.
-### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name +### sap_ha_pacemaker_cluster_nwas_sid +- _Type:_ `string`
-- _Type:_ `string` -- _Default:_ `cln_fs__sys` +System ID (SID) of the NetWeaver instances in Capital letters.
+Defaults to `sap_swpm_sid` if defined.
+Mandatory for NetWeaver cluster scenarios.
+ +### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name +- _Type:_ `string`
+- _Default:_ `cln_fs__sys`
Filesystem resource clone name for the shared filesystem /usr/sap//SYS.
Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
### sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__sys` +- _Type:_ `string`
+- _Default:_ `rsc_fs__sys`
Filesystem resource name for the transports filesystem /usr/sap//SYS.
Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name - -- _Type:_ `string` -- _Default:_ `cln_fs__trans` +- _Type:_ `string`
+- _Default:_ `cln_fs__trans`
Filesystem resource clone name for the shared filesystem /usr/sap/trans.
Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
### sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name - -- _Type:_ `string` -- _Default:_ `rsc_fs__trans` +- _Type:_ `string`
+- _Default:_ `rsc_fs__trans`
Filesystem resource name for the transports filesystem /usr/sap/trans.
Optional, this is typically managed by the OS, but can as well be added to the cluster configuration.
Enable this resource setup using `sap_ha_pacemaker_cluster_nwas_shared_filesystems_cluster_managed`.
### sap_ha_pacemaker_cluster_operation_defaults - -- _Type:_ `dict` -- _Default:_ `{'record-pending': True, 'timeout': 600}` +- _Type:_ `dict`
+- _Default:_ `{'record-pending': True, 'timeout': 600}`
Set default operation parameters that will be valid for all pacemaker resources.
Example: - ```yaml sap_ha_pacemaker_cluster_operation_defaults: record-pending: true timeout: 600 ``` - ### sap_ha_pacemaker_cluster_resource_defaults - -- _Type:_ `dict` -- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}` +- _Type:_ `dict`
+- _Default:_ `{'migration-threshold': 5000, 'resource-stickiness': 3000}`
Set default parameters that will be valid for all pacemaker resources.
Example: - ```yaml sap_ha_pacemaker_cluster_resource_defaults: migration-threshold: 5000 resource-stickiness: 1000 ``` - ### sap_ha_pacemaker_cluster_saphanasr_angi_detection - -- _Type:_ `string` -- _Default:_ `True` +- _Type:_ `string`
+- _Default:_ `True`
Disabling this variable enables to use Classic SAPHanaSR agents even on server, with SAPHanaSR-angi is available.
### sap_ha_pacemaker_cluster_sbd_devices - -- _Type:_ `list` +- _Type:_ `list`
Required if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide list of block devices for Stonith SBD agent
Example: - ```yaml sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 + - /dev/disk/by-id/scsi-3600 ``` - ### sap_ha_pacemaker_cluster_sbd_enabled - -- _Type:_ `bool` +- _Type:_ `bool`
Set this parameter to 'true' to enable workflow to add Stonith SBD resource.
Stonith SBD resource has to be provided as part of `sap_ha_pacemaker_cluster_stonith_custom`.
-Default SBD agents are: `stonith:external/sbd` for SUSE and `stonith:fence_sbd` for Red Hat.
+Default SBD agents are: stonith:external/sbd for SLES and stonith:fence_sbd for RHEL
Example: - ```yaml sap_ha_pacemaker_cluster_sbd_devices: -- /dev/disk/by-id/scsi-3600 + - /dev/disk/by-id/scsi-3600 sap_ha_pacemaker_cluster_sbd_enabled: true sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:external/sbd - id: stonith_sbd - instance_attrs: - - attrs: - - name: pcmk_delay_max - value: 15 + - agent: stonith:external/sbd + id: stonith_sbd + instance_attrs: + - attrs: + - name: pcmk_delay_max + value: 15 ``` - ### sap_ha_pacemaker_cluster_sbd_options - -- _Type:_ `list` +- _Type:_ `list`
Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide list of SBD specific options that are added into SBD configuration file.
Example: - ```yaml sap_ha_pacemaker_cluster_sbd_options: -- name: startmode - value: clean + - name: startmode + value: clean ``` - ### sap_ha_pacemaker_cluster_sbd_watchdog - -- _Type:_ `str` -- _Default:_ `/dev/watchdog` +- _Type:_ `str`
+- _Default:_ `/dev/watchdog`
Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide watchdog name to override default /dev/watchdog
### sap_ha_pacemaker_cluster_sbd_watchdog_modules - -- _Type:_ `list` +- _Type:_ `list`
Optional if `sap_ha_pacemaker_cluster_sbd_enabled` is enabled.
Provide list of watchdog kernel modules to be loaded (creates /dev/watchdog* devices).
Example: - ```yaml sap_ha_pacemaker_cluster_sbd_watchdog_modules: -- softdog + - softdog ``` - ### sap_ha_pacemaker_cluster_stonith_custom - -- _Type:_ `list` +- _Type:_ `list`
Custom list of STONITH resource(s) to be configured in the cluster.
This definition override any defaults the role would apply otherwise.
Definition follows structure of ha_cluster_resource_primitives in linux-system-roles/ha_cluster
- **agent**
- Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. +**Required**
+_Type:_ `str`
+Resource agent name, must contain the prefix "stonith:" to avoid mismatches or failures. - **id**
- Parameter `id` is required.
Name that will be used as the resource ID (name). +_Type:_ `str`
+Parameter `id` is required.
Name that will be used as the resource ID (name). - **instance_attrs**
- Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. +_Type:_ `list`
+Defines resource agent params as list of name/value pairs.
Requires the mandatory options for the particular stonith resource agent to be defined, otherwise the setup will fail.
Example: stonith:fence_sbd agent requires devices option with list of SBD disks.
Example: stonith:external/sbd agent does not require devices option, but `sap_ha_pacemaker_cluster_sbd_devices`. - **meta_attrs**
- Defines meta attributes as list of name/value pairs. +_Type:_ `list`
+Defines meta attributes as list of name/value pairs. - **name**
- WARNING! This option will be removed in future release. +_Type:_ `str`
+WARNING! This option will be removed in future release. - **operations**
- Defines list of resource agent operations. +_Type:_ `list`
+Defines list of resource agent operations. - **options**
- WARNING! This option will be removed in future release. +_Type:_ `dict`
+WARNING! This option will be removed in future release. Example: - ```yaml sap_ha_pacemaker_cluster_stonith_custom: -- agent: stonith:fence_rhevm - id: my-fence-resource - instance_attrs: - - attrs: - - name: ip - value: rhevm-server - - name: username - value: login-user - - name: password - value: login-user-password - - name: pcmk_host_list - value: node1,node2 - - name: power_wait - value: 3 - meta_attrs: - - attrs: - - name: target-role - value: Started - operations: - - action: start - attrs: - - name: interval - value: 0 - - name: timeout - value: 180 + - agent: stonith:fence_rhevm + id: my-fence-resource + instance_attrs: + - attrs: + - name: ip + value: rhevm-server + - name: username + value: login-user + - name: password + value: login-user-password + - name: pcmk_host_list + value: node1,node2 + - name: power_wait + value: 3 + meta_attrs: + - attrs: + - name: target-role + value: Started + operations: + - action: start + attrs: + - name: interval + value: 0 + - name: timeout + value: 180 ``` - ### sap_ha_pacemaker_cluster_storage_definition - -- _Type:_ `list` +- _Type:_ `list`
List of filesystem definitions used for filesystem cluster resources.
Options relevant, see example.
-Mandatory for SAP NetWeaver HA cluster configurations.
+Mandatory for SAP NetWeaver cluster without Simple Mount.
Reuse `sap_storage_setup_definition` if defined.
Reuse `sap_storage_setup_definition` will extract values 'mountpoint', 'nfs_filesystem_type', 'nfs_mount_options', 'nfs_path', 'nfs_server'.
Reuse `sap_storage_setup_definition` all options are documented under Ansible Role `sap_storage_setup`.
Note! For this variable, the argument specification does not list options, to avoid errors during reuse of `sap_storage_setup_definition` if defined.
Example: - ```yaml sap_ha_pacemaker_cluster_storage_definition: -- mountpoint: /usr/sap - name: usr_sap - nfs_path: /usr/sap - nfs_server: nfs-server.example.com:/ -- mountpoint: /usr/sap/trans - name: usr_sap_trans - nfs_path: /usr/sap/trans - nfs_server: nfs-server.example.com:/ -- mountpoint: /sapmnt - name: sapmnt - nfs_filesystem_type: nfs - nfs_mount_options: defaults - nfs_path: /sapmnt - nfs_server: nfs-server.example.com:/ + - mountpoint: /usr/sap + name: usr_sap + nfs_path: /usr/sap + nfs_server: nfs-server.example.com:/ + - mountpoint: /usr/sap/trans + name: usr_sap_trans + nfs_path: /usr/sap/trans + nfs_server: nfs-server.example.com:/ + - mountpoint: /sapmnt + name: sapmnt + nfs_filesystem_type: nfs + nfs_mount_options: defaults + nfs_path: /sapmnt + nfs_server: nfs-server.example.com:/ ``` - -### sap_ha_pacemaker_cluster_storage_nfs_filesytem_type - -- _Type:_ `string` -- _Default:_ `nfs` +### sap_ha_pacemaker_cluster_storage_nfs_filesystem_type +- _Type:_ `string`
+- _Default:_ `nfs`
Filesystem type of the NFS filesystems that are part of the cluster configuration.
### sap_ha_pacemaker_cluster_storage_nfs_mount_options - -- _Type:_ `string` -- _Default:_ `defaults` +- _Type:_ `string`
+- _Default:_ `defaults`
Mount options of the NFS filesystems that are part of the cluster configuration.
### sap_ha_pacemaker_cluster_storage_nfs_server - -- _Type:_ `string` +- _Type:_ `string`
Default address of the NFS server, if not defined individually by filesystem.
### sap_ha_pacemaker_cluster_system_roles_collection +- _Type:_ `string`
+- _Default:_ `fedora.linux_system_roles`
-- _Type:_ `string` -- _Default:_ `fedora.linux_system_roles` - -Set which Ansible Collection to use for the Linux System Roles.
-Available values: -- `fedora.linux_system_roles` - for community/upstream.
-- `redhat.rhel_system_roles` - for the RHEL System Roles for SAP, or for Red Hat Automation Hub.
+Reference to the Ansible Collection used for the Linux System Roles.
+For community/upstream, use 'fedora.linux_system_roles'.
+For RHEL System Roles for SAP, or Red Hat Automation Hub, use 'redhat.rhel_system_roles'.
### sap_ha_pacemaker_cluster_vip_client_interface - -- _Type:_ `string` +- _Type:_ `string`
OS device name of the network interface to use for the Virtual IP configuration.
When there is only one interface on the system, its name will be used by default.
### sap_ha_pacemaker_cluster_vip_hana_primary_ip_address - -- _Type:_ `string` +- _Type:_ `string`
The virtual IP of the primary HANA instance.
Mandatory parameter for HANA clusters.
### sap_ha_pacemaker_cluster_vip_hana_primary_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__HDB_primary`
-- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_primary` - -Customize the name of the resource managing the Virtual IP of the primary HANA instance.
+Name of the Virtual IP resource for primary HANA instance.
### sap_ha_pacemaker_cluster_vip_hana_secondary_ip_address - -- _Type:_ `string` +- _Type:_ `string`
The virtual IP for read-only access to the secondary HANA instance.
Optional parameter in HANA clusters.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address +### sap_ha_pacemaker_cluster_vip_hana_secondary_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__HDB_readonly`
+ +Name of the Virtual IP resource for read-only HANA instance.
-- _Type:_ `string` +### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_ip_address +- _Type:_ `string`
Virtual IP of the NetWeaver AAS instance.
Mandatory for NetWeaver AAS cluster setup.
### sap_ha_pacemaker_cluster_vip_nwas_abap_aas_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__AAS`
-- _Type:_ `string` -- _Default:_ `rsc_vip__AAS` +Name of the Virtual IP resource for NetWeaver AAS.
-Name of the SAPInstance resource for NetWeaver AAS.
+### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address +Virtual IP of the NetWeaver PAS instance.
+Mandatory for NetWeaver PAS cluster setup.
-- _Type:_ `string` +### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__PAS`
-Virtual IP of the NetWeaver ASCS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
+Name of the Virtual IP resource for NetWeaver PAS.
-### sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name +### sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address +- _Type:_ `string`
+ +Virtual IP of the NetWeaver ABAP Central Services (ASCS) instance.
+Mandatory for NetWeaver ASCS/ERS cluster setup.
-- _Type:_ `string` -- _Default:_ `grp__ASCS` +### sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name +- _Type:_ `string`
+- _Default:_ `grp__ASCS`
Name of the NetWeaver ASCS resource group.
### sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__ASCS`
-- _Type:_ `string` -- _Default:_ `rsc_vip__ASCS` - -Name of the SAPInstance resource for NetWeaver ASCS.
+Name of the Virtual IP resource for NetWeaver ABAP Central Services (ASCS).
### sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address +- _Type:_ `string`
-- _Type:_ `string` - -Virtual IP of the NetWeaver ERS instance.
-Mandatory for NetWeaver ASCS/ERS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name +Virtual IP of the NetWeaver Enqueue Replication Service (ERS) instance.
+Mandatory for NetWeaver ASCS/ERS and SCS/ERS cluster setup.
-- _Type:_ `string` -- _Default:_ `grp__ERS` +### sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name +- _Type:_ `string`
+- _Default:_ `grp__ERS`
Name of the NetWeaver ERS resource group.
### sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__ERS`
-- _Type:_ `string` -- _Default:_ `rsc_vip__ERS` +Name of the Virtual IP resource for NetWeaver Enqueue Replication Service (ERS).
-Name of the SAPInstance resource for NetWeaver ERS.
+### sap_ha_pacemaker_cluster_vip_nwas_scs_ip_address +- _Type:_ `string`
-### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_ip_address - -- _Type:_ `string` - -Virtual IP of the NetWeaver PAS instance.
-Mandatory for NetWeaver PAS cluster setup.
- -### sap_ha_pacemaker_cluster_vip_nwas_abap_pas_resource_name +Virtual IP of the NetWeaver Central Services (SCS) instance.
+Mandatory for NetWeaver SCS/ERS cluster setup.
-- _Type:_ `string` -- _Default:_ `rsc_vip__PAS` +### sap_ha_pacemaker_cluster_vip_nwas_scs_resource_group_name +- _Type:_ `string`
+- _Default:_ `grp__SCS`
-Name of the SAPInstance resource for NetWeaver PAS.
+Name of the NetWeaver SCS resource group.
-### sap_ha_pacemaker_cluster_vip_secondary_resource_name +### sap_ha_pacemaker_cluster_vip_nwas_scs_resource_name +- _Type:_ `string`
+- _Default:_ `rsc_vip__SCS`
-- _Type:_ `string` -- _Default:_ `rsc_vip__HDB_readonly` +Name of the Virtual IP resource for NetWeaver Central Services (SCS).
-Customize the name of the resource managing the Virtual IP of read-only access to the secondary HANA instance.
- \ No newline at end of file + diff --git a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml index 04f32397e..0c55ad7b3 100644 --- a/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml +++ b/roles/sap_ha_pacemaker_cluster/meta/argument_specs.yml @@ -79,7 +79,7 @@ argument_specs: - _Optional. Currently not needed/used in cluster configuration._ node_name: description: - - Name of the cluster node, should match the remote systems' hostnames. + - Hostname of the cluster node. - _Optional. Currently not needed/used in cluster configuration._ node_role: choices: @@ -399,9 +399,6 @@ argument_specs: sap_ha_pacemaker_cluster_hana_prefer_site_takeover: type: bool - choices: - - true - - false default: true description: - Parameter for the 'SAPHana' cluster resource. @@ -653,7 +650,7 @@ argument_specs: nfs_server: "nfs-server.example.com:/" - sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: + sap_ha_pacemaker_cluster_storage_nfs_filesystem_type: default: nfs description: - Filesystem type of the NFS filesystems that are part of the cluster configuration. From fce365c44350b1f72bd5e6042ab13a83a2be439a Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 7 Nov 2024 15:18:30 +0100 Subject: [PATCH 191/210] readme: updated supported scenarios --- roles/sap_ha_pacemaker_cluster/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/sap_ha_pacemaker_cluster/README.md b/roles/sap_ha_pacemaker_cluster/README.md index ff5823c1a..a74280e49 100644 --- a/roles/sap_ha_pacemaker_cluster/README.md +++ b/roles/sap_ha_pacemaker_cluster/README.md @@ -70,6 +70,10 @@ Managed nodes: | SAP HANA scale-up (performance-optimized) 2 nodes | SAPHanaSR-angi | :heavy_check_mark: | | SAP NetWeaver (ABAP) ASCS and ERS 2 nodes | Classic | :heavy_check_mark: | | SAP NetWeaver (ABAP) ASCS and ERS 2 nodes | Simple Mount | :heavy_check_mark: | +| SAP NetWeaver (JAVA) SCS and ERS 2 nodes | Classic | :heavy_check_mark: | +| SAP NetWeaver (JAVA) SCS and ERS 2 nodes | Simple Mount | :heavy_check_mark: | + +**NOTE: SAP Netweaver ASCS/ERS and SCS/ERS are ENSA2 by default, but ENSA1 is also supported.** From 5c6413bad119a3ef1a2e700fedcd0c4eb4a8cfdb Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 8 Nov 2024 14:32:54 +0100 Subject: [PATCH 192/210] sap_hana_preconfigure: Allow setting THP to any possible value Solves issue #885. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/README.md | 8 ++- roles/sap_hana_preconfigure/defaults/main.yml | 4 ++ roles/sap_hana_preconfigure/handlers/main.yml | 12 ++--- .../meta/argument_specs.yml | 12 +++++ .../tasks/RedHat/generic/assert-thp.yml | 8 +++ .../tasks/RedHat/generic/configure-thp.yml | 54 +++++++++---------- 6 files changed, 59 insertions(+), 39 deletions(-) diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index d96e075b0..52014f2a4 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -416,6 +416,12 @@ Set this parameter to `true` to modify the Grub boot command line.
By default, the role will run `grub2-mkconfig` to update the Grub configuration if necessary.
Set this parameter to `false` if this is not desired.
+### sap_hana_preconfigure_thp +- _Type:_ `str` +- _Default:_ `` + +Override the default setting for THP, which is determined automatically by the role, depending on the RHEL version. + ### sap_hana_preconfigure_db_group_name - _Type:_ `str` @@ -449,4 +455,4 @@ Available values: `HANA`, `NETWEAVER+HANA`, `S4HANA-APP+DB`, `S4HANA-DBSERVER` (SUSE specific) On Azure, TCP timestamps, reuse and recycle should be disabled.
If the variable is set, an override file for saptune will be created (/etc/saptune/override/2382421) to set net.ipv4.tcp_timestamps and net.ipv4.tcp_tw_reuse to 0.
Set this parameter to `true` on Azure.
- \ No newline at end of file + diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index 55e1ec05f..393a1b016 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -166,6 +166,10 @@ sap_hana_preconfigure_run_grub2_mkconfig: true # It will be used to configure process limits as per step "Configuring Process Resource Limits" of SAP note 2772999. # Example: See README.md +# sap_hana_preconfigure_thp: (not defined by default) +# Override the default setting for THP, which is determined automatically by the role, depending on the RHEL version. +# Can be one of 'always', 'madvise', or 'never'. + # (SUSE specific) Version of saptune to install. # It is recommended to install latest version by keeping this variable empty. # This will replace the current installed version if present, even downgrade if necessary. diff --git a/roles/sap_hana_preconfigure/handlers/main.yml b/roles/sap_hana_preconfigure/handlers/main.yml index 542984485..4f3887f6f 100644 --- a/roles/sap_hana_preconfigure/handlers/main.yml +++ b/roles/sap_hana_preconfigure/handlers/main.yml @@ -75,16 +75,10 @@ listen: __sap_hana_preconfigure_grubby_update_handler notify: __sap_hana_preconfigure_reboot_handler -- name: "Run grubby for disabling THP" - ansible.builtin.command: grubby --args="transparent_hugepage=never" --update-kernel=ALL +- name: "Run grubby for setting THP to '{{ __sap_hana_preconfigure_fact_thp }}'" + ansible.builtin.command: grubby --args="transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}" --update-kernel=ALL changed_when: true - listen: __sap_hana_preconfigure_grubby_thp_never_handler - notify: __sap_hana_preconfigure_reboot_handler - -- name: "Run grubby for setting THP to madvise" - ansible.builtin.command: grubby --args="transparent_hugepage=madvise" --update-kernel=ALL - changed_when: true - listen: __sap_hana_preconfigure_grubby_thp_madvise_handler + listen: __sap_hana_preconfigure_grubby_thp_handler notify: __sap_hana_preconfigure_reboot_handler - name: Reboot the managed node diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index ecb0c5cdb..098aa7db4 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -341,6 +341,18 @@ argument_specs: required: false type: bool + sap_hana_preconfigure_thp: + default: '' + description: + - Override the default setting for THP, which is determined automatically by the role, depending on the RHEL version. + choices: + - '' + - 'always' + - 'madvise' + - 'never' + required: false + type: str + sap_hana_preconfigure_db_group_name: description: - Use this parameter to specify the name of the RHEL group which is used for the database processes. diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index ba356730e..b13bf9966 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -27,6 +27,7 @@ ansible.builtin.set_fact: __sap_hana_preconfigure_fact_thp: 'never' when: + - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - ansible_distribution == 'RedHat' - ansible_distribution_major_version == '7' or ansible_distribution_major_version == '8' or @@ -37,10 +38,17 @@ ansible.builtin.set_fact: __sap_hana_preconfigure_fact_thp: 'madvise' when: + - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - ansible_distribution == 'RedHat' - ansible_distribution_major_version == '9' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 + - name: Set fact for THP if 'sap_hana_preconfigure_thp' is defined + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: "{{ sap_hana_preconfigure_thp }}" + when: + - sap_hana_preconfigure_thp is defined and sap_hana_preconfigure_thp + - name: Assert that 'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' is in GRUB_CMDLINE_LINUX in /etc/default/grub ansible.builtin.assert: that: "'transparent_hugepage={{ __sap_hana_preconfigure_fact_thp }}' in __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert.stdout" diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml index 7d056aa1a..1c60776b9 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml @@ -6,27 +6,37 @@ src: /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_thp -- name: Set THP to 'never' at boot time - ansible.builtin.command: /bin/true - notify: __sap_hana_preconfigure_grubby_thp_never_handler - changed_when: true +- name: Set fact for THP, RHEL up to RHEL 9.1 + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: 'never' when: + - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '8' or + - ansible_distribution_major_version == '7' or + ansible_distribution_major_version == '8' or ansible_distribution_version == '9.0' or ansible_distribution_version == '9.1' - - not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=never') ) - tags: grubconfig -- name: Set THP to 'madvise' at boot time - ansible.builtin.command: /bin/true - notify: __sap_hana_preconfigure_grubby_thp_madvise_handler - changed_when: true +- name: Set fact for THP, RHEL 9.2 and later + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: 'madvise' when: + - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - ansible_distribution == 'RedHat' - ansible_distribution_major_version == '9' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 - - not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=madvise') ) + +- name: Set fact for THP if 'sap_hana_preconfigure_thp' is defined + ansible.builtin.set_fact: + __sap_hana_preconfigure_fact_thp: "{{ sap_hana_preconfigure_thp }}" + when: + - sap_hana_preconfigure_thp is defined and sap_hana_preconfigure_thp + +- name: Set THP to '{{ __sap_hana_preconfigure_fact_thp }}' at boot time + ansible.builtin.command: /bin/true + notify: __sap_hana_preconfigure_grubby_thp_handler + changed_when: true + when: not ( __sap_hana_preconfigure_register_proc_cmdline_thp['content'] | b64decode | regex_findall('transparent_hugepage=' + __sap_hana_preconfigure_fact_thp) ) tags: grubconfig - name: Configure - Get initial status of THP @@ -34,24 +44,10 @@ register: __sap_hana_preconfigure_register_thp_status_before changed_when: false -- name: Set THP to 'never' on the running system - ansible.builtin.shell: echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled +- name: Set THP to '{{ __sap_hana_preconfigure_fact_thp }}' on the running system + ansible.builtin.shell: echo '{{ __sap_hana_preconfigure_fact_thp }}' > /sys/kernel/mm/transparent_hugepage/enabled changed_when: true - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '8' or - ansible_distribution_version == '9.0' or - ansible_distribution_version == '9.1' - - __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != 'never' - -- name: Set THP to 'madvise' on the running system - ansible.builtin.shell: echo 'madvise' > /sys/kernel/mm/transparent_hugepage/enabled - changed_when: true - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version == '9' and - __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2 - - __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != 'madvise' + when: __sap_hana_preconfigure_register_thp_status_before.stdout.split('[')[1].split(']')[0] != __sap_hana_preconfigure_fact_thp - name: Configure - Get the status of THP ansible.builtin.command: cat /sys/kernel/mm/transparent_hugepage/enabled From c2815e974d2e5c3404543c89f4631fef7c4f2918 Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Thu, 14 Nov 2024 10:21:16 +0100 Subject: [PATCH 193/210] Add list of deprecated variables --- .../DEPRECATED_VARIABLES.md | 53 +++++++++++++++++++ .../defaults/main.yml | 2 +- .../construct_vars_nwas_abap_ascs_ers.yml | 2 +- .../tasks/construct_vars_nwas_common.yml | 2 +- .../construct_vars_nwas_java_scs_ers.yml | 2 +- .../tasks/include_vars_nwas.yml | 7 +++ 6 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md diff --git a/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md b/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md new file mode 100644 index 000000000..bd066a84f --- /dev/null +++ b/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md @@ -0,0 +1,53 @@ +# sap_ha_pacemaker_cluster Deprecated input variables + +This deprecation of input variables is part of an ongoing effort to improve the codebase by removing unnecessary elements and streamlining the overall design. + +These variables fall into a few categories: +- **Obsolete or unused** + - These variables are no longer used and are being removed to reduce technical debt and potential confusion. +- **Renamed** + - These variables are being renamed to better reflect their current purpose and improve code readability. + - This is especially important when the variable's functionality has evolved over time. + +## Backwards compatibility +All deprecated variables offer time limited backwards compatibility that will be removed in future. + +## List of deprecated input variables +| Old variable | New variable | Backwards compatible | Reason | +| -------- | --------- | --------- | --------- | +| sap_ha_pacemaker_cluster_nwas_abap_sid | sap_ha_pacemaker_cluster_nwas_sid | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | sap_ha_pacemaker_cluster_nwas_ers_instance_nr | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name | sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name | sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness | sap_ha_pacemaker_cluster_nwas_cs_group_stickiness | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 | sap_ha_pacemaker_cluster_nwas_cs_ensa1 | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount | sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name | sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name | sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name | sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name | sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name | sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name | sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id | sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id | sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | :heavy_check_mark: | Removal of `_abap_` | +| sap_ha_pacemaker_cluster_storage_nfs_filesytem_type | sap_ha_pacemaker_cluster_storage_nfs_filesystem_type | :heavy_check_mark: | Typo | + + +## Status explanation: +- :heavy_check_mark: - Variable is removed from defaults and readme, but still supported. +- :x: - Variable is completely removed and not supported diff --git a/roles/sap_ha_pacemaker_cluster/defaults/main.yml b/roles/sap_ha_pacemaker_cluster/defaults/main.yml index 7fe1cbe00..7947b0afe 100644 --- a/roles/sap_ha_pacemaker_cluster/defaults/main.yml +++ b/roles/sap_ha_pacemaker_cluster/defaults/main.yml @@ -181,7 +181,7 @@ sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr: '' # Mandatory instance num # Definitions for filesystems resources. Currently limited to NFS filesystems. sap_ha_pacemaker_cluster_storage_definition: "{{ sap_storage_setup_definition | d([]) }}" -sap_ha_pacemaker_cluster_storage_nfs_filesytem_type: nfs +sap_ha_pacemaker_cluster_storage_nfs_filesystem_type: nfs sap_ha_pacemaker_cluster_storage_nfs_mount_options: 'defaults' sap_ha_pacemaker_cluster_storage_nfs_server: "{{ sap_storage_nfs_server | d('') }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml index 71e5e6aa0..8a77aa38b 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_abap_ascs_ers.yml @@ -100,7 +100,7 @@ {% if def.nfs_filesystem_type is defined -%} {{ def.nfs_filesystem_type }} {%- else -%} - {{ sap_ha_pacemaker_cluster_storage_nfs_filesytem_type }} + {{ __sap_ha_pacemaker_cluster_storage_nfs_filesystem_type }} {%- endif %} {%- endif %} {%- endfor %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 8ed64fee3..98da80afd 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -120,7 +120,7 @@ value: 40 # Format input variables to make above construction code more readable. - __fstype: "{{ commonfs_item.nfs_filesystem_type | d(sap_ha_pacemaker_cluster_storage_nfs_filesytem_type) }}" + __fstype: "{{ commonfs_item.nfs_filesystem_type | d(__sap_ha_pacemaker_cluster_storage_nfs_filesystem_type) }}" __mount_opts: "{{ commonfs_item.nfs_mount_options | d(sap_ha_pacemaker_cluster_storage_nfs_mount_options) }}" __nfs_server: "{{ commonfs_item.nfs_server | d(sap_ha_pacemaker_cluster_storage_nfs_server) | regex_replace('/$', '') }}" __nfs_path: |- diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml index 791a0f198..0756a6a1d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_java_scs_ers.yml @@ -101,7 +101,7 @@ {% if def.nfs_filesystem_type is defined -%} {{ def.nfs_filesystem_type }} {%- else -%} - {{ sap_ha_pacemaker_cluster_storage_nfs_filesytem_type }} + {{ __sap_ha_pacemaker_cluster_storage_nfs_filesystem_type }} {%- endif %} {%- endif %} {%- endfor %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml index baa6ecb92..3b18c0155 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml @@ -381,3 +381,10 @@ # "Filesystem_NWAS_ABAP_AAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" # sap_ha_pacemaker_cluster_nwas_abap_aas_sapinstance_resource_name: > # "SAPInstance_NWAS_ABAP_AAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_aas_instance_nr }}" + + +- name: "SAP HA Prepare Pacemaker - Set variables for NFS Filesystems (Netweaver)" + ansible.builtin.set_fact: + # TODO: Remove backwards compatibility to typo + __sap_ha_pacemaker_cluster_storage_nfs_filesystem_type: + "{{ sap_ha_pacemaker_cluster_storage_nfs_filesytem_type | d(sap_ha_pacemaker_cluster_storage_nfs_filesystem_type) }}" From a31a63b5a267e6ac04eb0a1b52cc424610eb4f62 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Thu, 14 Nov 2024 14:20:34 +0100 Subject: [PATCH 194/210] change changed_when to true --- roles/sap_general_preconfigure/tasks/RedHat/installation.yml | 2 +- roles/sap_general_preconfigure/tasks/SLES/installation.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 79fd9eeec..aef0aa515 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -279,5 +279,5 @@ - name: Call Reboot handler if necessary ansible.builtin.command: /bin/true notify: __sap_general_preconfigure_reboot_handler - changed_when: false + changed_when: true when: __sap_general_preconfigure_register_needs_restarting is failed diff --git a/roles/sap_general_preconfigure/tasks/SLES/installation.yml b/roles/sap_general_preconfigure/tasks/SLES/installation.yml index 5f78c2e5d..503256895 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/installation.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/installation.yml @@ -99,5 +99,5 @@ - name: Call Reboot handler if necessary ansible.builtin.command: /bin/true notify: __sap_general_preconfigure_reboot_handler - changed_when: false + changed_when: true when: __sap_general_preconfigure_register_needs_restarting is failed From b81f5e840907e2dcec7848daf0ed57596eb6ea14 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 15 Nov 2024 18:20:46 +0100 Subject: [PATCH 195/210] sap_hana_preconfigure: No longer set net.core.somaxconn in RHEL 9 Solves issue #782. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/vars/RedHat_9.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 2ce0194b9..573d10263 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -120,14 +120,14 @@ __sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: # required SAP notes for RHEL 9: __sap_hana_preconfigure_sapnotes_versions_x86_64: - - { number: '3108302', version: '9' } - - { number: '2382421', version: '45' } + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } - { number: '3024346', version: '11' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '90' } - - { number: '3108302', version: '9' } - - { number: '2382421', version: '45' } + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } - { number: '3024346', version: '11' } __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" @@ -249,8 +249,7 @@ __sap_hana_preconfigure_required_ppc64le: # Network related kernel parameters as set in SAP Note 2382421: __sap_hana_preconfigure_kernel_parameters_default: -# The following two parameter should always be set: - - { name: net.core.somaxconn, value: 4096 } +# The following parameter should always be set: - { name: net.ipv4.tcp_max_syn_backlog, value: 8192 } # The following two parameters are automatically set by SAP Host Agent # - { name: net.ipv4.ip_local_port_range, value: "40000 61000" } From a03bae6f64dd80c2ddfab381956fc4aa5c46aa7e Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 18 Nov 2024 16:53:54 +0100 Subject: [PATCH 196/210] sap_netweaver_preconfigure: Sync with applicable SAP notes for Adobe DS Solves issue #689. Further changes in this commit: - Add the SAP note numbers and versions in a comment before the list of packages in the RedHat*.yml files in vars. - Add 'ansible_architecture' as a condition in the related installation task, so that there is no task failure when running on another architecture than 'x86_64'. - Also revert back to the default of 'false' for the role variable 'sap_netweaver_preconfigure_use_adobe_doc_services'. See commit 384f4d82, PR #876. Signed-off-by: Bernd Finger --- .../defaults/main.yml | 2 +- .../tasks/RedHat/installation.yml | 6 ++++-- .../vars/RedHat_7.yml | 17 +++++++++-------- .../vars/RedHat_8.yml | 2 +- .../vars/RedHat_9.yml | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/roles/sap_netweaver_preconfigure/defaults/main.yml b/roles/sap_netweaver_preconfigure/defaults/main.yml index 36afc47db..0a458da5b 100644 --- a/roles/sap_netweaver_preconfigure/defaults/main.yml +++ b/roles/sap_netweaver_preconfigure/defaults/main.yml @@ -14,7 +14,7 @@ sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured: true sap_netweaver_preconfigure_rpath: '/usr/sap/lib' -sap_netweaver_preconfigure_use_adobe_doc_services: true +sap_netweaver_preconfigure_use_adobe_doc_services: false # (SUSE specific) Version of saptune to install. # It is recommended to install latest version by keeping this variable empty. diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml index 551c046f8..bbd3763b0 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml @@ -6,8 +6,10 @@ state: present name: "{{ __sap_netweaver_preconfigure_packages }}" -- name: Ensure required packages for Adobe Document Services are installed +- name: Ensure required packages for Adobe Document Services are installed, x86_64 only ansible.builtin.package: state: present name: "{{ __sap_netweaver_preconfigure_adobe_doc_services_packages }}" - when: sap_netweaver_preconfigure_use_adobe_doc_services + when: + - ansible_architecture == 'x86_64' + - sap_netweaver_preconfigure_use_adobe_doc_services diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml index 4e8fe4de5..1443046a3 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_7.yml @@ -12,6 +12,7 @@ __sap_netweaver_preconfigure_sapnotes_versions: __sap_netweaver_preconfigure_packages: - tuned-profiles-sap +# SAP note 2135057 v11: __sap_netweaver_preconfigure_adobe_doc_services_packages: - autoconf.noarch - automake.noarch @@ -19,26 +20,26 @@ __sap_netweaver_preconfigure_adobe_doc_services_packages: - expat.x86_64 - fontconfig.x86_64 - freetype.x86_64 - - glibc.x86_64 - - glibc-devel.x86_64 + - glibc.i686 + - glibc-devel.i686 - keyutils-libs.x86_64 - krb5-libs.x86_64 - libcom_err.x86_64 - - libgcc.x86_64 + - libgcc.i686 - libidn.x86_64 - libidn-devel.x86_64 - libselinux.x86_64 - libssh2.x86_64 - - libX11.x86_64 - - libXau.x86_64 - - libxcb.x86_64 + - libX11.i686 + - libXau.i686 + - libxcb.i686 - nspr.x86_64 - nss.x86_64 - nss-softokn.x86_64 - - nss-softokn-freebl.x86_64 + - nss-softokn-freebl.i686 - nss-util.x86_64 - openldap.x86_64 - openssl.x86_64 - transfig.x86_64 - zlib.x86_64 - - libuuid.x86_64 + - libuuid.i686 diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml index c74c0a8b7..ad9dba4ea 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_8.yml @@ -14,6 +14,7 @@ __sap_netweaver_preconfigure_sapnotes_versions: __sap_netweaver_preconfigure_packages: - tuned-profiles-sap +# SAP note 2920407 v6: __sap_netweaver_preconfigure_adobe_doc_services_packages: - autoconf.noarch - automake.noarch @@ -26,7 +27,6 @@ __sap_netweaver_preconfigure_adobe_doc_services_packages: - libcom_err.x86_64 - libidn2.x86_64 - libselinux.x86_64 - - libssh2.x86_64 - libxcb.i686 - nspr.x86_64 - nss.x86_64 diff --git a/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml b/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml index 07320f104..b6ad0222e 100644 --- a/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_netweaver_preconfigure/vars/RedHat_9.yml @@ -12,6 +12,7 @@ __sap_netweaver_preconfigure_sapnotes_versions: __sap_netweaver_preconfigure_packages: - tuned-profiles-sap +# SAP note 3242422 v2: __sap_netweaver_preconfigure_adobe_doc_services_packages: - autoconf.noarch - automake.noarch @@ -24,7 +25,6 @@ __sap_netweaver_preconfigure_adobe_doc_services_packages: - libcom_err.x86_64 - libidn2.x86_64 - libselinux.x86_64 - - libssh2.x86_64 - libxcb.i686 - nspr.x86_64 - nss.x86_64 From c1def5b52c6cba842221e8c0c05cb0c546c96650 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 20 Nov 2024 16:22:40 +0100 Subject: [PATCH 197/210] sap_swpm: Fix issues with localhost delegation on certain control nodes Solves issue #890. Signed-off-by: Bernd Finger --- .../detect_variables_from_inifile.yml | 20 +++----- .../tasks/pre_install/generate_inifile.yml | 49 +++---------------- .../tasks/pre_install/swpm_prepare.yml | 10 ---- 3 files changed, 15 insertions(+), 64 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml index 541378960..a70e6479e 100644 --- a/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/detect_variables_from_inifile.yml @@ -6,14 +6,13 @@ ansible.builtin.command: | awk 'BEGIN{IGNORECASE=1;a=0} /Product ID/&&a==0{a=1; gsub ("#", ""); gsub ("\047", ""); product_id=$NF} - END{print product_id}' {{ sap_swpm_tmpdir_local.path }}/inifile.params - delegate_to: localhost + END{print product_id}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_product_id_detect changed_when: false - name: SAP SWPM Pre Install - Report if 'sap_swpm_product_catalog_id' has been defined differently ansible.builtin.debug: - msg: "NOTE: The Product ID in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_inifile_product_id_detect'." + msg: "NOTE: The Product ID in '{{ sap_swpm_tmpdir.path }}/inifile.params' is different from the role parameter 'sap_swpm_inifile_product_id_detect'." when: - sap_swpm_product_catalog_id - sap_swpm_inifile_product_id_detect.stdout != sap_swpm_product_catalog_id @@ -25,14 +24,13 @@ # Detect and set Software Path - name: SAP SWPM Pre Install - Detect Software Path from inifile ansible.builtin.command: | - awk '!/^#/&&/archives.downloadBasket/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params - delegate_to: localhost + awk '!/^#/&&/archives.downloadBasket/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_software_path_detect changed_when: false - name: SAP SWPM Pre Install - Report if 'sap_swpm_software_path' has been defined differently ansible.builtin.debug: - msg: "NOTE: The Software Path in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_software_path'." + msg: "NOTE: The Software Path in '{{ sap_swpm_tmpdir.path }}/inifile.params' is different from the role parameter 'sap_swpm_software_path'." when: - sap_swpm_software_path - sap_swpm_inifile_software_path_detect.stdout != sap_swpm_software_path @@ -44,14 +42,13 @@ # Detect and set SID - name: SAP SWPM Pre Install - Detect SID from inifile ansible.builtin.command: | - awk '!/^#/&&/NW_GetSidNoProfiles.sid/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params - delegate_to: localhost + awk '!/^#/&&/NW_GetSidNoProfiles.sid/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_sid_detect changed_when: false - name: SAP SWPM Pre Install - Report if 'sap_swpm_sid' has been defined differently ansible.builtin.debug: - msg: "NOTE: The SID in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_sid'." + msg: "NOTE: The SID in '{{ sap_swpm_tmpdir.path }}/inifile.params' is different from the role parameter 'sap_swpm_sid'." when: - sap_swpm_sid - sap_swpm_inifile_sid_detect.stdout != sap_swpm_sid @@ -63,14 +60,13 @@ # Detect and set FQDN - name: SAP SWPM Pre Install - Detect FQDN from inifile ansible.builtin.command: | - awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir_local.path }}/inifile.params - delegate_to: localhost + awk '!/^#/&&/NW_getFQDN.FQDN/{print $3}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_fqdn_detect changed_when: false - name: SAP SWPM Pre Install - Report if 'sap_swpm_fqdn' has been defined differently ansible.builtin.debug: - msg: "NOTE: The FQDN in '{{ sap_swpm_tmpdir_local.path }}/inifile.params' is different from the role parameter 'sap_swpm_fqdn'." + msg: "NOTE: The FQDN in '{{ sap_swpm_tmpdir.path }}/inifile.params' is different from the role parameter 'sap_swpm_fqdn'." when: - sap_swpm_fqdn - sap_swpm_inifile_sid_detect.stdout != sap_swpm_fqdn diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 53f4809ff..979bb0633 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -24,27 +24,19 @@ ansible.builtin.debug: msg: "INFO: Using existing sapinst inifile '{{ sap_swpm_inifile_directory }}/inifile.params'." -# Note: Attempting to fetch and store into sap_swpm_tmpdir_local.path results in a 'Permission denied' error. -# So we are using 'slurp' and 'copy' for this purpose. - - name: SAP SWPM Pre Install, existing inifile - Slurp the remote 'inifile.params' for copying to control node - ansible.builtin.slurp: - src: "{{ sap_swpm_inifile_directory }}/inifile.params" - register: sap_swpm_slurped_remote_inifile - - - name: SAP SWPM Pre Install, existing inifile - Copy 'inifile.params' to the control node +# - name: SAP SWPM Pre Install, existing inifile - Copy 'inifile.params' to the control node + - name: SAP SWPM Pre Install, existing inifile - Copy 'inifile.params' to sap_swpm_tmpdir ansible.builtin.copy: - content: "{{ sap_swpm_slurped_remote_inifile['content'] | b64decode }}" - dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + src: "{{ sap_swpm_inifile_directory }}/inifile.params" + dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" owner: 'root' group: 'root' mode: '0640' - delegate_to: localhost # Now we need to confirm that des25 is not in the inifile - name: SAP SWPM Pre Install, existing inifile - Search inifile for for des25 ansible.builtin.shell: | - set -o pipefail && awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' {{ sap_swpm_tmpdir_local.path }}/inifile.params - delegate_to: localhost + set -o pipefail && awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_count_des25 changed_when: false @@ -123,11 +115,10 @@ - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for for creating 'inifile.params' ansible.builtin.template: src: "{{ role_path }}/templates/inifile_params.j2" - dest: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" owner: 'root' group: 'root' mode: '0640' - delegate_to: localhost when: - sap_swpm_inifile_sections_list is defined - sap_swpm_inifile_sections_list | length > 0 @@ -141,7 +132,7 @@ - name: SAP SWPM Pre Install, create inifile - Configure entries in 'inifile.params' from 'sap_swpm_inifile_parameters_dict' ansible.builtin.lineinfile: - path: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" + path: "{{ sap_swpm_tmpdir.path }}/inifile.params" create: true state: present line: "{{ sap_swpm_line_item.key }} = {{ sap_swpm_line_item.value }}" @@ -153,12 +144,10 @@ loop_control: loop_var: sap_swpm_line_item register: replace_result - delegate_to: localhost - name: SAP SWPM Pre Install, create inifile - Detect variables again if 'sap_swpm_inifile_parameters_dict' had been used ansible.builtin.import_tasks: file: detect_variables_from_inifile.yml - delegate_to: localhost - name: SAP SWPM Pre Install, create inifile - Display these variables again if 'sap_swpm_inifile_parameters_dict' had been used ansible.builtin.debug: @@ -167,27 +156,3 @@ - "sap_swpm_software_path: >{{ sap_swpm_software_path }}<" - "sap_swpm_sid: >{{ sap_swpm_sid }}<" - "sap_swpm_fqdn: >{{ sap_swpm_fqdn }}<" - delegate_to: localhost - -- name: SAP SWPM Pre Install - Display the path of the local 'inifile.params' - ansible.builtin.debug: - msg: "The local inifile.params is: '{{ sap_swpm_tmpdir_local.path }}/inifile.params'" - tags: sap_swpm_generate_inifile - -- name: SAP SWPM Pre Install - Slurp the local 'inifile.params' for copying to managed node - ansible.builtin.slurp: - src: "{{ sap_swpm_tmpdir_local.path }}/inifile.params" - register: sap_swpm_slurped_local_inifile - delegate_to: localhost - -- name: SAP SWPM Pre Install - Copy 'inifile.params' to the managed node - ansible.builtin.copy: - content: "{{ sap_swpm_slurped_local_inifile['content'] | b64decode }}" - dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" - owner: 'root' - group: 'root' - mode: '0640' - -- name: SAP SWPM Pre Install - Display the path of the remote 'inifile.params' - ansible.builtin.debug: - msg: "The local inifile.params has been copied to: '{{ sap_swpm_tmpdir.path }}/inifile.params'" diff --git a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml index f2ae6cb62..6a1915edb 100644 --- a/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml +++ b/roles/sap_swpm/tasks/pre_install/swpm_prepare.yml @@ -1,16 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 --- -- name: SAP SWPM Pre Install - Create temporary directory on control node - ansible.builtin.tempfile: - state: directory - suffix: _swpm_tmp - delegate_to: localhost - register: sap_swpm_tmpdir_local - tags: - - sap_swpm_generate_inifile - - sap_swpm_sapinst_commandline - - name: SAP SWPM Pre Install - Create temporary directory on managed node ansible.builtin.tempfile: state: directory From 0bcbf2dafaffda3404d816d00a81d08c8bd93d90 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 21 Nov 2024 10:07:44 +0100 Subject: [PATCH 198/210] sap_swpm: Fix two typos in task names Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install/generate_inifile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 979bb0633..7a53ba7bb 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -34,7 +34,7 @@ mode: '0640' # Now we need to confirm that des25 is not in the inifile - - name: SAP SWPM Pre Install, existing inifile - Search inifile for for des25 + - name: SAP SWPM Pre Install, existing inifile - Search inifile for des25 ansible.builtin.shell: | set -o pipefail && awk 'BEGIN{a=0}!/^#/&&/des25\(/{a++}END{print a}' {{ sap_swpm_tmpdir.path }}/inifile.params register: sap_swpm_inifile_count_des25 @@ -112,7 +112,7 @@ sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params - - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for for creating 'inifile.params' + - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for creating 'inifile.params' ansible.builtin.template: src: "{{ role_path }}/templates/inifile_params.j2" dest: "{{ sap_swpm_tmpdir.path }}/inifile.params" From 5404749d37a4e7440ed7af929f554ca3b548c2ff Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 22 Nov 2024 09:45:53 +0100 Subject: [PATCH 199/210] sap_hana_preconfigure: Add compat-sap-c++-13 SAP HANA 2.0 SPS08 is built with GCC13, so we need to install compat-sap-c++-13. Solves #893. Signed-off-by: Bernd Finger --- roles/sap_hana_preconfigure/vars/RedHat_9.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 573d10263..7a9e75350 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -212,6 +212,8 @@ __sap_hana_preconfigure_packages: - nfs-utils # SAP NOTE 3108302: - tuned-profiles-sap-hana +# SAP NOTE 3449186 - Required for HANA 2.0 SPS08: + - compat-sap-c++-13 __sap_hana_preconfigure_packages_min_install: # SAP NOTE 3108316: @@ -240,6 +242,8 @@ __sap_hana_preconfigure_packages_min_install: # - nfs-utils # SAP NOTE 3108302: - tuned-profiles-sap-hana +# SAP NOTE 3449186 - Required for HANA 2.0 SPS08: + - compat-sap-c++-13 # URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools __sap_hana_preconfigure_ibm_power_repo_url: 'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' From 66dce4e9870939852aaeb384413c51bc6bba89e8 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 22 Nov 2024 22:02:04 +0100 Subject: [PATCH 200/210] sap_hana_install: Set the install execution mode to 'optimized' This is required when installing the HANA component 'LSS', which is the default in HANA 2.0 SPS08. The installation execution mode can be set to the previous value of 'standard' by using the role variable 'sap_hana_install_install_execution_mode'. See the file `defaults/main.yml` of this role. Solves issue #894. Signed-off-by: Bernd Finger --- roles/sap_hana_install/README.md | 8 ++++++-- roles/sap_hana_install/defaults/main.yml | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index 265c7f92e..636b21623 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -374,7 +374,11 @@ With the following tags, the role can be called to perform certain activities on ## Further Information -For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. +- Starting with SAP HANA 2.0 SPS08, the component LSS (Local Secure Store) will be installed by default +when installing SAP HANA. This requires the installation execution mode to be set to 'optimized', which is +now set in the file `defaults/main.yml`. + +- For more examples on how to use this role in different installation scenarios, refer to the [ansible.playbooks_for_sap](https://github.com/sap-linuxlab/ansible.playbooks_for_sap) playbooks. ## License @@ -440,4 +444,4 @@ You can find those in the task `Rename some variables used by hdblcm configfile` Example: The parameter `sap_hana_install_number`, which is used by the role to define the hdblm parameter `number` (= SAP HANA instance number)
can be defined by setting `sap_hana_instance_number`, `sap_hana_install_instance_nr`, `sap_hana_install_instance_number`, or `sap_hana_install_number`.
The order of precedence is from left to right. - \ No newline at end of file + diff --git a/roles/sap_hana_install/defaults/main.yml b/roles/sap_hana_install/defaults/main.yml index 9ad0d5ecf..6d4f47d38 100644 --- a/roles/sap_hana_install/defaults/main.yml +++ b/roles/sap_hana_install/defaults/main.yml @@ -140,6 +140,12 @@ sap_hana_install_system_usage: 'custom' sap_hana_install_restrict_max_mem: 'n' sap_hana_install_max_mem: +# Starting with SAP HANA 2.0 SPS08, the component LSS (Local Secure Store) will be installed by default +# when installing SAP HANA. This requires the installation execution mode to be set to 'optimized'. +# You can change the following variable to the default of 'standard' in your playbook or inventory, +# for example when installing an older version of SAP HANA or when not installing the 'lss' component. +sap_hana_install_install_execution_mode: 'optimized' + # hdblcm will use default ids if blank sap_hana_install_userid: sap_hana_install_groupid: From daae8d6f6cf777242ee6720bf968ba3a66d762ae Mon Sep 17 00:00:00 2001 From: Marcel Mamula Date: Tue, 26 Nov 2024 11:13:24 +0100 Subject: [PATCH 201/210] fix: Changes after review by Janine --- .../DEPRECATED_VARIABLES.md | 67 ++++++++++--------- .../Suse/post_steps_nwas_abap_ascs_ers.yml | 2 +- .../Suse/post_steps_nwas_java_scs_ers.yml | 2 +- ...figure_nwas_abap_ascs_ers_post_install.yml | 8 +-- ...nfigure_nwas_java_scs_ers_post_install.yml | 8 +-- .../tasks/construct_vars_nwas_common.yml | 12 ++-- .../tasks/include_vars_nwas.yml | 3 + roles/sap_ha_pacemaker_cluster/tasks/main.yml | 10 ++- .../tasks/validate_input_parameters.yml | 9 ++- .../sap_ha_pacemaker_cluster/vars/redhat.yml | 2 - roles/sap_ha_pacemaker_cluster/vars/suse.yml | 2 - 11 files changed, 61 insertions(+), 64 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md b/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md index bd066a84f..25aa5e396 100644 --- a/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md +++ b/roles/sap_ha_pacemaker_cluster/DEPRECATED_VARIABLES.md @@ -13,41 +13,42 @@ These variables fall into a few categories: All deprecated variables offer time limited backwards compatibility that will be removed in future. ## List of deprecated input variables -| Old variable | New variable | Backwards compatible | Reason | -| -------- | --------- | --------- | --------- | -| sap_ha_pacemaker_cluster_nwas_abap_sid | sap_ha_pacemaker_cluster_nwas_sid | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr | sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr | sap_ha_pacemaker_cluster_nwas_ers_instance_nr | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name | sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name | sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name | sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name | sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout | sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness | sap_ha_pacemaker_cluster_nwas_cs_group_stickiness | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 | sap_ha_pacemaker_cluster_nwas_cs_ensa1 | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount | sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address | sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name | sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address | sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name | sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name | sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name | sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name | sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name | sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id | sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id | sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | :heavy_check_mark: | Removal of `_abap_` | -| sap_ha_pacemaker_cluster_storage_nfs_filesytem_type | sap_ha_pacemaker_cluster_storage_nfs_filesystem_type | :heavy_check_mark: | Typo | +| ~~Old variable~~
New variable | Backwards compatible | Reason | +| --------- | --------- | --------- | +| ~~sap_ha_pacemaker_cluster_nwas_abap_sid~~
sap_ha_pacemaker_cluster_nwas_sid | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_instance_nr~~
sap_ha_pacemaker_cluster_nwas_ascs_instance_nr | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_instance_nr~~
sap_ha_pacemaker_cluster_nwas_ers_instance_nr | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_instance_name~~
sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_instance_name~~
sap_ha_pacemaker_cluster_nwas_ers_sapinstance_instance_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_start_profile_string~~
sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_start_profile_string~~
sap_ha_pacemaker_cluster_nwas_ers_sapinstance_start_profile_string | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_filesystem_resource_name~~
sap_ha_pacemaker_cluster_nwas_ascs_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_name~~
sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapstartsrv_resource_name~~
sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_filesystem_resource_name~~
sap_ha_pacemaker_cluster_nwas_ers_filesystem_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_sapinstance_resource_name~~
sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ers_sapstartsrv_resource_name~~
sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_automatic_recover_bool~~
sap_ha_pacemaker_cluster_nwas_cs_sapinstance_automatic_recover_bool | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_resource_stickiness~~
sap_ha_pacemaker_cluster_nwas_cs_sapinstance_resource_stickiness | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_migration_threshold~~
sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_migration_threshold | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_sapinstance_ensa1_failure_timeout~~
sap_ha_pacemaker_cluster_nwas_cs_sapinstance_ensa1_failure_timeout | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_group_stickiness~~
sap_ha_pacemaker_cluster_nwas_cs_group_stickiness | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1~~
sap_ha_pacemaker_cluster_nwas_cs_ensa1 | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_simple_mount~~
sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_ip_address~~
sap_ha_pacemaker_cluster_vip_nwas_ascs_ip_address | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_name~~
sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ers_ip_address~~
sap_ha_pacemaker_cluster_vip_nwas_ers_ip_address | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_name~~
sap_ha_pacemaker_cluster_vip_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ascs_resource_group_name~~
sap_ha_pacemaker_cluster_vip_nwas_ascs_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_vip_nwas_abap_ers_resource_group_name~~
sap_ha_pacemaker_cluster_vip_nwas_ers_resource_group_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_resource_name~~
sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_resource_name~~
sap_ha_pacemaker_cluster_healthcheck_nwas_ers_resource_name | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ascs_id~~
sap_ha_pacemaker_cluster_healthcheck_nwas_ascs_id | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_healthcheck_nwas_abap_ers_id~~
sap_ha_pacemaker_cluster_healthcheck_nwas_ers_id | :heavy_check_mark: | Removal of `_abap_` | +| ~~sap_ha_pacemaker_cluster_storage_nfs_filesytem_type~~
sap_ha_pacemaker_cluster_storage_nfs_filesystem_type | :heavy_check_mark: | Typo | ## Status explanation: +- Strikethrough - Name of deprecated variable - :heavy_check_mark: - Variable is removed from defaults and readme, but still supported. - :x: - Variable is completely removed and not supported diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml index 695e937d1..2d5c7d733 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_abap_ascs_ers.yml @@ -73,7 +73,7 @@ - name: "SAP HA Install Pacemaker - Remove operations for SAPStartSrv" ansible.builtin.command: cmd: cibadmin -d --force --xpath "//primitive[@type='SAPStartSrv']//operations" - when: sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + when: __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount changed_when: true # SAPInstance - Remove default operations: promote, demote, start, stop diff --git a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml index 695e937d1..2d5c7d733 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/Suse/post_steps_nwas_java_scs_ers.yml @@ -73,7 +73,7 @@ - name: "SAP HA Install Pacemaker - Remove operations for SAPStartSrv" ansible.builtin.command: cmd: cibadmin -d --force --xpath "//primitive[@type='SAPStartSrv']//operations" - when: sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + when: __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount changed_when: true # SAPInstance - Remove default operations: promote, demote, start, stop diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml index e65f4d2f2..e4c9158ed 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_abap_ascs_ers_post_install.yml @@ -43,13 +43,13 @@ - name: "SAP HA Pacemaker - (systemd) Check for ASCS/ERS services" ansible.builtin.stat: - path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ systemd_item }}.service" loop: - "{{ __sap_ha_pacemaker_cluster_nwas_ascs_instance_nr }}" - "{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" loop_control: loop_var: systemd_item - label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ systemd_item }}.service" register: __sap_ha_pacemaker_cluster_register_instance_service - name: "SAP HA Pacemaker - (systemd) Save found ASCS/ERS services" @@ -246,10 +246,10 @@ and 'ERROR' in __sap_ha_pacemaker_cluster_register_ascs_ha_check_config.stdout)" vars: __rsc_ascs: "{{ __sap_ha_pacemaker_cluster_nwas_ascs_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + if __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount else __sap_ha_pacemaker_cluster_nwas_ascs_sapinstance_resource_name }}" __rsc_ers: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + if __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount else __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" block: - name: "SAP HA Pacemaker - (SAP HA Interface) Restart ASCS ERS resources" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml index 175119218..ea36f162d 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/configure_nwas_java_scs_ers_post_install.yml @@ -43,13 +43,13 @@ - name: "SAP HA Pacemaker - (systemd) Check for SCS/ERS services" ansible.builtin.stat: - path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + path: "/etc/systemd/system/SAP{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ systemd_item }}.service" loop: - "{{ __sap_ha_pacemaker_cluster_nwas_scs_instance_nr }}" - "{{ __sap_ha_pacemaker_cluster_nwas_ers_instance_nr }}" loop_control: loop_var: systemd_item - label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}_{{ systemd_item }}.service" + label: "SAP{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ systemd_item }}.service" register: __sap_ha_pacemaker_cluster_register_instance_service - name: "SAP HA Pacemaker - (systemd) Save found SCS/ERS services" @@ -246,10 +246,10 @@ and 'ERROR' in __sap_ha_pacemaker_cluster_register_scs_ha_check_config.stdout)" vars: __rsc_scs: "{{ __sap_ha_pacemaker_cluster_nwas_scs_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + if __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount else __sap_ha_pacemaker_cluster_nwas_scs_sapinstance_resource_name }}" __rsc_ers: "{{ __sap_ha_pacemaker_cluster_nwas_ers_sapstartsrv_resource_name - if sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + if __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount else __sap_ha_pacemaker_cluster_nwas_ers_sapinstance_resource_name }}" block: - name: "SAP HA Pacemaker - (SAP HA Interface) Restart SCS ERS resources" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 98da80afd..a417108ad 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -125,13 +125,13 @@ __nfs_server: "{{ commonfs_item.nfs_server | d(sap_ha_pacemaker_cluster_storage_nfs_server) | regex_replace('/$', '') }}" __nfs_path: |- {%- if '/usr/sap' in commonfs_item.nfs_path and '/usr/sap/trans' not in commonfs_item.nfs_path -%} - {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid }}/SYS {%- else -%} {{ commonfs_item.nfs_path | regex_replace('^/', '') | regex_replace('/$', '') }} {%- endif %} __mountpoint: |- {%- if commonfs_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfs_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid }}/SYS {%- else -%} {{ commonfs_item.mountpoint | regex_replace('/$', '') }} {%- endif %} @@ -162,7 +162,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid | upper) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: @@ -180,7 +180,7 @@ __mountpoint: |- {%- if commonfsclone_item.mountpoint | regex_replace('/$', '') == '/usr/sap' -%} - {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid | upper }}/SYS + {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }}/{{ __sap_ha_pacemaker_cluster_nwas_sid }}/SYS {%- else -%} {{ commonfsclone_item.mountpoint | regex_replace('/$', '') }} {%- endif %} diff --git a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml index 3b18c0155..ffbef8df0 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/include_vars_nwas.yml @@ -372,6 +372,9 @@ if sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 is defined and sap_ha_pacemaker_cluster_nwas_abap_ascs_ers_ensa1 else sap_ha_pacemaker_cluster_nwas_cs_ensa1 | d(false) }}" + __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount: + "{{ sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool | d(true) }}" + # TODO: Add PAS and AAS variables # sap_ha_pacemaker_cluster_nwas_abap_pas_filesystem_resource_name: > # "Filesystem_NWAS_ABAP_PAS_{{ __sap_ha_pacemaker_cluster_nwas_sid }}_{{ __sap_ha_pacemaker_cluster_nwas_abap_pas_instance_nr }}" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/main.yml b/roles/sap_ha_pacemaker_cluster/tasks/main.yml index 1359a7ee7..95c43eac3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/main.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/main.yml @@ -90,10 +90,9 @@ loop_var: nwas_build_item when: - "'nwas_abap_ascs_ers' in nwas_build_item" - - not (sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool) + - not __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver ASCS/ERS Simple Mount - Simple Mount # noqa name[template] ansible.builtin.include_tasks: file: construct_vars_nwas_abap_ascs_ers_simple_mount.yml loop: "{{ sap_ha_pacemaker_cluster_host_type }}" @@ -101,7 +100,7 @@ loop_var: nwas_build_item when: - "'nwas_abap_ascs_ers' in nwas_build_item" - - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool + - __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount # SAP SCS/ERS Scenarios @@ -113,10 +112,9 @@ loop_var: nwas_build_item when: - "'nwas_java_scs_ers' in nwas_build_item" - - not (sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool) + - not __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount - name: SAP HA Prepare Pacemaker - Include variable construction for SAP NetWeaver SCS/ERS Simple Mount - Simple Mount # noqa name[template] ansible.builtin.include_tasks: file: construct_vars_nwas_java_scs_ers_simple_mount.yml loop: "{{ sap_ha_pacemaker_cluster_host_type }}" @@ -124,7 +122,7 @@ loop_var: nwas_build_item when: - "'nwas_java_scs_ers' in nwas_build_item" - - sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount | bool + - __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount # SAP PAS/AAS Scenarios diff --git a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml index 9496046e8..dc233b063 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/validate_input_parameters.yml @@ -8,7 +8,7 @@ - __sap_ha_pacemaker_cluster_hana_sid not in __sap_ha_pacemaker_cluster_sid_prohibited fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Requires:'sap_ha_pacemaker_cluster_hana_sid' to be defined as 3 capital letters! + Requires: 'sap_ha_pacemaker_cluster_hana_sid' to be defined as 3 capital letters! when: - sap_ha_pacemaker_cluster_host_type | select('search', 'hana') | length > 0 @@ -18,9 +18,8 @@ - (__sap_ha_pacemaker_cluster_hana_instance_nr | string) | length == 2 - (__sap_ha_pacemaker_cluster_hana_instance_nr | string) is match('^[0-9]{2}$') fail_msg: | - Host type = {{ sap_ha_pacemaker_cluster_host_type }} - Requires 'sap_ha_pacemaker_cluster_hana_instance_nr' to be defined. + Requires: 'sap_ha_pacemaker_cluster_hana_instance_nr' to be defined. The instance number must be exactly 2 digits. Add quotes if the number starts with a 0! @@ -36,7 +35,7 @@ fail_msg: | Host type = {{ sap_ha_pacemaker_cluster_host_type }} Current value: {{ __sap_ha_pacemaker_cluster_nwas_sid }} - Requires 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! + Requires: 'sap_ha_pacemaker_cluster_nwas_sid' to be defined as 3 capital letters! when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 @@ -88,7 +87,7 @@ - name: "SAP HA Prepare Pacemaker - (SAP NetWeaver) Validate storage definition" when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas') | length > 0 - - not sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount + - not __sap_ha_pacemaker_cluster_nwas_cs_ers_simple_mount ansible.builtin.assert: that: - sap_ha_pacemaker_cluster_storage_definition is defined diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 7ce47c72f..569c91c30 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -52,8 +52,6 @@ __sap_ha_pacemaker_cluster_connector_config_lines: __sap_ha_pacemaker_cluster_command: resource_stop: "pcs resource disable" resource_start: "pcs resource enable" - resource_defaults_show: "pcs resource defaults config" - resource_defaults_update: "pcs resource defaults update" resource_restart: "pcs resource restart" resource_cleanup: "pcs resource cleanup" diff --git a/roles/sap_ha_pacemaker_cluster/vars/suse.yml b/roles/sap_ha_pacemaker_cluster/vars/suse.yml index f4fef7d6e..e8fe64ee8 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/suse.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/suse.yml @@ -15,8 +15,6 @@ __sap_ha_pacemaker_cluster_connector_config_lines: __sap_ha_pacemaker_cluster_command: resource_stop: "crm resource stop" resource_start: "crm resource start" - resource_defaults_show: "crm configure show type:rsc_defaults" - resource_defaults_update: "crm configure rsc_defaults" resource_restart: "crm resource restart" resource_cleanup: "crm resource cleanup" From f84c79761c1757b1e87fde33229cf67641878700 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:01:41 +0100 Subject: [PATCH 202/210] sap_ha_pacemaker_cluster: Fix haproxy config --- .../platform/preconfigure_cloud_gcp_ce_vm.yml | 26 ++++++++---- .../preconfigure_cloud_ibmcloud_vs.yml | 40 ++++++++++--------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml index d04162b0c..e961fdca3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_gcp_ce_vm.yml @@ -33,14 +33,26 @@ insertafter: '^[Unit]$' notify: "systemd daemon-reload" - - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true + - name: "SAP HA Install Pacemaker - GCP CE VM - Update haproxy service template" + ansible.builtin.replace: + backup: false path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' + regexp: '{{ replace_item.orig }}' + replace: '{{ replace_item.new | d() }}' + loop: + - orig: '^(.+)haproxy.cfg(.*)$' + new: '\1haproxy-%i.cfg\2' + label: 'Replace haproxy.cfg with haproxy-%i.cfg' + - orig: '^(.+)haproxy.pid(.*)$' + new: '\1haproxy-%i.pid\2' + label: 'Replace haproxy.pid with haproxy-%i.pid' + - orig: '\"CFGDIR=(\/\w*)*\.d\"' + label: 'Delete definition of CFGDIR' + - orig: '\ -f \$CFGDIR' + label: 'Remove "-f $CFGDIR"' + loop_control: + loop_var: replace_item + label: "{{ replace_item.label }}" notify: "systemd daemon-reload" - name: "SAP HA Install Pacemaker - GCP CE VM - Define healthcheck details for HANA" diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml index f8675baa8..55e467aa3 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/preconfigure_cloud_ibmcloud_vs.yml @@ -55,24 +55,26 @@ insertafter: '^[Unit]$' notify: "systemd daemon-reload" -- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true - path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' - notify: "systemd daemon-reload" - -- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template environment" - ansible.builtin.lineinfile: - backup: true +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Update haproxy service template" + ansible.builtin.replace: + backup: false path: /etc/systemd/system/haproxy@.service - regexp: '^Environment=' - line: 'Environment="CONFIG=/etc/haproxy/haproxy-%i.cfg" "PIDFILE=/run/haproxy-%i.pid"' - state: present - insertafter: '^[Service]$' + regexp: '{{ replace_item.orig }}' + replace: '{{ replace_item.new | d() }}' + loop: + - orig: '^(.+)haproxy.cfg(.*)$' + new: '\1haproxy-%i.cfg\2' + label: 'Replace haproxy.cfg with haproxy-%i.cfg' + - orig: '^(.+)haproxy.pid(.*)$' + new: '\1haproxy-%i.pid\2' + label: 'Replace haproxy.pid with haproxy-%i.pid' + - orig: '\"CFGDIR=(\/\w*)*\.d\"' + label: 'Delete definition of CFGDIR' + - orig: '\ -f \$CFGDIR' + label: 'Remove "-f $CFGDIR"' + loop_control: + loop_var: replace_item + label: "{{ replace_item.label }}" notify: "systemd daemon-reload" - name: "SAP HA Install Pacemaker - IBM Cloud VS - Define healthcheck details for HANA" @@ -100,7 +102,7 @@ when: - sap_ha_pacemaker_cluster_host_type | select('search', 'nwas_abap_ascs_ers') | length > 0 -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for HANA instances" +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Create haproxy config for HANA instances" ansible.builtin.blockinfile: backup: false create: true @@ -141,7 +143,7 @@ - sap_ha_pacemaker_cluster_host_type | select('search', 'hana_scaleup') | length > 0 - haproxy_item.port | length > 4 -- name: "SAP HA Install Pacemaker - GCP CE VM - Create haproxy config for NWAS ASCS/ERS instances" +- name: "SAP HA Install Pacemaker - IBM Cloud VS - Create haproxy config for NWAS ASCS/ERS instances" ansible.builtin.blockinfile: create: true path: "/etc/haproxy/haproxy-{{ haproxy_item.name }}.cfg" From 08aee4e8412af0198393c02249f7375a5fcf048f Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:15:03 +0100 Subject: [PATCH 203/210] sap_ha_pacemaker_cluster: Fix ansible-lint complaints --- roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml | 2 +- .../tasks/construct_vars_nwas_common.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml index de8e8b852..4e1640b64 100644 --- a/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml +++ b/roles/sap_ha_install_anydb_ibmdb2/tasks/db2_hadr_enable.yml @@ -4,7 +4,7 @@ # See IBM Db2 documentation 'HADR and network address translation (NAT) support' - https://www.ibm.com/docs/en/db2/11.5?topic=support-hadr-nat # These are the HADR Ports used for internode communication, and are unrelated to Health Check probe port from a Load Balancer - name: SAP HA AnyDB - IBM Db2 HADR - Append IBM Db2 HA Ports to /etc/services - ansible.builtin.lineinfile: + ansible.builtin.lineinfile: # noqa no-tabs path: /etc/services line: "{{ item }}" state: present diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index a417108ad..5d1c0317e 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -162,7 +162,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid ) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: From dfd3b3862098686780496f69c2ccfa613320299f Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Wed, 27 Nov 2024 10:49:46 +0100 Subject: [PATCH 204/210] sap_ha_pacemaker_cluster: Remove unnecessary parens --- .../tasks/construct_vars_nwas_common.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml index 5d1c0317e..55bdbf427 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/construct_vars_nwas_common.yml @@ -81,7 +81,7 @@ {% set idname = __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name %} {% elif '/usr/sap/trans' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name %} - {% elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {% elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {% set idname = __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name %} {% endif %} {{ idname }} @@ -162,7 +162,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_clone_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_clone_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_clone_name }} {%- endif %} resource_id: |- @@ -170,7 +170,7 @@ {{ __sap_ha_pacemaker_cluster_nwas_sapmnt_filesystem_resource_name }} {%- elif '/usr/sap/trans' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_transports_filesystem_resource_name }} - {%- elif '/usr/sap/' + (__sap_ha_pacemaker_cluster_nwas_sid) + '/SYS' in __mountpoint -%} + {%- elif '/usr/sap/' + __sap_ha_pacemaker_cluster_nwas_sid + '/SYS' in __mountpoint -%} {{ __sap_ha_pacemaker_cluster_nwas_sys_filesystem_resource_name }} {%- endif %} meta_attrs: From 4ba22dc4056ff0b7ffebc16f25ab141705cec64c Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 12:36:46 +0100 Subject: [PATCH 205/210] sap_hana_preconfigure: Do not install compat-sap-c++-13 on RHEL 9.0 ... because HANA 2.0 SPS08 (GCC13 based) has only been validated by SAP starting with RHEL 9.2 Fixes issue #901. Signed-off-by: Bernd Finger --- .../sap_hana_preconfigure/vars/RedHat_9.0.yml | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 roles/sap_hana_preconfigure/vars/RedHat_9.0.yml diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml new file mode 100644 index 000000000..573d10263 --- /dev/null +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.0.yml @@ -0,0 +1,306 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +# supported RHEL 9 minor releases for SAP HANA: +__sap_hana_preconfigure_supported_rhel_minor_releases: + - "9.0" + - "9.2" + - "9.4" + +# required repos for RHEL 9: +__sap_hana_preconfigure_req_repos_redhat_9_0_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_0_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_1_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_1_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_2_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_2_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_3_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_3_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_4_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_4_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_5_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_5_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_6_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_6_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_7_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_7_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_8_x86_64: + - "rhel-9-for-x86_64-baseos-e4s-rpms" + - "rhel-9-for-x86_64-appstream-e4s-rpms" + - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_8_ppc64le: + - "rhel-9-for-ppc64le-baseos-e4s-rpms" + - "rhel-9-for-ppc64le-appstream-e4s-rpms" + - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_9_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_9_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_10_x86_64: + - "rhel-9-for-x86_64-baseos-rpms" + - "rhel-9-for-x86_64-appstream-rpms" + - "rhel-9-for-x86_64-sap-solutions-rpms" + +__sap_hana_preconfigure_req_repos_redhat_9_10_ppc64le: + - "rhel-9-for-ppc64le-baseos-rpms" + - "rhel-9-for-ppc64le-appstream-rpms" + - "rhel-9-for-ppc64le-sap-solutions-rpms" + +# required SAP notes for RHEL 9: +__sap_hana_preconfigure_sapnotes_versions_x86_64: + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } + - { number: '3024346', version: '11' } + +__sap_hana_preconfigure_sapnotes_versions_ppc64le: + - { number: '2055470', version: '90' } + - { number: '3108302', version: '11' } + - { number: '2382421', version: '47' } + - { number: '3024346', version: '11' } + +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" + +# In SAP Note XXX, certain minimal required packages for the different RHEL 9 minor releases are listed. +# The following will assign them properly to __sap_hana_preconfigure_min_pkgs. +# If variable __sap_hana_preconfigure_min_packages_VERSION_ARCH is not defined, +# variable __sap_hana_preconfigure_min_pkgs will be undefined as well. + +# Minimum required package levels for RHEL 9.0: +__sap_hana_preconfigure_min_packages_9_0_x86_64: + - [ 'kernel', '5.14.0-70.22.1.el9_0' ] + +__sap_hana_preconfigure_min_packages_9_0_ppc64le: + - [ 'kernel', '5.14.0-70.43.1.el9_0' ] + - [ 'glibc', '2.34-28.el9_0.3' ] + +__sap_hana_preconfigure_min_packages_9_1_x86_64: + +__sap_hana_preconfigure_min_packages_9_1_ppc64le: + +__sap_hana_preconfigure_min_packages_9_2_x86_64: + - [ 'kernel', '5.14.0-284.25.1.el9_2' ] + +__sap_hana_preconfigure_min_packages_9_2_ppc64le: + - [ 'kernel', '5.14.0-284.25.1.el9_2' ] + +__sap_hana_preconfigure_min_packages_9_3_x86_64: + +__sap_hana_preconfigure_min_packages_9_3_ppc64le: + +__sap_hana_preconfigure_min_packages_9_4_x86_64: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] + +__sap_hana_preconfigure_min_packages_9_4_ppc64le: + - [ 'kernel', '5.14.0-427.16.1.el9_4' ] + +__sap_hana_preconfigure_min_packages_9_5_x86_64: + +__sap_hana_preconfigure_min_packages_9_5_ppc64le: + +__sap_hana_preconfigure_min_packages_9_6_x86_64: + +__sap_hana_preconfigure_min_packages_9_6_ppc64le: + +__sap_hana_preconfigure_min_packages_9_7_x86_64: + +__sap_hana_preconfigure_min_packages_9_7_ppc64le: + +__sap_hana_preconfigure_min_packages_9_8_x86_64: + +__sap_hana_preconfigure_min_packages_9_8_ppc64le: + +__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" + +__sap_hana_preconfigure_packages: +# SAP NOTE 3108316: + - expect +# package gtk2: only needed if the SAP HANA installation tools hdblcmgui and hdbsetup are used + - gtk2 + - krb5-workstation + - libatomic + - libcanberra-gtk2 + - libtool-ltdl + - numactl + - PackageKit-gtk3-module + - xorg-x11-xauth +# package chkconfig: needed by hdblcm to be able to access /etc/init.d + - chkconfig +# package compat-openssl11: needed for HANA scale-out and when configuring HANA backup on Azure + - compat-openssl11 +# package libxcrypt-compat: needed SAP HANA and also by sapstartsrv on RHEL 9: +# - libxcrypt-compat # now installed by role sap_general_preconfigure, see also SAP note 3108316, version 4. +# For support purposes: +# package graphwiz: graph visualization tools, for supportability) + - graphviz +# package iptraf-ng: TCP/IP network monitor, for supportability) + - iptraf-ng +# package lm-sensors: TCP/IP network monitor, for supportability) + - lm_sensors +# package nfs-utils: support utilities for NFS, for supportability) + - nfs-utils +# SAP NOTE 3108302: + - tuned-profiles-sap-hana + +__sap_hana_preconfigure_packages_min_install: +# SAP NOTE 3108316: + - expect +# package gtk2: only needed if the SAP HANA installation tools hdblcmgui and hdbsetup are used +# - gtk2 + - krb5-workstation + - libatomic + - libcanberra-gtk2 + - libtool-ltdl + - numactl + - PackageKit-gtk3-module + - xorg-x11-xauth +# package compat-openssl11: needed for HANA scale-out and when configuring HANA backup on Azure + - compat-openssl11 +# required for SAP HANA on RHEL 9: + - libxcrypt-compat +# For support purposes: +# package graphwiz: graph visualization tools, for supportability) +# - graphviz +# package iptraf-ng: TCP/IP network monitor, for supportability) +# - iptraf-ng +# package lm-sensors: TCP/IP network monitor, for supportability) +# - lm_sensors +# package nfs-utils: support utilities for NFS, for supportability) +# - nfs-utils +# SAP NOTE 3108302: + - tuned-profiles-sap-hana + +# URL for the IBM Power Systems service and productivity tools, see https://www.ibm.com/support/pages/service-and-productivity-tools +__sap_hana_preconfigure_ibm_power_repo_url: 'https://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' + +__sap_hana_preconfigure_required_ppc64le: + - ibm-power-managed-rhel9 + +# Network related kernel parameters as set in SAP Note 2382421: +__sap_hana_preconfigure_kernel_parameters_default: +# The following parameter should always be set: + - { name: net.ipv4.tcp_max_syn_backlog, value: 8192 } +# The following two parameters are automatically set by SAP Host Agent +# - { name: net.ipv4.ip_local_port_range, value: "40000 61000" } +# - { name: net.ipv4.ip_local_reserved_ports, value: -> SAP NOTE 2477204 } +# The following two parameters do not work when communicating with hosts behind NAT firewall: +# - { name: net.ipv4.tcp_tw_reuse, value: 1 } +# - { name: net.ipv4.tcp_tw_recycle, value: 1 } +# The following parameter should always be set but might not work on Azure (see SAP Note 2382421): + - { name: net.ipv4.tcp_timestamps, value: 1 } +# The following parameter should always be set: + - { name: net.ipv4.tcp_slow_start_after_idle, value: 0 } +# Tune the next four parameters for low latency system replication: +# - { net.ipv4.tcp_wmem, value } +# - { net.ipv4.tcp_rmem, value } +# - { net.core.wmem_max, value } +# - { net.core.rmem_max, value } +# Should be set correctly already on most systems, according to SAP Note 2382421: +# - { net.ipv4.tcp_window_scaling, 1 } +# The following only applies to HANA 1 <= 122.14 and HANA 2 SPS00. +# So we do not change the default. +# - { name: net.ipv4.tcp_syn_retries, value: 8 } + +# Network related kernel parameters for ppc64le: +__sap_hana_preconfigure_kernel_parameters_default_ppc64le: + - { name: net.core.rmem_max, value: 56623104 } + - { name: net.core.wmem_max, value: 56623104 } + - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } + +# Network related kernel parameters for NetApp NFS, as set in SAP Note 3024346: +__sap_hana_preconfigure_kernel_parameters_netapp_nfs: + - { name: net.core.rmem_max, value: 16777216 } + - { name: net.core.wmem_max, value: 16777216 } + - { name: net.ipv4.tcp_rmem, value: "4096 131072 16777216" } + - { name: net.ipv4.tcp_wmem, value: "4096 16384 16777216" } + - { name: net.core.netdev_max_backlog, value: 300000 } +# already set in SAP note 2382421: +# - { name: net.ipv4.tcp_slow_start_after_idle, value: 0 } + - { name: net.ipv4.tcp_no_metrics_save, value: 1 } + - { name: net.ipv4.tcp_moderate_rcvbuf, value: 1 } + - { name: net.ipv4.tcp_window_scaling, value: 1 } +# already set in SAP note 2382421: +# - { name: net.ipv4.tcp_timestamps, value: 1 } + - { name: net.ipv4.tcp_sack, value: 1 } + +# yamllint disable rule:commas rule:colons +__sap_hana_preconfigure_packages_and_services: + abrtd: { pkg: 'abrt', svc: 'abrtd', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + abrt-ccpp: { pkg: 'abrt-addon-ccpp', svc: 'abrt-ccpp', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + numad: { pkg: 'numad', svc: 'numad', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + kdump: { pkg: 'kexec-tools', svc: 'kdump', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } + firewalld: { pkg: 'firewalld', svc: 'firewalld', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } +# yamllint enable rule:commas rule:colons From 34c8352ec31eb0a34a17f9cead7bfffe375bf4aa Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 14:37:13 +0100 Subject: [PATCH 206/210] sap_ha_pacemaker_cluster: fix UUID discovery for IBM Cloud VS --- .../platform/register_sysinfo_cloud_ibmcloud_powervs.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml index f53320b67..478ae9278 100644 --- a/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml +++ b/roles/sap_ha_pacemaker_cluster/tasks/platform/register_sysinfo_cloud_ibmcloud_powervs.yml @@ -3,13 +3,12 @@ # Ansible facts rely on SMBIOS/DMI, which does not exist on ppc64le CPU Architecture. # Discovered input used for plug (via pcmk_host_map) -# The Instance ID in the IBM Power Virtual Server Workspace, is identical string to the UUID reported in the host -# alt command using IBM Power RSCT binary: /opt/rsct/bin/ctgethscid | grep PartitionUUID | cut -d \" -f2 -# alt command using cloud-init data: cat /run/cloud-init/instance-data.json | grep uuid | cut -d \" -f4 -# alt command using cloud-init data: cat /run/cloud-init/instance-data.json | grep instance_id | cut -d \" -f4 +# Reference - https://ibm.com/support/pages/node/7075598 +# The Instance ID in the IBM Power Virtual Server Workspace, must be identical string to the UUID reported in the host +# Use cloud-init data as definitive lookup on IBM Power VS, as IBM Power RSCT Binary /opt/rsct/bin/ctgethscid or Kernel data structure such as /proc/device-tree/ibm,partition-uuid - name: "SAP HA Prepare Pacemaker - IBM Cloud Power VS - IBM Power Virtual Server UUID" ansible.builtin.shell: | - set -o pipefail && echo $(tr -d '\0' < /proc/device-tree/ibm,partition-uuid) + set -o pipefail && echo $(cat /run/cloud-init/instance-data.json | grep instance_id | cut -d \" -f4) register: __sap_ha_pacemaker_cluster_register_ibmcloud_powervs_host changed_when: false check_mode: false From 2fa9c66e03430645c5feb5c85127d5c96d303ecc Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 15:41:41 +0100 Subject: [PATCH 207/210] sap_ha_pacemaker_cluster: fix MS Azure repo name for RHEL --- roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 569c91c30..1e49fbffc 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -31,8 +31,8 @@ __sap_ha_pacemaker_cluster_repos_dict: cloud_msazure_vm: - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rhui-rpms" name: High Availability - - id: "rhui-microsoft-azure-rhel8-sap-ha" - name: Microsoft Azure RPMs for Red Hat Enterprise Linux 8 (rhel8-sap-ha) + - id: "rhui-microsoft-azure-rhel{{ ansible_distribution_major_version }}-sap-ha" + name: Microsoft Azure RPMs for Red Hat Enterprise Linux {{ ansible_distribution_major_version }} (rhel{{ ansible_distribution_major_version }}-sap-ha) hyp_ibmpower_vm: - id: "rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-e4s-rpms" name: High Availability E4S (4-Year) for Power, little endian From 443e30e206d2cad6177c970b9172d4dde3162cd1 Mon Sep 17 00:00:00 2001 From: Janine Fuchs Date: Fri, 29 Nov 2024 15:54:18 +0100 Subject: [PATCH 208/210] sap_ha_pacemaker_cluster: fix RHEL 9+ resource agent package list on MS Azure --- roles/sap_ha_pacemaker_cluster/vars/redhat.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml index 1e49fbffc..d8fc31b45 100644 --- a/roles/sap_ha_pacemaker_cluster/vars/redhat.yml +++ b/roles/sap_ha_pacemaker_cluster/vars/redhat.yml @@ -87,6 +87,7 @@ __sap_ha_pacemaker_cluster_platform_extra_packages_dict: cloud_gcp_ce_vm: - resource-agents-gcp cloud_msazure_vm: + - "{{ 'resource-agents-cloud' if ansible_distribution_major_version is version('9', '>=') else '' }}" - socat # Dictionary with additional cluster packages for specific scenarios From ad347f3bce2c40cc4185762e8c1d950886a93236 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 17:25:51 +0100 Subject: [PATCH 209/210] collection: prepare for v1.5.0 Signed-off-by: Bernd Finger --- CHANGELOG.rst | 76 +++++++++++++++++++++++++++++++++++++++ changelogs/changelog.yaml | 65 +++++++++++++++++++++++++++++++++ galaxy.yml | 2 +- 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1bebd970c..5191af6dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,82 @@ community.sap_install Release Notes .. contents:: Topics +v1.5.0 +====== + +Release Summary +--------------- +- Release Date: 2024-11-29 + +This is a minor release of the `community.sap_install` collection. + +Major Changes +------------- +- feat: collection: Readme overhaul for all roles in collection (https://github.com/sap-linuxlab/community.sap_install/pull/873) +- feat: sap_ha_pacemaker_cluster: JAVA HA scenarios and complete refactor of role (https://github.com/sap-linuxlab/community.sap_install/pull/882) +- feat: sap_ha_pacemaker_cluster: Stonith SBD enablement (https://github.com/sap-linuxlab/community.sap_install/pull/829) +- feat: sap_swpm: New improved and simplified version (https://github.com/sap-linuxlab/community.sap_install/pull/840) + +Minor Changes +------------- +- feat: collection: Add playbook for direct execution (https://github.com/sap-linuxlab/community.sap_install/pull/842) +- feat: sap_ha_pacemaker_cluster: New azure fence agent package for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/837) +- feat: sap_ha_pacemaker_cluster: Enhance corosync totem handling with new dictionaries (https://github.com/sap-linuxlab/community.sap_install/pull/834) +- feat: sap_ha_pacemaker_cluster: GCP VIP reworked, Health check names updated (https://github.com/sap-linuxlab/community.sap_install/pull/863) +- feat: sap_swpm: Option to enable SWPM observer mode (https://github.com/sap-linuxlab/community.sap_install/pull/749) +- feat: sap_storage_setup: Add support for HANA Scaleout NFS filesystems (https://github.com/sap-linuxlab/community.sap_install/pull/800) +- feat: sap_storage_setup: Add exact size disk check on top of approximate check (https://github.com/sap-linuxlab/community.sap_install/pull/839) +- feat: sap_hana_install: Implement an SAP HANA installation check only feature (https://github.com/sap-linuxlab/community.sap_install/pull/849) +- collection: Add collection dependency for community.general (https://github.com/sap-linuxlab/community.sap_install/pull/808) +- collection: Modify for yamllint requirements (https://github.com/sap-linuxlab/community.sap_install/pull/811) +- sap_ha_pacemaker_cluster: Add override to use Classic SAPHanaSR agents (https://github.com/sap-linuxlab/community.sap_install/pull/806) +- sap_ha_pacemaker_cluster: Packages on AWS for RHEL (https://github.com/sap-linuxlab/community.sap_install/pull/857) +- sap_ha_pacemaker_cluster: GCP haproxy handling and new platform VIP dictionary (https://github.com/sap-linuxlab/community.sap_install/pull/862) +- sap_ha_pacemaker_cluster: vip resources must be first in ASCS/ERS resource groups (https://github.com/sap-linuxlab/community.sap_install/pull/872) +- sap_swpm: Remove the pids module (https://github.com/sap-linuxlab/community.sap_install/pull/786) +- sap_swpm: sap_swpm_db_schema_password must be set explicitly for AAS (https://github.com/sap-linuxlab/community.sap_install/pull/760) +- sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password (https://github.com/sap-linuxlab/community.sap_install/pull/748) +- sap_swpm: Add default value for sap_swpm_java_scs_instance_hostname (https://github.com/sap-linuxlab/community.sap_install/pull/801) +- sap_swpm: Reduce the amount of empty lines in inifile.params (https://github.com/sap-linuxlab/community.sap_install/pull/822) +- sap_storage_setup: Defaults and documentation (https://github.com/sap-linuxlab/community.sap_install/pull/825) +- sap_general_preconfigure: Use the package module in most cases (https://github.com/sap-linuxlab/community.sap_install/pull/758) +- sap_general_preconfigure: Use FQCN for import_role (https://github.com/sap-linuxlab/community.sap_install/pull/827) +- sap_hana_preconfigure: Add RHEL 8.10 and 9.4 requirements (https://github.com/sap-linuxlab/community.sap_install/pull/869) +- sap_hana_preconfigure: Zypper lock handler for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/796) +- sap_hana_preconfigure: Enable TSX also for RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/797) +- sap_hana_preconfigure: Sync with SAP note 3024346 v.10 for RHEL/NetApp (https://github.com/sap-linuxlab/community.sap_install/pull/816) +- sap_hana_preconfigure: Refactor remove default saptune version (https://github.com/sap-linuxlab/community.sap_install/pull/818) +- sap_hana_preconfigure: Update azure override readme (https://github.com/sap-linuxlab/community.sap_install/pull/820) +- sap_hana_preconfigure: Set THP to madvise from RHEL 9.2 onwards (https://github.com/sap-linuxlab/community.sap_install/pull/880) +- sap_hana_preconfigure: Allow setting THP to any possible value (https://github.com/sap-linuxlab/community.sap_install/pull/886) +- sap_hana_preconfigure: No longer set net.core.somaxconn in RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/887) +- sap_hana_preconfigure: Add compat-sap-c++-13 (https://github.com/sap-linuxlab/community.sap_install/pull/895) +- sap_netweaver_preconfigure: Rename package libcpupower1 for SLES4SAP 15 SP6 (https://github.com/sap-linuxlab/community.sap_install/pull/876) +- sap_netweaver_preconfigure: Sync with applicable SAP notes for Adobe DS (https://github.com/sap-linuxlab/community.sap_install/pull/888) +- sap_hana_install: Use polling for hdblcm (https://github.com/sap-linuxlab/community.sap_install/pull/805) +- sap_hana_install: Set the install execution mode to 'optimized' (https://github.com/sap-linuxlab/community.sap_install/pull/896) +- sap_install_media_detect: AWS IGW slow impacts gpg key (https://github.com/sap-linuxlab/community.sap_install/pull/772) +- sap_install_media_detect: Search known subdirs on re-run (https://github.com/sap-linuxlab/community.sap_install/pull/773) +- sap_install_media_detect: Append loop labels (https://github.com/sap-linuxlab/community.sap_install/pull/781) +- sap_install_media_detect: Allow disabling RAR handling (https://github.com/sap-linuxlab/community.sap_install/pull/856) +- sap_ha_install_anydb_ibmdb2: Append ibmcloud_vs (https://github.com/sap-linuxlab/community.sap_install/pull/815) + +Bugfixes +-------- +- sap_ha_pacemaker_cluster: Add python3-pip and NFS fix for Azure (https://github.com/sap-linuxlab/community.sap_install/pull/754) +- sap_ha_pacemaker_cluster: Fix pcs resource restart (https://github.com/sap-linuxlab/community.sap_install/pull/769) +- sap_ha_pacemaker_cluster: Fix haproxy and minor lint issues (https://github.com/sap-linuxlab/community.sap_install/pull/898) +- sap_ha_pacemaker_cluster: Fix UUID discovery for IBM Cloud VS (https://github.com/sap-linuxlab/community.sap_install/pull/903) +- sap_swpm: Add error notes to dev doc (https://github.com/sap-linuxlab/community.sap_install/pull/795) +- sap_swpm: Fix error when observer user defined, but empty and observer mode is on (https://github.com/sap-linuxlab/community.sap_install/pull/850) +- sap_swpm: Fix issues with localhost delegation on certain control nodes (https://github.com/sap-linuxlab/community.sap_install/pull/891) +- sap_*_preconfigure: Fixes for testing with molecule (https://github.com/sap-linuxlab/community.sap_install/pull/807) +- sap_*_preconfigure: Edge case handling for SUSE packages +- sap_general_preconfigure: Reboot fix in handler (https://github.com/sap-linuxlab/community.sap_install/pull/892) +- sap_ha_install_hana_hsr: Fixes to work for multiple secondaries (https://github.com/sap-linuxlab/community.sap_install/pull/866) +- sap_ha_install_anydb_ibmdb2: Linting and sles bug fixes (https://github.com/sap-linuxlab/community.sap_install/pull/803) + + v1.4.1 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 8468089a7..5d6e78e81 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -208,3 +208,68 @@ releases: | sap_swpm: optionally skip setting file permissions ' release_date: '2024-06-20' + 1.4.1: + changes: + release_summary: '| Release Date: 2024-11-29 + major_changes: + - feat: collection: Readme overhaul for all roles in collection (https://github.com/sap-linuxlab/community.sap_install/pull/873) + - feat: sap_ha_pacemaker_cluster: JAVA HA scenarios and complete refactor of role (https://github.com/sap-linuxlab/community.sap_install/pull/882) + - feat: sap_ha_pacemaker_cluster: Stonith SBD enablement (https://github.com/sap-linuxlab/community.sap_install/pull/829) + - feat: sap_swpm: New improved and simplified version (https://github.com/sap-linuxlab/community.sap_install/pull/840) + minor_changes: + - feat: collection: Add playbook for direct execution (https://github.com/sap-linuxlab/community.sap_install/pull/842) + - feat: sap_ha_pacemaker_cluster: New azure fence agent package for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/837) + - feat: sap_ha_pacemaker_cluster: Enhance corosync totem handling with new dictionaries (https://github.com/sap-linuxlab/community.sap_install/pull/834) + - feat: sap_ha_pacemaker_cluster: GCP VIP reworked, Health check names updated (https://github.com/sap-linuxlab/community.sap_install/pull/863) + - feat: sap_swpm: Option to enable SWPM observer mode (https://github.com/sap-linuxlab/community.sap_install/pull/749) + - feat: sap_storage_setup: Add support for HANA Scaleout NFS filesystems (https://github.com/sap-linuxlab/community.sap_install/pull/800) + - feat: sap_storage_setup: Add exact size disk check on top of approximate check (https://github.com/sap-linuxlab/community.sap_install/pull/839) + - feat: sap_hana_install: Implement an SAP HANA installation check only feature (https://github.com/sap-linuxlab/community.sap_install/pull/849) + - collection: Add collection dependency for community.general (https://github.com/sap-linuxlab/community.sap_install/pull/808) + - collection: Modify for yamllint requirements (https://github.com/sap-linuxlab/community.sap_install/pull/811) + - sap_ha_pacemaker_cluster: Add override to use Classic SAPHanaSR agents (https://github.com/sap-linuxlab/community.sap_install/pull/806) + - sap_ha_pacemaker_cluster: Packages on AWS for RHEL (https://github.com/sap-linuxlab/community.sap_install/pull/857) + - sap_ha_pacemaker_cluster: GCP haproxy handling and new platform VIP dictionary (https://github.com/sap-linuxlab/community.sap_install/pull/862) + - sap_ha_pacemaker_cluster: vip resources must be first in ASCS/ERS resource groups (https://github.com/sap-linuxlab/community.sap_install/pull/872) + - sap_swpm: Remove the pids module (https://github.com/sap-linuxlab/community.sap_install/pull/786) + - sap_swpm: sap_swpm_db_schema_password must be set explicitly for AAS (https://github.com/sap-linuxlab/community.sap_install/pull/760) + - sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password (https://github.com/sap-linuxlab/community.sap_install/pull/748) + - sap_swpm: Add default value for sap_swpm_java_scs_instance_hostname (https://github.com/sap-linuxlab/community.sap_install/pull/801) + - sap_swpm: Reduce the amount of empty lines in inifile.params (https://github.com/sap-linuxlab/community.sap_install/pull/822) + - sap_storage_setup: Defaults and documentation (https://github.com/sap-linuxlab/community.sap_install/pull/825) + - sap_general_preconfigure: Use the package module in most cases (https://github.com/sap-linuxlab/community.sap_install/pull/758) + - sap_general_preconfigure: Use FQCN for import_role (https://github.com/sap-linuxlab/community.sap_install/pull/827) + - sap_hana_preconfigure: Add RHEL 8.10 and 9.4 requirements (https://github.com/sap-linuxlab/community.sap_install/pull/869) + - sap_hana_preconfigure: Zypper lock handler for SUSE (https://github.com/sap-linuxlab/community.sap_install/pull/796) + - sap_hana_preconfigure: Enable TSX also for RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/797) + - sap_hana_preconfigure: Sync with SAP note 3024346 v.10 for RHEL/NetApp (https://github.com/sap-linuxlab/community.sap_install/pull/816) + - sap_hana_preconfigure: Refactor remove default saptune version (https://github.com/sap-linuxlab/community.sap_install/pull/818) + - sap_hana_preconfigure: Update azure override readme (https://github.com/sap-linuxlab/community.sap_install/pull/820) + - sap_hana_preconfigure: Set THP to madvise from RHEL 9.2 onwards (https://github.com/sap-linuxlab/community.sap_install/pull/880) + - sap_hana_preconfigure: Allow setting THP to any possible value (https://github.com/sap-linuxlab/community.sap_install/pull/886) + - sap_hana_preconfigure: No longer set net.core.somaxconn in RHEL 9 (https://github.com/sap-linuxlab/community.sap_install/pull/887) + - sap_hana_preconfigure: Add compat-sap-c++-13 (https://github.com/sap-linuxlab/community.sap_install/pull/895) + - sap_netweaver_preconfigure: Rename package libcpupower1 for SLES4SAP 15 SP6 (https://github.com/sap-linuxlab/community.sap_install/pull/876) + - sap_netweaver_preconfigure: Sync with applicable SAP notes for Adobe DS (https://github.com/sap-linuxlab/community.sap_install/pull/888) + - sap_hana_install: Use polling for hdblcm (https://github.com/sap-linuxlab/community.sap_install/pull/805) + - sap_hana_install: Set the install execution mode to "optimized" (https://github.com/sap-linuxlab/community.sap_install/pull/896) + - sap_install_media_detect: AWS IGW slow impacts gpg key (https://github.com/sap-linuxlab/community.sap_install/pull/772) + - sap_install_media_detect: Search known subdirs on re-run (https://github.com/sap-linuxlab/community.sap_install/pull/773) + - sap_install_media_detect: Append loop labels (https://github.com/sap-linuxlab/community.sap_install/pull/781) + - sap_install_media_detect: Allow disabling RAR handling (https://github.com/sap-linuxlab/community.sap_install/pull/856) + - sap_ha_install_anydb_ibmdb2: Append ibmcloud_vs (https://github.com/sap-linuxlab/community.sap_install/pull/815) + bugfixes: + - sap_ha_pacemaker_cluster: Add python3-pip and NFS fix for Azure (https://github.com/sap-linuxlab/community.sap_install/pull/754) + - sap_ha_pacemaker_cluster: Fix pcs resource restart (https://github.com/sap-linuxlab/community.sap_install/pull/769) + - sap_ha_pacemaker_cluster: Fix haproxy and minor lint issues (https://github.com/sap-linuxlab/community.sap_install/pull/898) + - sap_ha_pacemaker_cluster: Fix UUID discovery for IBM Cloud VS (https://github.com/sap-linuxlab/community.sap_install/pull/903) + - sap_swpm: Add error notes to dev doc (https://github.com/sap-linuxlab/community.sap_install/pull/795) + - sap_swpm: Fix error when observer user defined, but empty and observer mode is on (https://github.com/sap-linuxlab/community.sap_install/pull/850) + - sap_swpm: Fix issues with localhost delegation on certain control nodes (https://github.com/sap-linuxlab/community.sap_install/pull/891) + - sap_*_preconfigure: Fixes for testing with molecule (https://github.com/sap-linuxlab/community.sap_install/pull/807) + - sap_*_preconfigure: Edge case handling for SUSE packages + - sap_general_preconfigure: Reboot fix in handler (https://github.com/sap-linuxlab/community.sap_install/pull/892) + - sap_ha_install_hana_hsr: Fixes to work for multiple secondaries (https://github.com/sap-linuxlab/community.sap_install/pull/866) + - sap_ha_install_anydb_ibmdb2: Linting and sles bug fixes (https://github.com/sap-linuxlab/community.sap_install/pull/803) + ' + release_date: '2024-11-29' diff --git a/galaxy.yml b/galaxy.yml index e7b12a847..bb5e3566f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,7 +11,7 @@ namespace: community name: sap_install # The version of the collection. Must be compatible with semantic versioning -version: 1.4.1 +version: 1.5.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md From adc444f6ada6bbe362bfdb55cc9e72ee946b0842 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 29 Nov 2024 17:31:35 +0100 Subject: [PATCH 210/210] collection: Fix duplicate release entry in changelog.yaml Signed-off-by: Bernd Finger --- changelogs/changelog.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 5d6e78e81..b81cefc31 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -208,7 +208,7 @@ releases: | sap_swpm: optionally skip setting file permissions ' release_date: '2024-06-20' - 1.4.1: + 1.5.0: changes: release_summary: '| Release Date: 2024-11-29 major_changes: