src/modules/get_azure_lb.py [15:116]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
try:
    from ansible.module_utils.sap_automation_qa import (
        SapAutomationQA,
        TestStatus,
        Parameters,
    )
except ImportError:
    from src.module_utils.sap_automation_qa import (
        SapAutomationQA,
        TestStatus,
        Parameters,
    )

DOCUMENTATION = r"""
---
module: get_azure_lb
short_description: Gets and validates Azure Load Balancer details
description:
    - This module retrieves Azure Load Balancer details for DB/SCS/ERS in a specific resource group.
    - Validates load balancer rules and health probe configurations against expected values.
    - Uses Azure SDK to interact with Azure Network resources.
options:
    subscription_id:
        description:
            - The Azure subscription ID.
        type: str
        required: true
    region:
        description:
            - Azure region where the resources are deployed.
        type: str
        required: true
    inbound_rules:
        description:
            - JSON string containing inbound rule configurations to check for.
            - Must include privateIpAddress fields to match load balancers.
        type: str
        required: true
    constants:
        description:
            - Dictionary containing expected configuration values for validation.
            - Must include AZURE_LOADBALANCER.RULES and AZURE_LOADBALANCER.PROBES.
        type: dict
        required: true
    msi_client_id:
        description:
            - Managed Identity Client ID for authentication.
            - Optional; if not provided, the default Managed Identity will be used.
        type: str
        required: false
author:
    - Microsoft Corporation
notes:
    - Requires Azure SDK for Python.
    - Uses Managed Identity for authentication.
    - Must be run on a machine with Managed Identity credentials configured.
requirements:
    - python >= 3.6
    - azure-identity
    - azure-mgmt-network
"""

EXAMPLES = r"""
- name: Get and validate Azure Load Balancer configuration
  get_azure_lb:
    subscription_id: "{{ azure_subscription_id }}"
    region: "{{ azure_region }}"
    inbound_rules: "{{ inbound_rules | to_json }}"
    constants:
      AZURE_LOADBALANCER:
        RULES:
          idle_timeout_in_minutes: 30
          load_distribution: "Default"
          enable_floating_ip: True
        PROBES:
          interval_in_seconds: 15
          number_of_probes: 3
  register: lb_result

- name: Display load balancer validation results
  debug:
    var: lb_result

- name: Use Managed Identity Client ID for authentication
  get_azure_lb:
    subscription_id: "{{ azure_subscription_id }}"
    region: "{{ azure_region }}"
    inbound_rules: "{{ inbound_rules | to_json }}"
    constants:
      AZURE_LOADBALANCER:
        RULES:
          idle_timeout_in_minutes: 30
          load_distribution: "Default"
          enable_floating_ip: True
        PROBES:
          interval_in_seconds: 15
          number_of_probes: 3
    msi_client_id: "{{ managed_identity_client_id }}"
  register: lb_result
"""

RETURN = r"""
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/modules/get_pcmk_properties_db.py [16:109]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
try:
    from ansible.module_utils.sap_automation_qa import (
        SapAutomationQA,
        TestStatus,
        Parameters,
    )
    from ansible.module_utils.commands import CIB_ADMIN
except ImportError:
    from src.module_utils.sap_automation_qa import (
        SapAutomationQA,
        TestStatus,
        Parameters,
    )
    from src.module_utils.commands import CIB_ADMIN

DOCUMENTATION = r"""
---
module: get_pcmk_properties_db
short_description: Validates Pacemaker cluster configurations for SAP HANA
description:
    - Validates Pacemaker cluster configurations against predefined standards for SAP HANA deployments
    - Checks basic cluster properties, resource configurations, and constraints
    - Verifies OS parameters and global.ini settings
    - Provides detailed validation results for each parameter
options:
    sid:
        description:
            - SAP HANA database SID
        type: str
        required: true
    instance_number:
        description:
            - SAP HANA instance number
        type: str
        required: true
    ansible_os_family:
        description:
            - Operating system family (redhat, suse, etc.)
        type: str
        required: true
    virtual_machine_name:
        description:
            - Name of the virtual machine
        type: str
        required: true
    fencing_mechanism:
        description:
            - Type of fencing mechanism used
        type: str
        required: true
    os_version:
        description:
            - Operating system version
        type: str
        required: true
    pcmk_constants:
        description:
            - Dictionary of constants for validation
        type: dict
        required: true
author:
    - Microsoft Corporation
notes:
    - Module requires root privileges to execute cluster management commands
    - Relies on cibadmin to query Pacemaker configuration
    - Validates configurations against predefined standards in pcmk_constants
requirements:
    - python >= 3.6
    - Pacemaker cluster environment
"""

EXAMPLES = r"""
- name: Validate Pacemaker cluster configuration for SAP HANA
  get_pcmk_properties_db:
    sid: "HDB"
    instance_number: "00"
    ansible_os_family: "{{ ansible_os_family|lower }}"
    virtual_machine_name: "{{ ansible_hostname }}"
    fencing_mechanism: "sbd"
    os_version: "{{ ansible_distribution_version }}"
    pcmk_constants: "{{ pcmk_validation_constants }}"
  register: pcmk_validation_result

- name: Display cluster validation results
  debug:
    var: pcmk_validation_result

- name: Fail if cluster configuration is invalid
  fail:
    msg: "Pacemaker cluster configuration does not meet requirements"
  when: pcmk_validation_result.status == 'ERROR'
"""

RETURN = r"""
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



