Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ collections:
version: 9.0.0
- name: azure.azcollection
type: galaxy
version: 3.0.1
version: 3.0.0
- name: google.cloud
type: galaxy
version: 1.1.3
Expand Down
3 changes: 2 additions & 1 deletion roles/sap_vm_provision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ Prior to execution of this Ansible Role, there are no Ansible Roles suggested to
- Variables specific to each Infrastructure Platform (e.g. `sap_vm_provision_aws_access_key`)
- Include files from subdirectory based upon chosen method and target (e.g. `/tasks/platform_ansible_to_terraform/aws_ec2_vs/`)
- Provision host/s
- Add hosts to Ansible Inventory Groups defined by the Host Specification Dictionary _(e.g. hana_primary, hana_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas, anydb_primary, anydb_secondary)_
- Add hosts to Ansible Inventory Groups defined by the Host Specification Dictionary `sap_host_type` variable _(e.g. hana_primary, hana_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas, anydb_primary, anydb_secondary)_</br>
**NOTE:** Group names can be customized using `sap_vm_provision_group_*` variables in `vars/default.yml` (e.g. `sap_vm_provision_group_hana_primary`, `sap_vm_provision_group_nwas_ascs`, etc.).
- Perform additional tasks for host/s (e.g. DNS Records, /etc/hosts, register OS for Packages, register Web Forward Proxy)
- Set variables if other Ansible Roles are to be executed (e.g. variables for Ansible Roles in the `sap_install` Ansible Collection)
- Perform any tasks for High Availability (execution dependent on hosts in Ansible Inventory Groups)
Expand Down
14 changes: 13 additions & 1 deletion roles/sap_vm_provision/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ sap_vm_provision_iac_platform: ""
# execution_host where ansible playbook will delegate_to
sap_vm_provision_execution_host: "localhost"

# Customized group names are used by sap_host_type in host_specifications_dictionary plan during provisioning.
# Variables are also used in sap_vm_temp_vip role
sap_vm_provision_group_hana_primary: hana_primary
sap_vm_provision_group_hana_secondary: hana_secondary
sap_vm_provision_group_nwas_ascs: nwas_ascs
sap_vm_provision_group_nwas_scs: nwas_scs
sap_vm_provision_group_nwas_ers: nwas_ers
sap_vm_provision_group_nwas_pas: nwas_pas
sap_vm_provision_group_nwas_aas: nwas_aas
sap_vm_provision_group_anydb_primary: anydb_primary
sap_vm_provision_group_anydb_secondary: anydb_secondary

####
# VM Provision Infrastructure-as-Code (IaC) Configuration - Ansible provisioning - Cloud Hyperscaler
# Only for use when 'ansible' is value provided for variable sap_vm_provision_iac_type
Expand Down Expand Up @@ -666,7 +678,7 @@ sap_vm_provision_aws_ec2_vs_host_specifications_dictionary:
virtual_machine_profile: r5.8xlarge
disable_ip_anti_spoofing: false
#sap_system_type: project_dev # project_dev, project_tst, project_prd
sap_host_type: "" # hana_primary, hana_secondary, anydb_primary, anydb_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas
sap_host_type: hana_primary # hana_primary, hana_secondary, anydb_primary, anydb_secondary, nwas_ascs, nwas_ers, nwas_pas, nwas_aas
storage_definition:
- name: data_0
mountpoint: /data0
Expand Down
14 changes: 7 additions & 7 deletions roles/sap_vm_provision/tasks/common/set_etc_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
line: "{{ sap_vm_provision_dynamic_inventory_hana_primary_ip }}\t{{ sap_vm_provision_dynamic_inventory_hana_primary_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_hana_primary_hostname }}"
state: present
when:
- groups["hana_primary"] is defined and inventory_hostname_short in groups['hana_primary']
- groups[sap_vm_provision_group_hana_primary] is defined and inventory_hostname_short in groups[sap_vm_provision_group_hana_primary]
- not (ansible_play_hosts_all | length) > 1

- name: Update /etc/hosts file when single sandbox host (nwas_pas)
ansible.builtin.lineinfile:
dest: /etc/hosts
line: "{{ sap_vm_provision_dynamic_inventory_nw_pas_ip }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}"
when:
- groups["nwas_pas"] is defined and inventory_hostname_short in groups['nwas_pas']
- groups[sap_vm_provision_group_nwas_pas] is defined and inventory_hostname_short in groups[sap_vm_provision_group_nwas_pas]
- not (ansible_play_hosts_all | length) > 1


Expand All @@ -55,7 +55,7 @@
line: "{{ sap_vm_provision_dynamic_inventory_hana_primary_ip }}\t{{ sap_vm_provision_dynamic_inventory_hana_primary_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_hana_primary_hostname }}"
state: present
when:
- (groups["hana_primary"] is defined and (groups["hana_primary"] | length>0))
- (groups[sap_vm_provision_group_hana_primary] is defined and (groups[sap_vm_provision_group_hana_primary] | length>0))
- (ansible_play_hosts_all | length) > 1


Expand All @@ -65,7 +65,7 @@
line: "{{ sap_vm_provision_dynamic_inventory_anydb_primary_ip }}\t{{ sap_vm_provision_dynamic_inventory_anydb_primary_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_anydb_primary_hostname }}"
state: present
when:
- (groups["anydb_primary"] is defined and (groups["anydb_primary"] | length>0))
- (groups[sap_vm_provision_group_anydb_primary] is defined and (groups[sap_vm_provision_group_anydb_primary] | length>0))
- (ansible_play_hosts_all | length) > 1


Expand All @@ -75,7 +75,7 @@
line: "{{ sap_vm_provision_dynamic_inventory_nw_ascs_ip }}\t{{ sap_vm_provision_dynamic_inventory_nw_ascs_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_nw_ascs_hostname }}"
state: present
when:
- (groups["nwas_ascs"] is defined and (groups["nwas_ascs"] | length>0))
- (groups[sap_vm_provision_group_nwas_ascs] is defined and (groups[sap_vm_provision_group_nwas_ascs] | length>0))
- (ansible_play_hosts_all | length) > 1

- name: Update /etc/hosts file for SAP NetWeaver PAS
Expand All @@ -84,7 +84,7 @@
line: "{{ sap_vm_provision_dynamic_inventory_nw_pas_ip }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_nw_pas_hostname }}"
state: present
when:
- (groups["nwas_pas"] is defined and (groups["nwas_pas"] | length>0))
- (groups[sap_vm_provision_group_nwas_pas] is defined and (groups[sap_vm_provision_group_nwas_pas] | length>0))
- (ansible_play_hosts_all | length) > 1

- name: Update /etc/hosts file for SAP NetWeaver AAS
Expand All @@ -93,5 +93,5 @@
line: "{{ sap_vm_provision_dynamic_inventory_nw_aas_ip }}\t{{ sap_vm_provision_dynamic_inventory_nw_aas_hostname }}.{{ sap_vm_provision_dns_root_domain }}\t{{ sap_vm_provision_dynamic_inventory_nw_aas_hostname }}"
state: present
when:
- (groups["nwas_aas"] is defined and (groups["nwas_aas"] | length>0))
- (groups[sap_vm_provision_group_nwas_aas] is defined and (groups[sap_vm_provision_group_nwas_aas] | length>0))
- (ansible_play_hosts_all | length) > 1
Loading
Loading