-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sap_vm_provision: sample for test run
- Loading branch information
1 parent
dbf6119
commit 2e5e771
Showing
3 changed files
with
116 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
|
||
# This sample Ansible Playbook is not a full example, | ||
# which would pass additional variables onto other | ||
# Ansible Roles such as sap_storage_setup. | ||
# It is only to test the provisioning process | ||
# of a small Virtual Machine. | ||
|
||
- name: Ansible Play to include_vars | ||
hosts: all | ||
become: true | ||
pre_tasks: | ||
|
||
# Alternative to executing ansible-playbook with -e for Ansible Extravars file | ||
- name: Include sample variables for AWS EC2 | ||
ansible.builtin.include_vars: ./vars/sample-variables-sap-vm-provision-aws-ec2-vs.yml | ||
|
||
|
||
- 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: "{{ sap_vm_provision_ibmcloud_vs_host_specifications_dictionary[sap_vm_provision_host_specification_plan].keys() }}" | ||
|
||
|
||
- 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" |
70 changes: 70 additions & 0 deletions
70
playbooks/vars/sample-variables-sap-vm-provision-aws-ec2-vs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
|
||
# This sample Ansible Playbook is not a full example, | ||
# which would pass additional variables onto other | ||
# Ansible Roles such as sap_storage_setup. | ||
# It is only to test the provisioning process | ||
# of a small Virtual Machine. | ||
|
||
#### | ||
# Infrastructure Provisioning selection | ||
#### | ||
|
||
sap_vm_provision_iac_type: "ansible" # ansible , ansible_to_terraform , existing_hosts | ||
sap_vm_provision_iac_platform: "aws_ec2_vs" # aws_ec2_vs , gcp_ce_vm , ibmcloud_vs , ibmcloud_powervs , msazure_vm , ibmpowervm_vm , kubevirt_vm , ovirt_vm , vmware_vm | ||
|
||
sap_vm_provision_host_specification_plan: "test_plan_16gb" | ||
sap_vm_provision_dns_root_domain: "poc.cloud" | ||
|
||
|
||
#### | ||
# Infrastructure Provisioning selection | ||
# AWS | ||
# | ||
# Only for use when 'aws_ec2_vs' is value provided for variable sap_vm_provision_iac_platform | ||
#### | ||
|
||
sap_vm_provision_aws_access_key: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_aws_secret_access_key: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_aws_region: "{{ sap_vm_provision_aws_vpc_availability_zone[:-1] }}" | ||
sap_vm_provision_aws_vpc_availability_zone: "eu-west-2c" | ||
sap_vm_provision_aws_vpc_subnet_create_boolean: "{{ true | default(false) if aws_vpc_subnet_id == 'new' else false }}" | ||
sap_vm_provision_aws_vpc_subnet_id: "ENTER_STRING_VALUE_HERE" # if ansible_to_terraform, use "new" | ||
sap_vm_provision_aws_ec2_vs_host_os_image: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_bastion_user: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_bastion_ssh_port: "ENTER_STRING_VALUE_HERE" | ||
|
||
# Only for use when 'ansible' is value provided for variable sap_vm_provision_iac_type | ||
#### | ||
sap_vm_provision_bastion_public_ip: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_ssh_bastion_private_key_file_path: "./bastion_rsa" | ||
sap_vm_provision_ssh_host_private_key_file_path: "./hosts_rsa" | ||
sap_vm_provision_aws_key_pair_name_ssh_host_public_key: "ENTER_STRING_VALUE_HERE" | ||
sap_vm_provision_aws_vpc_sg_names: "ENTER_STRING_VALUE_HERE" | ||
|
||
|
||
#### | ||
# Infrastructure Definitions | ||
# AWS | ||
#### | ||
|
||
sap_vm_provision_aws_ec2_vs_host_os_image_dictionary: | ||
rhel-8-6: "*RHEL-8.6*_HVM*x86_64*" | ||
rhel-8-6-sap-ha: "*RHEL-SAP-8.6.0*" | ||
sles-15-4: "*suse-sles-15-sp4-v202*-hvm-ssd-x86_64*" | ||
sles-15-4-sap-ha: "*suse-sles-sap-15-sp4-v202*-hvm-ssd-x86_64*" | ||
|
||
sap_vm_provision_aws_ec2_vs_host_specifications_dictionary: | ||
test_plan_16gb: | ||
test-ec2-vs: # Hostname, must be 13 characters or less | ||
sap_host_type: hana_primary # hana_primary, hana_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas | ||
virtual_machine_profile: r7i.large | ||
disable_ip_anti_spoofing: true | ||
storage_definition: | ||
- name: hana_data | ||
mountpoint: /hana/data | ||
#disk_count: 1 # default: 1, if more then then LVM logical volume will be striped across the defined disks | ||
disk_size: 384 # size in GB, integer | ||
#disk_type: gp3 # default: gp3, for AWS EBS disk type | ||
#disk_iops: # default: null, for AWS EBS with custom IOPS | ||
filesystem_type: xfs # default: xfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters