forked from IBM/ibm-spectrum-scale-install-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook_cloud.yml
195 lines (170 loc) · 6.64 KB
/
playbook_cloud.yml
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
#
# samples/playbook_cloud.yml
#
# Playbook sample for deploying IBM Spectrum Scale (GPFS) cluster using
# inventory in JSON format.
# This file is mandatory to import and it will load inventory variables form
# vars/scale_clusterdefinition.json
- import_playbook: "set_json_variables.yml"
# Ensure provisioned VMs are up and Passwordless SSH setup
# has been compleated and operational
- name: Check passwordless SSH connection is setup
hosts: scale_node
any_errors_fatal: true
gather_facts: false
connection: local
tasks:
- name: Check passwordless SSH on all scale inventory hosts
shell: ssh -i {{ ansible_ssh_private_key_file }} {{ inventory_hostname }} "echo PASSWDLESS_SSH_ENABLED"
register: result
until: result.stdout.find("PASSWDLESS_SSH_ENABLED") != -1
retries: 30
delay: 10
# Ensure all provisioned VMs are running the supported OS versions
- name: Check for supported OS
hosts: scale_node
any_errors_fatal: true
gather_facts: true
tasks:
- name: Spectrum Scale Precheck | Check OS Distribution
assert:
that:
- ansible_distribution == "RedHat"
- ansible_distribution_major_version == "7" or ansible_distribution_major_version == "8"
- (ansible_distribution_version is match("7.7") or
ansible_distribution_version is match("7.8") or
ansible_distribution_version is match("8.1") or
ansible_distribution_version is match("8.2"))
fail_msg: "Only instances running RedHat Enterprise Linux version 7.7, 7.8, 8.1 and 8.2 are supported"
# Setup Spectrum Scale on nodes and create cluster
- hosts: scale_node
any_errors_fatal: true
vars:
- scale_install_directory_pkg_path: /opt/IBM/gpfs_cloud_rpms
roles:
- core/precheck
- core/node
- core/cluster
- gui/precheck
- gui/node
- gui/cluster
- gui/postcheck
- zimon/precheck
- zimon/node
- zimon/cluster
- zimon/postcheck
# Cloud deployment specific actions after Spectrum Scale
# cluster installation and setup
tasks:
- block:
- name: accept client lisence for compute descriptor node
command: /usr/lpp/mmfs/bin/mmchnode --client -N "computedescnodegrp"
- name: set filesystem
set_fact:
fs_name: "{{ scale_storage.0.filesystem }}"
when:
- scale_storage is defined
- name: create empty file on descriptor node
command: /usr/lpp/mmfs/bin/mmdsh -N "computedescnodegrp" touch /var/mmfs/etc/ignoreAnyMount.{{ fs_name }}
- name: unmount filesystem on descriptor node
command: /usr/lpp/mmfs/bin/mmumount {{ fs_name }} -N "computedescnodegrp"
run_once: true
when:
- scale_sync_replication_config | bool
- name: Prevent kernel upgrade
lineinfile:
path: /etc/yum.conf
line: exclude=kernel* redhat-release*
# Configure the Spectrum Scale Pagepool setings
- hosts: scale_node
any_errors_fatal: false
gather_facts: true
tasks:
- block:
- name: Spectrum Scale Config | Find Compute Nodes
add_host:
name: "{{ item }}"
groups: scale_compute_members
when:
- hostvars[item]['scale_nodeclass'] is defined and 'computenodegrp' in hostvars[item]['scale_nodeclass']
with_items: "{{ ansible_play_hosts }}"
changed_when: false
- name: Spectrum Scale Config | Find Storage Nodes
add_host:
name: "{{ item }}"
groups: scale_storage_members
when:
- hostvars[item]['scale_nodeclass'] is defined and 'storagenodegrp' in hostvars[item]['scale_nodeclass']
with_items: "{{ ansible_play_hosts }}"
changed_when: false
- name: Spectrum Scale Config | Determine Compute Node Total Memory
set_fact:
scale_compute_total_mem: "{{ hostvars[item]['ansible_memtotal_mb'] }}"
when: hostvars[item]['ansible_memtotal_mb'] is defined and hostvars[item]['ansible_memtotal_mb']
with_items: "{{ groups['scale_compute_members'].0 }}"
run_once: true
- name: Spectrum Scale Config | Determine Storage Node Total Memory
set_fact:
scale_storage_total_mem: "{{ hostvars[item]['ansible_memtotal_mb'] }}"
when: hostvars[item]['ansible_memtotal_mb'] is defined and hostvars[item]['ansible_memtotal_mb']
with_items: "{{ groups['scale_storage_members'].0 }}"
run_once: true
- name: Spectrum Scale Config | Determine Compute Node Pagepool Memory
set_fact:
scale_compute_total_mem_per: "{{ ((scale_compute_total_mem | int / 1024) * 0.25) | round(0, 'ceil') | int | abs }}"
when: scale_compute_total_mem is defined
run_once: true
- name: Spectrum Scale Config | Determine Storage Node Pagepool Memory
set_fact:
scale_storage_total_mem_per: "{{ ((scale_storage_total_mem | int / 1024) * 0.25) | round(0, 'ceil') | int | abs }}"
when: scale_storage_total_mem is defined
run_once: true
- name: Spectrum Scale Config | Define Compute Raw Pagepool Size
set_fact:
pagepool_compute: "{{ scale_compute_total_mem_per }}"
when: scale_compute_total_mem_per is defined
run_once: true
- name: Spectrum Scale Config | Define Storage Raw Pagepool Size
set_fact:
pagepool_storage: "{{ scale_storage_total_mem_per }}"
when: scale_storage_total_mem_per is defined
run_once: true
- name: Spectrum Scale Config | Check Compute Pagepool Floor Value
set_fact:
pagepool_compute: "1"
when:
- pagepool_compute is defined
- pagepool_compute | int < 1
run_once: true
- name: Spectrum Scale Config | Check Compute Pagepool Ceiling Value
set_fact:
pagepool_compute: "16"
when:
- pagepool_compute is defined
- pagepool_compute | int > 16
run_once: true
- name: Spectrum Scale Config | Check Storage Pagepool Floor Value
set_fact:
pagepool_storage: "1"
when:
- pagepool_storage is defined
- pagepool_storage | int < 1
run_once: true
- name: Spectrum Scale Config | Check Storage Pagepool Ceiling Value
set_fact:
pagepool_compute: "16"
when:
- pagepool_storage is defined
- pagepool_storage | int > 16
run_once: true
- name: Spectrum Scale Config | Assign Compute Pagepool
command: "/usr/lpp/mmfs/bin/mmchconfig pagepool={{ pagepool_compute }}G -i -N computenodegrp"
when:
- pagepool_compute is defined
run_once: true
- name: Spectrum Scale Config | Assign Storage Pagepool
command: "/usr/lpp/mmfs/bin/mmchconfig pagepool={{ pagepool_storage }}G -i -N storagenodegrp"
when:
- pagepool_storage is defined
run_once: true