From 55dbb4c96a5a4331bed75b30f7ad0922cee35913 Mon Sep 17 00:00:00 2001 From: sean-freeman <1815807+sean-freeman@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:39:20 +0100 Subject: [PATCH] all: amend var names for sap_hana_scaleout --- .../ansible_extravars.yml | 6 +++--- .../ansible_playbook.yml | 18 +++++++++--------- .../sap_hana_scaleout/ansible_extravars.yml | 6 +++--- .../sap_hana_scaleout/ansible_playbook.yml | 18 +++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_extravars.yml b/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_extravars.yml index f61c62d..817ae7e 100755 --- a/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_extravars.yml +++ b/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_extravars.yml @@ -102,9 +102,9 @@ sap_hana_install_update_etchosts: 'false' # Mandatory parameters : Infrastructure provisioning definitions - SAP HANA scale-out #### -sap_hana_scaleout_active_coordinator: 1 -sap_hana_scaleout_active_worker: 2 -sap_hana_scaleout_standby: 1 # Only 0 or 1 +sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator: 1 +sap_vm_provision_calculate_sap_hana_scaleout_active_worker: 2 +sap_vm_provision_calculate_sap_hana_scaleout_standby: 1 # Only 0 or 1 diff --git a/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_playbook.yml b/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_playbook.yml index da46230..8340848 100644 --- a/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_playbook.yml +++ b/deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_playbook.yml @@ -56,38 +56,38 @@ ansible.builtin.set_fact: "{{ sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout' }}": "{{ {} | combine({sap_vm_provision_host_specification_plan: {}}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - dynamically build new Ansible Dictionary ansible.builtin.set_fact: "scaleout_build": "{{ scaleout_build | default({}) | combine({(lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first + host_scaleout_node | string): lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first]}) }}" - loop: "{{ range(0, (sap_hana_scaleout_active_coordinator | int + sap_hana_scaleout_active_worker | int + sap_hana_scaleout_standby | int), 1) | list }}" + loop: "{{ range(0, (sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator | int + sap_vm_provision_calculate_sap_hana_scaleout_active_worker | int + sap_vm_provision_calculate_sap_hana_scaleout_standby | int), 1) | list }}" loop_control: loop_var: host_scaleout_node when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - SAP NetWeaver hosts dynamically build new Ansible Dictionary ansible.builtin.set_fact: "other_host_spec_hosts": "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | combine({lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first: omit}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - Merge dynamically built new Ansible Dictionary keys ansible.builtin.set_fact: all_host_specs: "{{ {} | combine(scaleout_build, other_host_spec_hosts) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - populate new Ansible Dictionary ansible.builtin.set_fact: "{{ sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout' }}": "{{ lookup('ansible.builtin.vars', sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout') | combine({sap_vm_provision_host_specification_plan: all_host_specs}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" @@ -104,7 +104,7 @@ group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout')[sap_vm_provision_host_specification_plan].keys() | default(lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys()) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP @@ -430,12 +430,12 @@ - name: Ansible Vars extravars file check if non-interactive (no var prompts) requested by end user ansible.builtin.set_fact: sap_hana_install_addhosts: | - {%- if sap_hana_scaleout_standby > 0 -%} + {%- if sap_vm_provision_calculate_sap_hana_scaleout_standby > 0 -%} {%- for host in (groups['hana_primary'] | reject('search', '0') | list)[:-1] -%} {{ hostvars[host]['inventory_hostname_short'] }}:role=worker:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }}, {%- endfor -%} {{ hostvars[(groups['hana_primary'][-1])]['inventory_hostname_short'] }}:role=standby:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }} - {%- elif sap_hana_scaleout_standby == 0 -%} + {%- elif sap_vm_provision_calculate_sap_hana_scaleout_standby == 0 -%} {%- for host in (groups['hana_primary'] | reject('search', '0') | list) -%} {{ hostvars[host]['inventory_hostname_short'] }}:role=worker:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }} {%- endfor -%} diff --git a/deploy_scenarios/sap_hana_scaleout/ansible_extravars.yml b/deploy_scenarios/sap_hana_scaleout/ansible_extravars.yml index 0bd76fc..02735b6 100755 --- a/deploy_scenarios/sap_hana_scaleout/ansible_extravars.yml +++ b/deploy_scenarios/sap_hana_scaleout/ansible_extravars.yml @@ -132,9 +132,9 @@ sap_hana_install_update_etchosts: 'false' # Mandatory parameters : Infrastructure provisioning definitions - SAP HANA scale-out #### -sap_hana_scaleout_active_coordinator: 1 -sap_hana_scaleout_active_worker: 2 -sap_hana_scaleout_standby: 1 # Only 0 or 1 +sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator: 1 +sap_vm_provision_calculate_sap_hana_scaleout_active_worker: 2 +sap_vm_provision_calculate_sap_hana_scaleout_standby: 1 # Only 0 or 1 #### diff --git a/deploy_scenarios/sap_hana_scaleout/ansible_playbook.yml b/deploy_scenarios/sap_hana_scaleout/ansible_playbook.yml index 17b1951..411062b 100644 --- a/deploy_scenarios/sap_hana_scaleout/ansible_playbook.yml +++ b/deploy_scenarios/sap_hana_scaleout/ansible_playbook.yml @@ -56,38 +56,38 @@ ansible.builtin.set_fact: "{{ sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout' }}": "{{ {} | combine({sap_vm_provision_host_specification_plan: {}}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - dynamically build new Ansible Dictionary ansible.builtin.set_fact: "scaleout_build": "{{ scaleout_build | default({}) | combine({(lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first + host_scaleout_node | string): lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan][lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first]}) }}" - loop: "{{ range(0, (sap_hana_scaleout_active_coordinator | int + sap_hana_scaleout_active_worker | int + sap_hana_scaleout_standby | int), 1) | list }}" + loop: "{{ range(0, (sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator | int + sap_vm_provision_calculate_sap_hana_scaleout_active_worker | int + sap_vm_provision_calculate_sap_hana_scaleout_standby | int), 1) | list }}" loop_control: loop_var: host_scaleout_node when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - SAP NetWeaver hosts dynamically build new Ansible Dictionary ansible.builtin.set_fact: "other_host_spec_hosts": "{{ lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan] | combine({lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys() | first: omit}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - Merge dynamically built new Ansible Dictionary keys ansible.builtin.set_fact: all_host_specs: "{{ {} | combine(scaleout_build, other_host_spec_hosts) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" - name: Input construct - VM provisioning via Ansible - SAP HANA Scale-Out - populate new Ansible Dictionary ansible.builtin.set_fact: "{{ sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout' }}": "{{ lookup('ansible.builtin.vars', sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout') | combine({sap_vm_provision_host_specification_plan: all_host_specs}) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined # - sap_vm_provision_iac_type == "ansible" @@ -104,7 +104,7 @@ group: sap_vm_provision_target_inventory_group loop: "{{ lookup('ansible.builtin.vars', sap_vm_provision_iac_platform + '_host_specifications_dictionary_scaleout')[sap_vm_provision_host_specification_plan].keys() | default(lookup('ansible.builtin.vars', 'sap_vm_provision_' + sap_vm_provision_iac_platform + '_host_specifications_dictionary')[sap_vm_provision_host_specification_plan].keys()) }}" when: - - sap_hana_scaleout_active_coordinator is defined + - sap_vm_provision_calculate_sap_hana_scaleout_active_coordinator is defined - sap_vm_provision_iac_type == "ansible" or sap_vm_provision_iac_type == "ansible_to_terraform" - name: Ansible Play to provision hosts for SAP @@ -339,12 +339,12 @@ - name: Ansible Vars extravars file check if non-interactive (no var prompts) requested by end user ansible.builtin.set_fact: sap_hana_install_addhosts: | - {%- if sap_hana_scaleout_standby > 0 -%} + {%- if sap_vm_provision_calculate_sap_hana_scaleout_standby > 0 -%} {%- for host in (groups['hana_primary'] | reject('search', '0') | list)[:-1] -%} {{ hostvars[host]['inventory_hostname_short'] }}:role=worker:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }}, {%- endfor -%} {{ hostvars[(groups['hana_primary'][-1])]['inventory_hostname_short'] }}:role=standby:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }} - {%- elif sap_hana_scaleout_standby == 0 -%} + {%- elif sap_vm_provision_calculate_sap_hana_scaleout_standby == 0 -%} {%- for host in (groups['hana_primary'] | reject('search', '0') | list) -%} {{ hostvars[host]['inventory_hostname_short'] }}:role=worker:workergroup={{ sap_hana_install_workergroup }}:group={{ sap_hana_install_group }} {%- endfor -%}