Skip to content

Commit afeb1f1

Browse files
authored
Toggle SAPHanaSR-angi pattern ON/OFF (#426)
1 parent fa61562 commit afeb1f1

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

ansible/playbooks/sap-hana-preconfigure.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,31 @@
116116
ansible.builtin.include_tasks: ./tasks/saptune.yaml
117117
when: not use_sapconf | bool
118118

119-
# SAPHanaSR-angi -BEGIN-
119+
- name: SAPHanaSR package pattern
120+
ansible.builtin.set_fact:
121+
saphanasr_patterns: >-
122+
{{ ['absent', 'present' ]
123+
if ( use_hana_sr_angi | bool )
124+
else ['present', 'absent']
125+
}}
126+
120127
- name: Ensure SAPHanaSR-doc and SAPHanaSR is NOT installed when angi is used
121128
community.general.zypper:
122129
name: "{{ item }}"
123-
state: absent
130+
state: "{{ saphanasr_patterns[0] }}"
124131
loop:
125132
- 'SAPHanaSR-doc'
126133
- 'SAPHanaSR'
127-
when: use_hana_sr_angi | bool
134+
when: cluster_node
128135

129136
- name: Ensure SAPHanaSR-angi and supportutils plugin is installed when angi is used
130137
community.general.zypper:
131138
name: "{{ item }}"
132-
state: present
139+
state: "{{ saphanasr_patterns[1] }}"
133140
loop:
134141
- 'SAPHanaSR-angi'
135142
- 'supportutils-plugin-ha-sap'
136-
when: cluster_node and use_hana_sr_angi | bool
143+
when: cluster_node
137144

138145
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/reboot_module.html#parameters
139146
# reboot_timeout Maximum seconds to wait for machine to reboot and respond to a test command. Default: 600

0 commit comments

Comments
 (0)