-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsap-hana-preconfigure.yaml
More file actions
156 lines (136 loc) · 4.96 KB
/
sap-hana-preconfigure.yaml
File metadata and controls
156 lines (136 loc) · 4.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
- name: SAP Hana preconfigure
hosts: hana
become: true
become_user: root
pre_tasks:
- name: Source hana install variables
ansible.builtin.include_vars: ./vars/hana_vars.yaml
- name: Detect cloud platform
ansible.builtin.include_tasks:
./tasks/detect-cloud-platform.yaml
vars:
# SAPHahaSR-angi
use_hana_sr_angi: "{{ use_sap_hana_sr_angi | default(false) }}"
scale_out: false
use_sapconf: false
# Set use_reboottimeout default value to 1200,
# as for AWS 'r5b.metal' instance type the reboot elapses at least 800 seconds
use_reboottimeout: 1200
use_connecttimeout: 10
saptune_solution: HANA
cluster_node: true
firewall_cfg: 'ignore'
tasks:
# Ensure required installation of required packages
- name: Ensure libssl 2.1 is installed on distributed Systems
community.general.zypper:
name: libssh2-1 # Caution, no version control here (yet)
state: present
when: scale_out | bool
- name: Ensure iscsi is installed
community.general.zypper:
name: "{{ item }}"
state: present
environment:
ZYPP_LOCK_TIMEOUT: '120'
retries: 5
delay: 30
loop:
- 'iscsiuio'
- 'open-iscsi'
when: use_sbd | default(false) | bool
- name: Update old SAPHanaSR on SLE 15-SP1
community.general.zypper:
name: SAPHanaSR=0.154.0
state: present
replacefiles: true
register: result
until: result is succeeded
retries: 3
delay: 60
when:
- ansible_facts['distribution_version'] == '15.1' and not use_hana_sr_angi | bool
# 3018133 - Linux: Running SAP applications compiled with GCC 10.x
- name: Ensure GCC10 is installed
community.general.zypper:
name: "{{ item }}"
state: present
oldpackage: true
loop:
- 'libgcc_s1>=10.2.1'
- 'libstdc++6>=10.2.1'
- 'libatomic1>=10.2.1'
register: result
until: result is succeeded
retries: 3
delay: 60
- name: Ensure ClusterTools2 is installed
community.general.zypper:
name: ClusterTools2
state: present
when: cluster_node | bool
- name: Validate firewall_cfg
ansible.builtin.assert:
that:
- firewall_cfg is defined
- firewall_cfg in ['ignore', 'enable', 'disable']
fail_msg: "Variable 'firewall_cfg' must be 'ignore', 'enable' or 'disable'. Found '{{ firewall_cfg }}'"
- name: Get service facts
ansible.builtin.service_facts:
- name: Debug firewall status on specific OS version
ansible.builtin.debug:
msg:
- "[OSADO][softfail] bsc#1254356"
- "The firewalld service is not stopped and disabled on this system."
when:
- ansible_distribution_major_version == '16'
- firewall_cfg != 'ignore' # avoid to hide the bug by forcing the firewall state
- name: Set firewall service state and enabled status
ansible.builtin.set_fact:
firewall_service_state: "{{ 'started' if firewall_cfg == 'enable' else 'stopped' }}"
firewall_service_enabled: "{{ 'yes' if firewall_cfg == 'enable' else 'no' }}"
- name: Configure the firewall service state
ansible.builtin.systemd:
name: firewalld
state: "{{ firewall_service_state }}"
enabled: "{{ firewall_service_enabled }}"
when: firewall_cfg != 'ignore'
- name: Configure sapconf based systems
ansible.builtin.include_tasks: ./tasks/sapconf.yaml
when: use_sapconf | bool
# saptune to be handled here with more included tasks!
- name: Configure saptune based systems
ansible.builtin.include_tasks: ./tasks/saptune.yaml
when: not use_sapconf | bool
- name: SAPHanaSR package pattern
ansible.builtin.set_fact:
saphanasr_patterns: >-
{{ ['absent', 'present' ]
if ( use_hana_sr_angi | bool )
else ['present', 'absent']
}}
- name: Ensure SAPHanaSR-doc and SAPHanaSR is NOT installed when angi is used
community.general.zypper:
name: "{{ item }}"
state: "{{ saphanasr_patterns[0] }}"
loop:
- 'SAPHanaSR-doc'
- 'SAPHanaSR'
when: cluster_node
- name: Ensure SAPHanaSR-angi and supportutils plugin is installed when angi is used
community.general.zypper:
name: "{{ item }}"
state: "{{ saphanasr_patterns[1] }}"
loop:
- 'SAPHanaSR-angi'
- 'supportutils-plugin-ha-sap'
when: cluster_node
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/reboot_module.html#parameters
# reboot_timeout Maximum seconds to wait for machine to reboot and respond to a test command. Default: 600
handlers:
- name: Reboot
ansible.builtin.reboot:
msg: "Reboot initiated by Ansible - after sap hana preconfigure"
reboot_timeout: "{{ use_reboottimeout | int }}"
connect_timeout: "{{ use_connecttimeout | int }}"