This document outlines the contribution guidelines for the Ansible Playbooks for SAP. Please read it carefully before submitting any changes.
All scenarios in main branch are self-contained and they should work when copied outside of Ansible Playbooks for SAP.
Example: The playbook sap_hana_ha should still work when sap_hana_ha folder is copied elsewhere.
- Scenario, means the SAP Software Solution/Product which runs upon a target Infrastructure Platform using a Deployment Topology (inc. Installation Type).
- Deployment Topology, means either a Sandbox, Standard, Distributed or High Availability SAP System design has been implemented using different installation types to one or more hosts.
- Installation Type, means a different component of SAP Software has been installed by hdblcm or SAP SWPM with a specific runtime design and layout (e.g. SAP HANA Scale-Up using MDC and TDI-sized storage for OLTP workloads, with High Availability using SAP HANA System Replication in Asynchronous mode).
- Layout, refers to the virtual/physical hardware components such as LVM Virtual Groups with striping/mirroring using Block Storage attached to Virtual Machine/s.
The following branches are present in repository:
dev- Development branch, where we merge from forks. No direct commits, only pull requests from forks.stage- Stable branch is used for releases that reflectsdevbranch. No direct commits, only pull requests fromdev.main- Main default branch, that is created by transformation ofstagebranch. No direct commits or pull requests.
dev > stage > main
- Changes are merged to
devbranch from fork ofdevusing pull request. - Release process is triggered by pull request from
devtostage. - GitHub action
publish-stage-to-main.ymlwill trigger onstagechanges: - Clone
stagebranch to github action runner. - Copy
common_fragments/tasksinto alldeploy_scenariosfolders. - Combine extra vars fragments in following order (example for AWS):
ansible_extravars_aws_ec2_vs_base.ymlcommon_fragments/vars/platform_vars_aws_ec2_vs.ymlansible_extravars_aws_ec2_vs_spec.ymlcommon_fragments/vars/platform_images_aws_ec2_vs.yml
- Append all platform spec and image files to
optional/ansible_extravars_interactive.yml. - Distribute
optional/ansible_requirements.ymlto alldeploy_scenarios. - Remove
common_fragmentsfolder. - Compare current transformed state of
stagebranch against currentmainbranch. - Create commit and push to
mainonly if changes were detected.
- All shared variables can be defined in
common_fragments. - All shared tasks can be defined in
common_fragments. - Promotes code reuse and reduces redundancy across different scenarios.
- Simplifies maintenance by centralizing common configurations and tasks.
- Ensures consistency in configurations and task execution across various scenarios.
Before submitting a pull request, please ensure that your changes have been thoroughly tested.
Testing in dev branch requires including all relevant fragments.
ansible-playbook ansible_playbook.yml \
--extra-vars "@./ansible_extravars.yml" \
--extra-vars "@./ansible_extravars_aws_ec2_vs_base.yml" \
--extra-vars "@./ansible_extravars_aws_ec2_vs_spec.yml" \
--extra-vars "@../../common_fragments/vars/platform_vars_aws_ec2_vs.yml" \
--extra-vars "@../../common_fragments/vars/platform_images_aws_ec2_vs.yml"Please adhere to the following guidelines:
- Follow Ansible best practices for writing playbooks, roles, and tasks.
- Use clear and descriptive names for variables, tasks, and files.
- Include comments to explain complex logic or non-obvious configurations.
- Document roles, playbooks, and variables in their respective README files.