data_source_description
stringclasses
1 value
input
stringlengths
19
21.6k
license
stringclasses
1 value
module
stringclasses
219 values
output
stringlengths
2
4.69k
path
stringlengths
8
110
repo_name
stringclasses
9 values
repo_url
stringclasses
12 values
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user
ansible.builtin.set_fact
ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}"
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }}
ansible.builtin.include_tasks
ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM ####
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision
ansible.builtin.add_host
ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform"
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup ####
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts ####
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist
ansible.builtin.file
ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}"
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python
ansible.builtin.package
ansible.builtin.package: name: python3-pip state: present
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed
ansible.builtin.package
ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - wheel
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le"
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA
community.sap_launchpad.software_center_download
community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation ####
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_general_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_general_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure - name: Execute Ansible Role sap_netweaver_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_netweaver_preconfigure
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_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 - name: Execute Ansible Role sap_hana_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure #### Begin SAP software installations ####
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure #### Begin SAP software installations #### - name: Ansible Play for SAP HANA Database Server installation hosts: hana_primary 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
ansible.builtin.include_role: name: community.sap_install.sap_install_media_detect vars: sap_install_media_detect_swpm: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" # Install SAP HANA
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure #### Begin SAP software installations #### - name: Ansible Play for SAP HANA Database Server installation hosts: hana_primary 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" # Install SAP HANA - name: Execute Ansible Role sap_hana_install
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_hana_install
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure #### Begin SAP software installations #### - name: Ansible Play for SAP HANA Database Server installation hosts: hana_primary 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" # Install SAP HANA - name: Execute Ansible Role sap_hana_install ansible.builtin.include_role: name: community.sap_install.sap_hana_install - name: Ansible Play for SAP NetWeaver Application Server installation - ABAP Central Services (ASCS), Database Load, Primary Application Server (PAS) hosts: hana_primary 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
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" sap_install_media_detect_export: "sapbw4hana" # Install SAP BW/4HANA via Ansible Role sap_swpm
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP BW/4HANA Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: hana_primary 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: hana_primary # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: hana_primary 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - "{{ sap_hana_install_software_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP BW/4HANA installation media hosts: hana_primary 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list_bw4hana_install ansible.builtin.set_fact: softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list_bw4hana_install }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: hana_primary 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_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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure #### Begin SAP software installations #### - name: Ansible Play for SAP HANA Database Server installation hosts: hana_primary 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" # Install SAP HANA - name: Execute Ansible Role sap_hana_install ansible.builtin.include_role: name: community.sap_install.sap_hana_install - name: Ansible Play for SAP NetWeaver Application Server installation - ABAP Central Services (ASCS), Database Load, Primary Application Server (PAS) hosts: hana_primary 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" sap_install_media_detect_export: "sapbw4hana" # Install SAP BW/4HANA via Ansible Role sap_swpm - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm # - name: Execute Ansible Role sap_profile_update to update Profile for ICM HTTPS # ansible.builtin.include_role: # name: community.sap_operations.sap_profile_update # vars: # sap_update_profile_sid: "{{ sap_system_sid }}" # sap_update_profile_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" # sap_update_profile_default_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # sap_update_profile_instance_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # - name: Execute Ansible Role sap_control to restart SAP System/s for Profile update changes # ansible.builtin.include_role: # name: community.sap_operations.sap_control # vars: # sap_control_function: "restart_all_sap"
deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}"
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - name: Execute Ansible Role sap_general_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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
ansible.builtin.include_role: name: community.sap_install.sap_netweaver_preconfigure
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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 - name: Execute Ansible Role sap_hana_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure - name: Execute Ansible Role sap_install_media_detect
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_install_media_detect vars: sap_install_media_detect_swpm: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana"
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure - 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" - name: Execute Ansible Role sap_hana_install
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_hana_install
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure - 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" - name: Execute Ansible Role sap_hana_install ansible.builtin.include_role: name: community.sap_install.sap_hana_install - name: Execute Ansible Role sap_install_media_detect
ansible.builtin.include_role
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" sap_install_media_detect_export: "{{ ansible_prompt_sap_system_type_to_restore }}"
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy Restore hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_hana_backup_file_directory prompt: Please enter the directory path (on target) containing the SAP HANA Complete Data Backup files (e.g. /software/backup_files). Ensure no trailing forward slash. private: false - name: ansible_prompt_sap_hana_backup_file_prefix prompt: Please enter the prefix of the SAP HANA Complete Data Backup files (e.g. COMPLETE_DATA_BACKUP) private: false - name: ansible_prompt_sap_hana_backup_db_schema prompt: Please enter the Database Schema name contained in the SAP HANA Complete Data Backup files (e.g. SAPABAP1) private: false - name: ansible_prompt_sap_password_override prompt: Please enter the password to use for SAP HANA and SAP NetWeaver default users during the installation (e.g. NewPass$321) private: true - name: ansible_prompt_sap_password_backup_ddic000 prompt: Please enter the SAP NetWeaver Data Dictionary (DDIC) user password in Client 000 of the Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_system_hana_tenant prompt: Please enter the SAP NetWeaver Password of user 'SYSTEM' inside the SAP HANA Tenant Database Schema. Password is determined by backup file private: true - name: ansible_prompt_sap_password_backup_schema prompt: Please enter the SAP HANA Password of the database schema used in the backup file. Password is determined by backup file private: true - name: ansible_prompt_sap_system_type_to_restore prompt: Please enter the SAP System type to restore from SAP HANA Complete Data Backup (saps4hana, sapecc) private: false - name: ansible_prompt_sap_system_version_to_restore prompt: Please enter the SAP System version to restore from SAP HANA Complete Data Backup (1909, 2020, 2021, 2022, 2023, 6_ehp7, 6_ehp8) private: false - name: ansible_prompt_sap_system_id_db prompt: Please enter desired SAP System ID for SAP HANA Database Server instance (e.g. H01) private: false - name: ansible_prompt_sap_system_id_instance_db prompt: Please enter desired Instance Number for SAP HANA Database Server instance (e.g. 90) private: false - name: ansible_prompt_sap_system_id prompt: Please enter desired SAP System ID for the SAP System such as SAP ECC or SAP S/4HANA (e.g. S01) private: false - name: ansible_prompt_sap_system_id_instance_nwas_ascs prompt: Please enter desired Instance Number for SAP NetWeaver Application Server ASCS instance (e.g. 00) private: false - name: ansible_prompt_sap_system_id_instance_nwas_pas prompt: Please enter desired Instance Number for SAP NetWeaver Application Server PAS instance (e.g. 01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_hana_install_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_master_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_sidadm_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_system_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_db_systemdb_password: "{{ ansible_prompt_sap_password_override }}" sap_swpm_ddic_000_password: "{{ ansible_prompt_sap_password_backup_ddic000 }}" sap_swpm_backup_system_password: "{{ ansible_prompt_sap_password_backup_system_hana_tenant }}" sap_swpm_db_schema_abap_password: "{{ ansible_prompt_sap_password_backup_schema }}" sap_swpm_backup_location: "{{ ansible_prompt_sap_hana_backup_file_directory }}" sap_swpm_backup_prefix: "{{ sap_hana_backup_filename_prefix }}" sap_swpm_db_schema_abap: "{{ ansible_prompt_sap_hana_backup_db_schema }}" sap_hana_install_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_swpm_db_sid: "{{ ansible_prompt_sap_system_id_db }}" sap_hana_install_instance_number: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_db_instance_nr: "{{ ansible_prompt_sap_system_id_instance_db }}" sap_swpm_sid: "{{ ansible_prompt_sap_system_id }}" sap_swpm_ascs_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_ascs }}" sap_swpm_pas_instance_nr: "{{ ansible_prompt_sap_system_id_instance_nwas_pas }}" sap_swpm_fqdn: "{{ ansible_domain }}" sap_swpm_update_etchosts: 'false' sap_swpm_db_host: "{{ ansible_hostname }}" sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}" - 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 - name: Execute Ansible Role sap_hana_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_hana_preconfigure - 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: false sap_install_media_detect_hostagent: true sap_install_media_detect_igs: false sap_install_media_detect_kernel: false sap_install_media_detect_webdisp: false sap_install_media_detect_db: "saphana" - name: Execute Ansible Role sap_hana_install ansible.builtin.include_role: name: community.sap_install.sap_hana_install - 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" sap_install_media_detect_export: "{{ ansible_prompt_sap_system_type_to_restore }}" - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm vars: sap_swpm_templates_product_input: "{{ ansible_prompt_sap_system_type_to_restore + '_' + ansible_prompt_sap_system_version_to_restore + '_sandbox_system_copy' }}" # - name: Execute Ansible Role sap_profile_update to update Profile for ICM HTTPS # ansible.builtin.include_role: # name: community.sap_operations.sap_profile_update # vars: # sap_update_profile_sid: "{{ sap_system_sid }}" # sap_update_profile_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" # sap_update_profile_default_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # sap_update_profile_instance_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # - name: Execute Ansible Role sap_control to restart SAP System/s for Profile update changes # ansible.builtin.include_role: # name: community.sap_operations.sap_control # vars: # sap_control_function: "restart_all_sap"
special_actions/sap_system_copy_restore_hana_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}"
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python
ansible.builtin.package
ansible.builtin.package: name: python3-pip state: present
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Install Python package manager lxml to system Python when ppc64le
ansible.builtin.package
ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present when: - ansible_architecture == "ppc64le"
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Install Python package manager lxml to system Python when ppc64le ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present when: - ansible_architecture == "ppc64le" - name: Install Python dependency wheel to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - wheel
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Install Python package manager lxml to system Python when ppc64le ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present when: - ansible_architecture == "ppc64le" - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Install Python package manager lxml to system Python when ppc64le ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present when: - ansible_architecture == "ppc64le" - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Create directories if does not exist
ansible.builtin.file
ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' with_items: - "{{ target_software_directory }}" # Use task block to call Ansible Module
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP Software installation media downloads hosts: all gather_facts: false become: false vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_downloads_cpu_architecture prompt: Please enter the CPU Architecture of the SAP Software installation media to download (options are either x86_64 or ppc64le) private: false - name: ansible_prompt_sap_downloads_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_s4hana_2023 sap_s4hana_2022 sap_s4hana_2021 sap_s4hana_2020 sap_s4hana_1909 sap_bw4hana_2023 sap_bw4hana_2021 sap_ecc6_ehp8_hana sap_ecc6_ehp8_ibmdb2 sap_ecc6_ehp8_oracledb sap_ecc6_ehp8_sapase sap_ecc6_ehp8_sapmaxdb sap_ecc6_ehp7_hana sap_ecc6_ehp7_ibmdb2 sap_ides_ecc6_ehp8_hana sap_ides_ecc6_ehp8_ibmdb2 sap_ides_ecc6_ehp8_oracledb sap_ides_ecc6_ehp8_sapase sap_ides_ecc6_ehp8_sapmaxdb sap_nwas_750_sp22_java_ibmdb2_ads sap_nwas_750_sp22_java_sapase_ads sap_nwas_750_sp00_abap_hana sap_nwas_750_sp00_abap_ibmdb2 sap_nwas_750_sp00_abap_oracledb sap_nwas_750_sp00_abap_sapase sap_nwas_750_sp00_abap_sapmaxdb sap_nwas_752_sp00_abap_hana sap_nwas_752_sp00_abap_ibmdb2 sap_nwas_752_sp00_abap_oracledb sap_nwas_752_sp00_abap_sapase sap_nwas_752_sp00_abap_sapmaxdb - name: ansible_prompt_target_software_directory prompt: Please enter the software directory on the target host (e.g. /software , /sapcd etc.) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_downloads_cpu_architecture: "{{ ansible_prompt_sap_downloads_cpu_architecture }}" sap_downloads_selected: "{{ ansible_prompt_sap_downloads_selected.split(',') }}" target_software_directory: "{{ ansible_prompt_target_software_directory }}" - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_x86_64] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "x86_64" - item.key in sap_downloads_selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list | default([]) + [item.value.softwarecenter_search_list_ppc64le] | flatten }}" loop: "{{ query('dict', sap_software_templates_dictionary) }}" loop_control: label: "{{ item.key }}" when: - sap_downloads_cpu_architecture == "ppc64le" - item.key in sap_downloads_selected - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Install Python package manager lxml to system Python when ppc64le ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present when: - ansible_architecture == "ppc64le" - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' with_items: - "{{ target_software_directory }}" # Use task block to call Ansible Module - name: Execute Ansible Module to download SAP software
community.sap_launchpad.software_center_download
community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ target_software_directory }}" loop: "{{ softwarecenter_search_list | select() }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed
special_actions/sap_download_install_media/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_ppc64le }}" when: ansible_architecture == "ppc64le"
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_ppc64le }}" when: ansible_architecture == "ppc64le" - name: Create directories if does not exist
ansible.builtin.file
ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "/software"
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_ppc64le }}" when: ansible_architecture == "ppc64le" - name: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "/software" - name: Execute Ansible Module with system Python to download installation media for SAP Diagnostics Agent on Linux
community.sap_launchpad.software_center_download
community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "/software" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_ppc64le }}" when: ansible_architecture == "ppc64le" - name: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "/software" - name: Execute Ansible Module with system Python to download installation media for SAP Diagnostics Agent on Linux community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "/software" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task - name: Execute Ansible Role sap_install_media_detect
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_install_media_detect vars: sap_install_media_detect_source_directory: "/software" sap_install_media_detect_swpm: true sap_install_media_detect_hostagent: true sap_install_media_detect_kernel: true
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP SolMan Diagnostics Agent (SDA) installation hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_id_user prompt: Please enter your SAP ID user (e.g. S-User) private: false - name: ansible_prompt_sap_id_user_password prompt: Please enter your SAP ID password private: true unsafe: true - name: ansible_prompt_sap_sda_version_selected private: false prompt: | Please enter which SAP Software installation media to download, select from options (separate with comma - for example sap_s4hana_2022,sap_ecc6_ehp6_hana)... sap_diag_agent_753_for_solman72_sp12 (for SAP SolMan 7.2 SP12) sap_diag_agent_753_for_solman72_sp0_sp11 (for SAP SolMan >= 7.2 SP0 and <= 7.2 SP11) - name: ansible_prompt_sap_install_media_detect_directory prompt: Please enter the directory path (on target) to download install media to and scan for SAP Software (e.g. /software) private: false - name: ansible_prompt_sap_sda_system_id prompt: Please enter desired SAP Diagnostics Agent System ID (e.g. DAA) private: false - name: ansible_prompt_sap_sda_instance_nr prompt: Please enter desired SAP Diagnostics Agent System Number (e.g. 98) private: false - name: ansible_prompt_sap_sda_adm_password prompt: Please enter desired SAP Diagnostics Agent <sid>adm Password private: true unsafe: true - name: ansible_prompt_sap_system_virtual_hostname prompt: Please enter the Virtual Host Name (short) of the target SAP System (e.g. s4h01) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_id_user: "{{ ansible_prompt_sap_id_user }}" sap_id_user_password: "{{ ansible_prompt_sap_id_user_password }}" sap_sda_version_selected: "{{ ansible_prompt_sap_sda_version_selected }}" sap_install_media_detect_directory: "{{ ansible_prompt_sap_install_media_detect_directory }}" sap_sda_system_id: "{{ ansible_prompt_sap_sda_system_id }}" sap_sda_instance_nr: "{{ ansible_prompt_sap_sda_instance_nr }}" sap_sda_adm_password: "{{ ansible_prompt_sap_sda_adm_password }}" sap_system_virtual_hostname: "{{ ansible_prompt_sap_system_virtual_hostname }}" # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_x86_64 }}" when: ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_software_templates_dictionary[sap_sda_version_selected].softwarecenter_search_list_ppc64le }}" when: ansible_architecture == "ppc64le" - name: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "/software" - name: Execute Ansible Module with system Python to download installation media for SAP Diagnostics Agent on Linux community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "/software" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task - 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_source_directory: "/software" sap_install_media_detect_swpm: true sap_install_media_detect_hostagent: true sap_install_media_detect_kernel: true - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm vars: sap_swpm_generic: true # tech debt, force override of the SAP NetWeaver install media files detection by sap_swpm itself sap_swpm_ansible_role_mode: advanced_templates sap_swpm_templates_product_input: sap_diagnostics_agent_753 sap_swpm_templates_install_dictionary: sap_diagnostics_agent_753: sap_swpm_product_catalog_id: NW_DiagnosticsAgent:GENERIC.IND.PD sap_swpm_inifile_custom_values_dictionary: archives.downloadBasket: "{{ sap_swpm_software_path }}" # From detected path in sap_install_media_detect hostAgent.sapAdmPassword: "{{ sap_sda_adm_password }}" DiagnosticsAgent.LogicalHostName: "{{ sap_system_virtual_hostname }}" DiagnosticsAgent.SID: "{{ sap_sda_system_id }}" DiagnosticsAgent.InstanceNumber: "{{ sap_sda_instance_nr | int }}" DiagnosticsAgent.dasidAdmPassword: "{{ sap_sda_adm_password }}" DiagnosticsAgent.SAPJVMVersion: SAPJVM8 DiagnosticsAgent.installSAPHostAgent: true DiagnosticsAgent.SolMan.Connection: none # solman or none to skip Connection of the Diagnostics Agent to Diagnostics in SAP Solution Manager DiagnosticsAgent.SolMan.UseSSL: false # true or false to skip Connection of the Diagnostics Agent to Diagnostics in SAP Solution Manager # DiagnosticsAgent.SolMan.HostName: solman01.example.com # DiagnosticsAgent.SolMan.PortNumber: 44401 # DiagnosticsAgent.SolMan.UserName: SOLMAN_ADMIN # DiagnosticsAgent.SolMan.Password: "NewPass$321" # DiagnosticsAgent.SAProuter.RouteString: # DiagnosticsAgent.SAProuter.Password: DiagnosticsAgent.SLD.Connection: "no" # DiagnosticsAgent.SLD.HostName: # DiagnosticsAgent.SLD.Password: # DiagnosticsAgent.SLD.PortNumber: # DiagnosticsAgent.SLD.UseHTTPS: # DiagnosticsAgent.SLD.UserName:
special_actions/sap_sda/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user
ansible.builtin.set_fact
ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}"
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform
ansible.builtin.include_tasks
ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform"
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible
ansible.builtin.include_tasks
ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM ####
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision
ansible.builtin.add_host
ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform"
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup ####
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts ####
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist
ansible.builtin.file
ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}"
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python
ansible.builtin.package
ansible.builtin.package: name: python3-pip state: present
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed
ansible.builtin.package
ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - wheel
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le"
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA
community.sap_launchpad.software_center_download
community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation ####
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: nwas_aas 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_general_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: nwas_aas 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_general_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure - name: Execute Ansible Role sap_netweaver_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_netweaver_preconfigure #### Begin SAP software installations ####
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: nwas_aas 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_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 #### Begin SAP software installations #### - name: Ansible Play for SAP Web Dispatcher installation hosts: nwas_aas 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
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: true
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP Web Dispatcher installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via Terraform ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible_to_terraform" - name: Playbook Interactive - Trigger prompts for VM provisioning via Ansible ansible.builtin.include_tasks: interactive/ansible_tasks_control_inputs.yml when: - playbook_enable_interactive_prompts - sap_vm_provision_iac_type == "ansible" #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup hosts: nwas_aas 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # hosts: nwas_aas # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media hosts: nwas_aas 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading SAP S/4HANA installation media hosts: nwas_aas 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_x86_64[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ softwarecenter_search_list_ppc64le[sap_playbook_webdispatcher_version] }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts hosts: nwas_aas 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_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 #### Begin SAP software installations #### - name: Ansible Play for SAP Web Dispatcher installation hosts: nwas_aas 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: true - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm
special_actions/sap_webdispatcher_standalone/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy EXPORT hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_swpm_sapcar_path prompt: Please enter the directory path to SAPCAR (excluding filename, e.g. /software) private: false - name: ansible_prompt_sap_swpm_sapcar_file_name prompt: Please enter filename of SAPCAR file (e.g. SAPCAR_1115-70006178.EXE) private: false - name: ansible_prompt_sap_swpm_swpm_path prompt: Please enter the directory path to SAP SWPM SAR (excluding filename, e.g. /software/sap_swpm) private: false - name: ansible_prompt_sap_swpm_swpm_sar_file_name prompt: Please enter filename of SAP SWPM SAR (e.g. SWPM10SP39_1-20009701.SAR) private: false - name: ansible_prompt_sap_export_directory prompt: Please enter the directory path for the EXPORT files (e.g. /software/sap_export) private: false - name: ansible_prompt_sap_export_system_software_version prompt: Please enter the source SAP System type to export (sap_ecc6_ehp8_anydb) private: false - name: ansible_prompt_sap_export_system_setup prompt: Please enter the source SAP System setup architecture (distributed) private: false - name: ansible_prompt_sap_export_db_type_source prompt: Please enter the source SAP HANA or SAP AnyDB type to export from (ibmdb2) private: false - name: ansible_prompt_sap_export_profile_path prompt: Please enter the source Profile Path of the SAP System to export (e.g. /sapmnt/E01/profile) private: false - name: ansible_prompt_sap_export_db_connect_user prompt: Please enter the source DB Connection user of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_schema_abap prompt: Please enter the source DB Schema (ABAP) of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_type_target prompt: Please enter the export's target database type - SAP HANA or SAP AnyDB type (saphana, sapase, sapmaxdb, ibmdb2, oracledb) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_swpm_sapcar_path: "{{ ansible_prompt_sap_swpm_sapcar_path }}" sap_swpm_sapcar_file_name: "{{ ansible_prompt_sap_swpm_sapcar_file_name }}" sap_swpm_swpm_path: "{{ ansible_prompt_sap_swpm_swpm_path }}" sap_swpm_swpm_sar_file_name: "{{ ansible_prompt_sap_swpm_swpm_sar_file_name }}" sap_export_directory: "{{ ansible_prompt_sap_export_directory }}" sap_export_system_software_version: "{{ ansible_prompt_sap_export_system_software_version }}" sap_export_system_setup: "{{ ansible_prompt_sap_export_system_setup }}" sap_export_db_type_source: "{{ ansible_prompt_sap_export_db_type_source }}" sap_export_profile_path: "{{ ansible_prompt_sap_export_profile_path }}" sap_export_db_connect_user: "{{ ansible_prompt_sap_export_db_connect_user }}" sap_export_db_schema_abap: "{{ ansible_prompt_sap_export_db_schema_abap }}" sap_export_db_type_target: "{{ ansible_prompt_sap_export_db_type_target }}"
special_actions/sap_system_copy_export/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy EXPORT hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_swpm_sapcar_path prompt: Please enter the directory path to SAPCAR (excluding filename, e.g. /software) private: false - name: ansible_prompt_sap_swpm_sapcar_file_name prompt: Please enter filename of SAPCAR file (e.g. SAPCAR_1115-70006178.EXE) private: false - name: ansible_prompt_sap_swpm_swpm_path prompt: Please enter the directory path to SAP SWPM SAR (excluding filename, e.g. /software/sap_swpm) private: false - name: ansible_prompt_sap_swpm_swpm_sar_file_name prompt: Please enter filename of SAP SWPM SAR (e.g. SWPM10SP39_1-20009701.SAR) private: false - name: ansible_prompt_sap_export_directory prompt: Please enter the directory path for the EXPORT files (e.g. /software/sap_export) private: false - name: ansible_prompt_sap_export_system_software_version prompt: Please enter the source SAP System type to export (sap_ecc6_ehp8_anydb) private: false - name: ansible_prompt_sap_export_system_setup prompt: Please enter the source SAP System setup architecture (distributed) private: false - name: ansible_prompt_sap_export_db_type_source prompt: Please enter the source SAP HANA or SAP AnyDB type to export from (ibmdb2) private: false - name: ansible_prompt_sap_export_profile_path prompt: Please enter the source Profile Path of the SAP System to export (e.g. /sapmnt/E01/profile) private: false - name: ansible_prompt_sap_export_db_connect_user prompt: Please enter the source DB Connection user of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_schema_abap prompt: Please enter the source DB Schema (ABAP) of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_type_target prompt: Please enter the export's target database type - SAP HANA or SAP AnyDB type (saphana, sapase, sapmaxdb, ibmdb2, oracledb) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_swpm_sapcar_path: "{{ ansible_prompt_sap_swpm_sapcar_path }}" sap_swpm_sapcar_file_name: "{{ ansible_prompt_sap_swpm_sapcar_file_name }}" sap_swpm_swpm_path: "{{ ansible_prompt_sap_swpm_swpm_path }}" sap_swpm_swpm_sar_file_name: "{{ ansible_prompt_sap_swpm_swpm_sar_file_name }}" sap_export_directory: "{{ ansible_prompt_sap_export_directory }}" sap_export_system_software_version: "{{ ansible_prompt_sap_export_system_software_version }}" sap_export_system_setup: "{{ ansible_prompt_sap_export_system_setup }}" sap_export_db_type_source: "{{ ansible_prompt_sap_export_db_type_source }}" sap_export_profile_path: "{{ ansible_prompt_sap_export_profile_path }}" sap_export_db_connect_user: "{{ ansible_prompt_sap_export_db_connect_user }}" sap_export_db_schema_abap: "{{ ansible_prompt_sap_export_db_schema_abap }}" sap_export_db_type_target: "{{ ansible_prompt_sap_export_db_type_target }}" - name: Create directory for SAP System Copy EXPORT
ansible.builtin.file
ansible.builtin.file: path: "{{ sap_export_directory }}" state: directory mode: '0755' # NOTE: SAP NetWeaver PAS must be installed first, otherwise Export execution will have error # on nested step 'checkABAP' in NW_checkModel_systemCompleteness of NW_readProfileDir from parent NW_GetSidFromProfiles # caused by SAP SWPM function 'GetInstallationStatus' which will evaluate the SAP Start Profile as 'installationStatus:partial'
special_actions/sap_system_copy_export/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- - name: Ansible Play for SAP System Copy EXPORT hosts: all gather_facts: true 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 vars_prompt: - name: ansible_prompt_sap_swpm_sapcar_path prompt: Please enter the directory path to SAPCAR (excluding filename, e.g. /software) private: false - name: ansible_prompt_sap_swpm_sapcar_file_name prompt: Please enter filename of SAPCAR file (e.g. SAPCAR_1115-70006178.EXE) private: false - name: ansible_prompt_sap_swpm_swpm_path prompt: Please enter the directory path to SAP SWPM SAR (excluding filename, e.g. /software/sap_swpm) private: false - name: ansible_prompt_sap_swpm_swpm_sar_file_name prompt: Please enter filename of SAP SWPM SAR (e.g. SWPM10SP39_1-20009701.SAR) private: false - name: ansible_prompt_sap_export_directory prompt: Please enter the directory path for the EXPORT files (e.g. /software/sap_export) private: false - name: ansible_prompt_sap_export_system_software_version prompt: Please enter the source SAP System type to export (sap_ecc6_ehp8_anydb) private: false - name: ansible_prompt_sap_export_system_setup prompt: Please enter the source SAP System setup architecture (distributed) private: false - name: ansible_prompt_sap_export_db_type_source prompt: Please enter the source SAP HANA or SAP AnyDB type to export from (ibmdb2) private: false - name: ansible_prompt_sap_export_profile_path prompt: Please enter the source Profile Path of the SAP System to export (e.g. /sapmnt/E01/profile) private: false - name: ansible_prompt_sap_export_db_connect_user prompt: Please enter the source DB Connection user of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_schema_abap prompt: Please enter the source DB Schema (ABAP) of the SAP System to export (e.g. sape01) private: false - name: ansible_prompt_sap_export_db_type_target prompt: Please enter the export's target database type - SAP HANA or SAP AnyDB type (saphana, sapase, sapmaxdb, ibmdb2, oracledb) private: false # Use include_role inside Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation tasks: - name: Set facts for all hosts ansible.builtin.set_fact: sap_swpm_sapcar_path: "{{ ansible_prompt_sap_swpm_sapcar_path }}" sap_swpm_sapcar_file_name: "{{ ansible_prompt_sap_swpm_sapcar_file_name }}" sap_swpm_swpm_path: "{{ ansible_prompt_sap_swpm_swpm_path }}" sap_swpm_swpm_sar_file_name: "{{ ansible_prompt_sap_swpm_swpm_sar_file_name }}" sap_export_directory: "{{ ansible_prompt_sap_export_directory }}" sap_export_system_software_version: "{{ ansible_prompt_sap_export_system_software_version }}" sap_export_system_setup: "{{ ansible_prompt_sap_export_system_setup }}" sap_export_db_type_source: "{{ ansible_prompt_sap_export_db_type_source }}" sap_export_profile_path: "{{ ansible_prompt_sap_export_profile_path }}" sap_export_db_connect_user: "{{ ansible_prompt_sap_export_db_connect_user }}" sap_export_db_schema_abap: "{{ ansible_prompt_sap_export_db_schema_abap }}" sap_export_db_type_target: "{{ ansible_prompt_sap_export_db_type_target }}" - name: Create directory for SAP System Copy EXPORT ansible.builtin.file: path: "{{ sap_export_directory }}" state: directory mode: '0755' # NOTE: SAP NetWeaver PAS must be installed first, otherwise Export execution will have error # on nested step 'checkABAP' in NW_checkModel_systemCompleteness of NW_readProfileDir from parent NW_GetSidFromProfiles # caused by SAP SWPM function 'GetInstallationStatus' which will evaluate the SAP Start Profile as 'installationStatus:partial' - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm vars: sap_swpm_templates_product_input: "{{ sap_export_system_software_version + '_' + sap_export_db_type_source + '_' + sap_export_system_setup + '_syscopy_export' }}" sap_swpm_generic: true # tech debt, force override of the SAP NetWeaver install media files detection by sap_swpm itself
special_actions/sap_system_copy_export/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user
ansible.builtin.set_fact
ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }}
ansible.builtin.include_tasks
ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM ####
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision
ansible.builtin.add_host
ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup ####
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts ####
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist
ansible.builtin.file
ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python
ansible.builtin.package
ansible.builtin.package: name: python3-pip state: present
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed
ansible.builtin.package
ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - wheel
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python
ansible.builtin.pip
ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list
ansible.builtin.set_fact
ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver
community.sap_launchpad.software_center_download
community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation ####
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts 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_general_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts 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_general_preconfigure ansible.builtin.include_role: name: community.sap_install.sap_general_preconfigure - name: Execute Ansible Role sap_netweaver_preconfigure
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_netweaver_preconfigure #### Begin SAP software installations ####
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts 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_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 #### Begin SAP software installations #### - name: Ansible Play for Oracle DB Database Server and SAP NetWeaver Application Server installation - ABAP Central Services (ASCS) and 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
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: "oracledb" sap_install_media_detect_db_client: "oracledb" sap_install_media_detect_export: "sapnwas_abap"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts 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_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 #### Begin SAP software installations #### - name: Ansible Play for Oracle DB Database Server and SAP NetWeaver Application Server installation - ABAP Central Services (ASCS) and 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: "oracledb" sap_install_media_detect_db_client: "oracledb" sap_install_media_detect_export: "sapnwas_abap" - name: Execute Ansible Role sap_anydb_install_oracle
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_anydb_install_oracle # Install Oracle DB and SAP NetWeaver via Ansible Role sap_swpm
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with Oracle DB Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts - name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }} ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml" when: playbook_enable_interactive_prompts #### Provision VM #### - name: Ansible Play to create dynamic inventory group for provisioning hosts: localhost gather_facts: false tasks: - name: Create dynamic inventory group for Ansible Role sap_vm_provision ansible.builtin.add_host: name: "{{ item }}" group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() }}" when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP hosts: sap_vm_provision_target_inventory_group # Ansible Play target hosts pattern, use Inventory Group created by previous Ansible Task (add_host) gather_facts: false tasks: - name: Execute Ansible Role sap_vm_provision ansible.builtin.include_role: name: community.sap_infrastructure.sap_vm_provision when: sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" #### VM storage filesystem setup #### - name: Ansible Play for hosts storage setup 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: # Use inventory_hostname_short to retrieve host specification from the dictionary. While ansible_hostname will work for Ansible only, using Ansible>Terraform may see ansible_hostname as 'localhost' and fail - name: Execute Ansible Role sap_storage_setup ansible.builtin.include_role: name: community.sap_install.sap_storage_setup vars: sap_storage_setup_sid: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_sid | default('') }}" sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" sap_storage_setup_host_type: "{{ host_specifications_dictionary[sap_vm_provision_host_specification_plan][inventory_hostname_short].sap_storage_setup_host_type | list }}" # sap_storage_setup_definition set for the host by sap_vm_provision Ansible Role when: - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - not sap_vm_provision_iac_type == "existing_hosts" # - name: Ansible Play to execute Preflight Checks # 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_vm_preflight_checks # ansible.builtin.include_role: # name: community.sap_infrastructure.sap_vm_verify #### Begin downloading SAP software installation media to hosts #### - name: Ansible Play for preparing downloads of SAP Software installation media 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: Create directories if does not exist ansible.builtin.file: path: "{{ item }}" state: directory mode: '0755' loop: - "{{ sap_install_media_detect_source_directory }}" - name: Install Python package manager pip3 to system Python ansible.builtin.package: name: python3-pip state: present - name: Ensure OS Packages for lxml are installed ansible.builtin.package: name: - python3-lxml - libxslt-devel - libxml2-devel state: present - name: Install Python dependency wheel to system Python ansible.builtin.pip: name: - wheel - name: Install Python dependencies for Ansible Modules to system Python ansible.builtin.pip: name: - urllib3 - requests - beautifulsoup4 - lxml - name: Ansible Play for downloading installation media 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: # Set facts based on the install dictionary and the default template selected - name: Set fact x86_64 softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}" when: - ansible_architecture == "x86_64" # Set facts based on the install dictionary and the default template selected - name: Set fact ppc64le softwarecenter_search_list ansible.builtin.set_fact: softwarecenter_search_list: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}" when: - ansible_architecture == "ppc64le" - name: Execute Ansible Module with system Python to download installation media for Oracle DB and SAP NetWeaver community.sap_launchpad.software_center_download: suser_id: "{{ sap_id_user }}" suser_password: "{{ sap_id_user_password }}" softwarecenter_search_query: "{{ item }}" dest: "{{ sap_install_media_detect_source_directory }}" loop: "{{ softwarecenter_search_list }}" loop_control: label: "{{ item }} : {{ download_task.msg }}" register: download_task retries: 1 until: download_task is not failed #### Begin SAP software hosts preparation #### - name: Ansible Play for preparing all SAP software hosts 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_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 #### Begin SAP software installations #### - name: Ansible Play for Oracle DB Database Server and SAP NetWeaver Application Server installation - ABAP Central Services (ASCS) and 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: "oracledb" sap_install_media_detect_db_client: "oracledb" sap_install_media_detect_export: "sapnwas_abap" - name: Execute Ansible Role sap_anydb_install_oracle ansible.builtin.include_role: name: community.sap_install.sap_anydb_install_oracle # Install Oracle DB and SAP NetWeaver via Ansible Role sap_swpm - name: Execute Ansible Role sap_swpm
ansible.builtin.include_role
ansible.builtin.include_role: name: community.sap_install.sap_swpm # - name: Execute Ansible Role sap_profile_update to update Profile for ICM HTTPS # ansible.builtin.include_role: # name: community.sap_operations.sap_profile_update # vars: # sap_update_profile_sid: "{{ sap_system_sid }}" # sap_update_profile_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" # sap_update_profile_default_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # sap_update_profile_instance_profile_params: # - icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=3600 # - name: Execute Ansible Role sap_control to restart SAP System/s for Profile update changes # ansible.builtin.include_role: # name: community.sap_operations.sap_control # vars: # sap_control_function: "restart_all_sap"
deploy_scenarios/sap_nwas_abap_oracledb_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with IBM Db2 Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user
ansible.builtin.set_fact
ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}"
deploy_scenarios/sap_nwas_abap_ibmdb2_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with IBM Db2 Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_ibmdb2_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with IBM Db2 Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_ibmdb2_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with IBM Db2 Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap
ansible.builtin.pause
ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_ibmdb2_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap
--- # Ansible Playbook for SAP NetWeaver (ABAP) with IBM Db2 Sandbox installation # Use include_role / include_tasks inside Ansible Task block, instead of using roles declaration or Task block with import_roles. # This ensures Ansible Roles, and the tasks within, will be parsed in sequence instead of parsing at Playbook initialisation. #### Begin Infrastructure-as-Code provisioning #### - name: Ansible Play to gather input for gathering vars and VM provisioning hosts: localhost gather_facts: false # pre_tasks used only for Interactive Prompts only and can be removed without impact pre_tasks: - name: Playbook Interactive - Check if standard execution with an Ansible Extravars file is requested by end user ansible.builtin.set_fact: playbook_enable_interactive_prompts: "{{ true if (sap_vm_provision_iac_type is undefined and sap_vm_provision_iac_platform is undefined) else false }}" - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_type ansible.builtin.pause: prompt: "Please choose Infrastructure-as-Code automation from list - ansible , ansible_to_terraform (for existing_hosts, use Ansible standard execution with an Ansible Extravars file)" register: sap_vm_provision_iac_type_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Provision execution - Input for sap_vm_provision_iac_platform ansible.builtin.pause: prompt: "Please choose Infrastructure Platform from list - aws_ec2_vs , gcp_ce_vm , ibmcloud_powervs , ibmcloud_vs , ibmpowervm_vm , kubevirt_vm , msazure_vm , ovirt_vm" register: sap_vm_provision_iac_platform_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - SAP Deployment execution - Input for playbook_enable_default_vars_sap ansible.builtin.pause: prompt: "Please choose if defaults should be used for SAP Software installation (e.g. SAP System ID) - true , false" register: playbook_enable_default_vars_sap_register no_log: true when: playbook_enable_interactive_prompts - name: Playbook Interactive - Set facts from initial prompts
ansible.builtin.set_fact
ansible.builtin.set_fact: sap_vm_provision_iac_type: "{{ sap_vm_provision_iac_type_register.user_input }}" sap_vm_provision_iac_platform: "{{ sap_vm_provision_iac_platform_register.user_input }}" playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}" when: playbook_enable_interactive_prompts
deploy_scenarios/sap_nwas_abap_ibmdb2_sandbox/ansible_playbook.yml
ansible
https://github.com/sap-linuxlab/ansible.playbooks_for_sap