Skip to content

Latest commit

 

History

History
204 lines (160 loc) · 6.53 KB

File metadata and controls

204 lines (160 loc) · 6.53 KB

sap_ha_install_hana_hsr Ansible Role

Ansible Lint for sap_ha_install_hana_hsr

Description

The Ansible Role sap_ha_install_hana_hsr is used to configure and enable SAP HANA System Replication between 2 nodes.

Prerequisites

Managed nodes:

  • Same Operating system version
  • SAP HANA is installed with same version on both nodes.

Execution

Recommended

It is recommended to execute this role together with other roles in this collection, in the following order:

  1. sap_general_preconfigure
  2. sap_hana_preconfigure
  3. sap_install_media_detect
  4. 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

---
- 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: "My_HANA_Password"
        sap_ha_install_hana_hsr_domain: example.com

Further Information

For more examples on how to use this role in different installation scenarios, refer to the ansible.playbooks_for_sap playbooks.

License

Apache 2.0

Maintainers

Role Variables

sap_ha_install_hana_hsr_state

  • Type: string
  • Default: present

Set the desired state of the HSR configuration.
present - Creates and enables the HSR configuration.
absent - Removes the HSR configuration.
Removal of existing configuration requires correctly configured sap_ha_install_hana_hsr_cluster_nodes.

sap_ha_install_hana_hsr_sid

  • Type: string

SAP HANA Database System ID (SID) in capital letters.
This can be inherited from the variable sap_hana_sid.

sap_ha_install_hana_hsr_instance_number

  • Type: string

SAP HANA Database Instance Number.
This can be inherited from the variable sap_hana_instance_number.

sap_ha_install_hana_hsr_cluster_nodes

  • Type: list of dictionary type

List of dictionaries defining the nodes in the HSR setup.
This can be inherited from the variable sap_hana_cluster_nodes.

  • node_name
    Short hostname of the node (String).
  • node_ip
    IP address of the node (String).
  • node_role
    Role of the node in the HSR setup (String).
    Available options: primary, secondary.
  • hana_site
    A unique logical site name (e.g., DC01, EU-WEST) (String).

Example:

sap_ha_install_hana_hsr_cluster_nodes:
  - node_name: 'node01'
    node_ip: '192.168.1.11'
    node_role: 'primary'
    hana_site: 'DC01'

  - node_name: 'node02'
    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

The hdbuserstore key used for connecting to the SYSTEMDB for administrative tasks like backups.

sap_ha_install_hana_hsr_db_system_password

  • Type: string

Password for the HANA SYSTEM user.
This can be inherited from the variable sap_hana_install_master_password.

sap_ha_install_hana_hsr_domain

  • Type: string

The DNS domain name for the HANA nodes.
This is not required if 'node_name' in sap_ha_install_hana_hsr_cluster_nodes is a Fully Qualified Domain Name (FQDN).
Originally called as sap_ha_install_hana_hsr_fqdn.
If not set, the role attempts to use the value of sap_domain or ansible_facts['domain'].

sap_ha_install_hana_hsr_rep_mode

  • Type: string
  • Default: sync

HSR Replication mode.
Available values: sync, syncmem, async

sap_ha_install_hana_hsr_oper_mode

  • Type: string
  • Default: logreplay

HSR Operation mode.
Available values: delta_datashipping, logreplay, logreplay_readaccess

sap_ha_install_hana_hsr_update_etchosts

  • Type: bool
  • Default: True

Set to true to update /etc/hosts on all nodes with the IP addresses and hostnames of all other nodes in the cluster.

sap_ha_install_hana_hsr_home_path

  • Type: string

(Optional) SAP HANA HOME directory path
If not set, it defaults to /usr/sap/<SID>/home.

sap_ha_install_hana_hsr_backup_path

  • Type: string

(Optional) Directory path for the safety backup created before HSR is configured.
If not specified, the default HANA backup location is used.
Required sub-directories (SYSTEMDB and DB_<SID>) will be created automatically within this path
The backup created will have a file prefix of <SID>_PRE_HSR_<TIMESTAMP>.