Skip to content

Commit

Permalink
Rename internal Ansible value
Browse files Browse the repository at this point in the history
Rename hana_resource_clone to hana_clone. Because resource is resource
and clone is clone of that resourcea nd because all others was named
just clone w/o resource.
  • Loading branch information
mpagot committed Oct 4, 2024
1 parent 03701e5 commit a5d98d6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions ansible/playbooks/tasks/aws-cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
- name: Set hana crm facts
ansible.builtin.set_fact:
crm_maintainence_mode: "{{ (crm_conf_hana_show.stdout | regex_search('maintenance-mode=([a-z]*)', '\\1'))[0] | default('unknown') }}"
hana_topology_clone: "{{ crm_conf_hana_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
stonith_timeout: "{{ crm_conf_hana_show.stdout | regex_search('stonith-timeout') }}" # this should be variable!
hana_topology_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_resource_clone: "{{ crm_conf_hana_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHana_') }}"
hana_clone: "{{ crm_conf_hana_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_topology_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_topology_clone: "{{ crm_conf_hana_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
ip_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_ip_') }}"
ip_nc: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_socat_') }}"
ip_grp: "{{ crm_conf_hana_show.stdout | regex_search('group g_ip_') }}"
ip_colo: "{{ crm_conf_hana_show.stdout | regex_search('colocation col_saphana_ip_') }}"
order: "{{ crm_conf_hana_show.stdout | regex_search('order ord_SAPHana_') }}"
cluster_order: "{{ crm_conf_hana_show.stdout | regex_search('order ord_SAPHana_') }}"
when: is_primary
changed_when: false

Expand Down Expand Up @@ -94,7 +94,7 @@
target-role="Started"
interleave="true"
when:
- hana_resource_clone | length == 0
- hana_clone | length == 0
- is_primary

- name: Configure colocation
Expand All @@ -115,7 +115,7 @@
2000:
cln_SAPHanaTopology_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}
msl_SAPHana_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}
when: order | length == 0
when: cluster_order | length == 0

# Get current maintainence state
- name: Refresh cluster status
Expand Down
14 changes: 7 additions & 7 deletions ansible/playbooks/tasks/azure-cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
register: crm_conf_show
changed_when: false

- name: Set crm facts
- name: Set hana crm facts
ansible.builtin.set_fact:
crm_maintenance_mode: "{{ (crm_conf_show.stdout | regex_search('maintenance-mode=([a-z]*)', '\\1'))[0] }}"
stonith_enabled: "{{ (crm_conf_show.stdout | regex_search('stonith-enabled=([a-z]*)', '\\1'))[0] | default('false') }}"
hana_topology_clone: "{{ crm_conf_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
stonith_timeout: "{{ crm_conf_show.stdout | regex_search('stonith-timeout') }}" # this should be variable!
hana_topology_resource: "{{ crm_conf_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_resource_clone: "{{ crm_conf_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_resource: "{{ crm_conf_show.stdout | regex_search('primitive rsc_SAPHana_') }}"
hana_clone: "{{ crm_conf_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_topology_resource: "{{ crm_conf_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_topology_clone: "{{ crm_conf_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
ip_resource: "{{ crm_conf_show.stdout | regex_search('primitive rsc_ip_') }}"
ip_nc: "{{ crm_conf_show.stdout | regex_search('primitive rsc_socat_') }}"
ip_grp: "{{ crm_conf_show.stdout | regex_search('group g_ip_') }}"
ip_colo: "{{ crm_conf_show.stdout | regex_search('colocation col_saphana_ip_') }}"
order: "{{ crm_conf_show.stdout | regex_search('order ord_SAPHana_') }}"
cluster_order: "{{ crm_conf_show.stdout | regex_search('order ord_SAPHana_') }}"
resource_stickiness: "{{ (crm_conf_show.stdout | regex_search('resource-stickiness=([0-9]*)', '\\1'))[0] }}"
migration_threshold: "{{ (crm_conf_show.stdout | regex_search('migration-threshold=([0-9]*)', '\\1'))[0] }}"
changed_when: false
Expand Down Expand Up @@ -104,7 +104,7 @@
target-role="Started"
interleave="true"
maintenance="true"
when: hana_resource_clone | length == 0
when: hana_clone | length == 0

- name: Validate cluster IP
vars:
Expand Down Expand Up @@ -169,7 +169,7 @@
Optional:
cln_SAPHanaTopology_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}
msl_SAPHana_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}
when: order | length == 0
when: cluster_order | length == 0

- name: Wait for cluster to settle
ansible.builtin.command:
Expand Down
12 changes: 6 additions & 6 deletions ansible/playbooks/tasks/cluster-hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
- name: Set hana crm facts
ansible.builtin.set_fact:
crm_maintainence_mode: "{{ (crm_conf_hana_show.stdout | regex_search('maintenance-mode=([a-z]*)', '\\1'))[0] | default('unknown') }}"
hana_topology_clone: "{{ crm_conf_hana_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
stonith_timeout: "{{ crm_conf_hana_show.stdout | regex_search('stonith-timeout') }}" # this should be variable!
hana_topology_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_resource_clone: "{{ crm_conf_hana_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHana_') }}"
hana_clone: "{{ crm_conf_hana_show.stdout | regex_search('ms msl_SAPHana_') }}"
hana_topology_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_SAPHanaTopology') }}"
hana_topology_clone: "{{ crm_conf_hana_show.stdout | regex_search('clone cln_SAPHanaTopology') }}"
ip_resource: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_ip_') }}"
ip_nc: "{{ crm_conf_hana_show.stdout | regex_search('primitive rsc_socat_') }}"
ip_grp: "{{ crm_conf_hana_show.stdout | regex_search('group g_ip_') }}"
ip_colo: "{{ crm_conf_hana_show.stdout | regex_search('colocation col_saphana_ip_') }}"
order: "{{ crm_conf_hana_show.stdout | regex_search('order ord_SAPHana') }}"
cluster_order: "{{ crm_conf_hana_show.stdout | regex_search('order ord_SAPHana') }}"
when: is_primary
changed_when: false

Expand Down Expand Up @@ -97,7 +97,7 @@
interleave="true"
when:
- is_primary
- hana_resource_clone | length == 0
- hana_clone | length == 0

- name: Configure colocation [aws]
ansible.builtin.command:
Expand Down Expand Up @@ -135,7 +135,7 @@
msl_SAPHana_HDB_{{ sap_hana_install_sid }}{{ sap_hana_install_instance_number }}
when:
- is_primary
- order | length == 0
- cluster_order | length == 0


# Get current maintenance state
Expand Down

0 comments on commit a5d98d6

Please sign in to comment.