Skip to content

Commit c9d237e

Browse files
authored
Merge pull request #844 from IBM/dev
Dev to main
2 parents 87d4c86 + 0e4174c commit c9d237e

File tree

20 files changed

+432
-19
lines changed

20 files changed

+432
-19
lines changed

roles/core_configure/tasks/config.yml

+25
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,28 @@
139139
- ansible_architecture == "s390x"
140140
ignore_errors: yes
141141
run_once: true
142+
143+
- block:
144+
- name: config | Check if scaleApiEnabled config for scale api is set to yes
145+
command: "{{ scale_command_path }}mmlsconfig scaleApiEnabled"
146+
register: scale_scaleapienabled
147+
failed_when: false
148+
149+
- name: config | Setting scaleApiEnabled config for scale api
150+
command: "{{ scale_command_path }}mmchconfig scaleApiEnabled=yes --force"
151+
when:
152+
- scale_scaleapienabled.stdout is defined
153+
- "'yes' not in scale_scaleapienabled.stdout"
154+
register: scale_scaleapienabled_cmd
155+
failed_when: false
156+
157+
- debug:
158+
msg: "{{ scale_scaleapienabled_cmd.cmd }}"
159+
when: scale_scaleapienabled_cmd.cmd is defined
160+
ignore_errors: yes
161+
failed_when: false
162+
163+
when:
164+
- scale_type is defined
165+
ignore_errors: yes
166+
run_once: true

roles/core_configure/tasks/scaleadmd_cluster.yml

+66
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,32 @@
238238
msg: "{{scale_add_node_list}}"
239239
when: scale_add_node_list is defined
240240

241+
- name: cluster | Identify quorum nodes to be added on
242+
set_fact:
243+
scale_quorum_node_list: "{{ scale_quorum_node_list | default([]) + [hostvars[item].scale_daemon_nodename] }}"
244+
when:
245+
- hostvars[item].scale_state is defined and hostvars[item].scale_state != 'absent'
246+
- not hostvars[item].scale_cluster_clusterId.stdout
247+
- hostvars[item].scale_cluster_clusterId.stderr
248+
- hostvars[item].scale_cluster_quorum is defined and hostvars[item].scale_cluster_quorum | bool
249+
with_items:
250+
- "{{ ansible_play_hosts }}"
251+
changed_when: false
252+
253+
254+
- name: cluster | Identify manager nodes to be added on
255+
set_fact:
256+
scale_manager_node_list: "{{ scale_manager_node_list | default([]) + [hostvars[item].scale_daemon_nodename] }}"
257+
when:
258+
- hostvars[item].scale_state is defined and hostvars[item].scale_state != 'absent'
259+
- not hostvars[item].scale_cluster_clusterId.stdout
260+
- hostvars[item].scale_cluster_clusterId.stderr
261+
- hostvars[item].scale_cluster_manager is defined and hostvars[item].scale_cluster_manager | bool
262+
with_items:
263+
- "{{ ansible_play_hosts }}"
264+
changed_when: false
265+
266+
241267
- name: cluster | Prepare existing cluster NodeFile
242268
template:
243269
src: AddNodeFile.j2
@@ -268,12 +294,52 @@
268294
file:
269295
path: /var/mmfs/tmp/NodeFile
270296
state: absent
297+
298+
- name: cluster | Accept server license for quorum nodes
299+
command: /usr/lpp/mmfs/bin/mmchlicense server --accept -N "{{ scale_quorum_node_list | join(',') }}"
300+
when: scale_quorum_node_list is defined and scale_quorum_node_list |length > 0
301+
failed_when: false
302+
ignore_errors: yes
303+
304+
- name: cluster | Change roles of quorum nodes
305+
command: /usr/lpp/mmfs/bin/mmchnode --quorum -N "{{ scale_quorum_node_list | join(',') }}"
306+
when: scale_quorum_node_list is defined and scale_quorum_node_list |length > 0
307+
failed_when: false
308+
ignore_errors: yes
309+
310+
- name: cluster | Accept server license for manager nodes
311+
command: /usr/lpp/mmfs/bin/mmchlicense server --accept -N "{{ scale_manager_node_list | join(',') }}"
312+
when: scale_manager_node_list is defined and scale_manager_node_list |length > 0
313+
failed_when: false
314+
ignore_errors: yes
315+
316+
- name: cluster | Change roles of manager nodes
317+
command: /usr/lpp/mmfs/bin/mmchnode --manager -N "{{ scale_manager_node_list | join(',') }}"
318+
when: scale_manager_node_list is defined and scale_manager_node_list |length > 0
319+
failed_when: false
320+
ignore_errors: yes
321+
271322
when:
272323
- groups['scale_cluster_candidates'] is defined
273324
- groups['scale_cluster_members'] is defined
274325
run_once: true
275326
delegate_to: "{{ groups['scale_cluster_members'].0 }}"
276327

328+
- name: cluster | Node identity
329+
command: /usr/lpp/mmfs/bin/scalectl node config get
330+
register: nodeidentity_exist_results
331+
ignore_errors: yes
332+
failed_when: false
333+
334+
- name: cluster | Restart scaleadmd ( workaround)
335+
command: systemctl restart scaleadmd
336+
ignore_errors: yes
337+
failed_when: false
338+
when:
339+
- nodeidentity_exist_results.stderr is defined
340+
- ('"/var/mmfs/run/grpc.admin.sock" in nodeidentity_exist_results.stderr') or
341+
('"/var/mmfs/run/scaleadmd.grpc.sock" in nodeidentity_exist_results.stderr')
342+
277343
- meta: flush_handlers
278344

279345
# Node roles will be finalized after daemons are started...

roles/core_install/tasks/install_nodeid.yml

+27-15
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,58 @@
66
- block:
77
- name: install| Creates default directory
88
file:
9-
path: "{{ scale_node_id_config.cert_dir_location }}"
9+
path: "{{ hostvars[inventory_hostname].cert_dir_location }}"
1010
state: directory
1111
mode: '0600'
1212
recurse: yes
13-
when: scale_node_id_config.cert_dir_location is defined
13+
when: hostvars[inventory_hostname].cert_dir_location is defined
1414

1515
- name: install | Copy installation package to node
1616
copy:
17-
src: "{{ scale_node_id_config.cert }}"
18-
dest: "{{ scale_node_id_config.cert }}"
17+
src: "{{ hostvars[inventory_hostname].node_cert }}"
18+
dest: "{{ hostvars[inventory_hostname].node_cert }}"
1919
mode: '0600'
2020

2121
- name: install | Copy installation package to node
2222
copy:
23-
src: "{{ scale_node_id_config.key }}"
24-
dest: "{{ scale_node_id_config.key }}"
23+
src: "{{ hostvars[inventory_hostname].node_cert_key }}"
24+
dest: "{{ hostvars[inventory_hostname].node_cert_key }}"
2525
mode: '0600'
2626

2727
- name: install | Copy installation package to node
2828
copy:
29-
src: "{{ scale_node_id_config.chain }}"
30-
dest: "{{ scale_node_id_config.chain }}"
29+
src: "{{ hostvars[inventory_hostname].node_cert_chain }}"
30+
dest: "{{ hostvars[inventory_hostname].node_cert_chain }}"
3131
mode: '0600'
3232

3333
- name: cluster | Node identity
34-
command: /usr/lpp/mmfs/bin/scalectl nodeid get
34+
command: /usr/lpp/mmfs/bin/scalectl node config get
3535
register: nodeidentity_exist_results
36+
ignore_errors: yes
37+
failed_when: false
38+
39+
- name: cluster | Restart scaleadmd ( workaround)
40+
command: systemctl restart scaleadmd
41+
ignore_errors: yes
42+
failed_when: false
43+
when:
44+
- nodeidentity_exist_results.stderr is defined
45+
- ('"/var/mmfs/run/grpc.admin.sock" in nodeidentity_exist_results.stderr') or
46+
('"/var/mmfs/run/scaleadmd.grpc.sock" in nodeidentity_exist_results.stderr')
3647

3748
- debug:
3849
msg: "{{nodeidentity_exist_results}}"
3950

4051
- name: cluster | Node identity
41-
command: /usr/lpp/mmfs/bin/scalectl nodeid import --cert {{ scale_node_id_config.cert }} --key {{ scale_node_id_config.key }} --chain {{ scale_node_id_config.chain }}
52+
command: /usr/lpp/mmfs/bin/scalectl node config set --cert {{ hostvars[inventory_hostname].node_cert }} --key {{ hostvars[inventory_hostname].node_cert_key }} --chain {{ hostvars[inventory_hostname].node_cert_chain }}
4253
register: nodeidentity_results
43-
when: nodeidentity_exist_results.stdout_lines | length < 1
54+
retries: 5
55+
delay: 30
56+
#when: nodeidentity_exist_results.stdout_lines | length < 1
4457
when:
45-
- scale_node_id_config is defined
46-
- scale_node_id_config.cert is defined
47-
- scale_node_id_config.key is defined
48-
- scale_node_id_config.chain is defined
58+
- hostvars[inventory_hostname].node_cert is defined
59+
- hostvars[inventory_hostname].node_cert_key is defined
60+
- hostvars[inventory_hostname].node_cert_chain is defined
4961

5062
- debug:
5163
msg: "{{ nodeidentity_results.cmd }}"

roles/core_install/tasks/install_repository.yml

+27
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@
1919
- ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
2020
- scale_install_repository_url is defined
2121
- scale_install_repository_url != 'existing'
22+
23+
- name: install | Configure GPFS Scale API YUM repository
24+
yum_repository:
25+
name: spectrum-scale-scaleapi
26+
description: IBM Spectrum Scale Scale API (GPFS)
27+
baseurl: "{{ scale_install_repository_url }}scaleapi_rpms/"
28+
gpgcheck: "{{ scale_install_gpgcheck }}"
29+
repo_gpgcheck: no
30+
sslverify: no
31+
state: present
32+
notify: yum-clean-metadata
33+
when:
34+
- scale_scaleadmd is defined
35+
- ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
36+
- scale_install_repository_url is defined
37+
- scale_install_repository_url != 'existing'
38+
2239
#
2340
# Configure apt repository
2441
#
@@ -76,3 +93,13 @@
7693
scale_install_all_packages: "{{ scale_install_all_packages + [ item ] }}"
7794
when: scale_install_gplbin_package is undefined
7895
with_items: "{{ scale_install_gplsrc_packages }}"
96+
97+
#
98+
# Add GPFS packages for building scale-api from source
99+
#
100+
- name: install | Add scale api package to list
101+
set_fact:
102+
scale_install_all_packages: "{{ scale_install_all_packages + [ item ] }}"
103+
when: scale_scaleadmd is defined
104+
with_items:
105+
- gpfs.scaleapi

roles/core_install/tasks/main.yml

+8
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@
66

77
- import_tasks: build.yml
88
tags: build
9+
10+
- import_tasks: install_nodeid.yml
11+
tags: install
12+
when:
13+
- scale_scaleadmd is defined
14+
- hostvars[inventory_hostname].node_cert is defined and hostvars[inventory_hostname].node_cert != "None"
15+
- hostvars[inventory_hostname].node_cert_key is defined and hostvars[inventory_hostname].node_cert_key != "None"
16+
- hostvars[inventory_hostname].node_cert_chain is defined and hostvars[inventory_hostname].node_cert_chain != "None"

roles/core_upgrade/tasks/install_repository.yml

+26
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828
- scale_install_repository_url is defined
2929
- scale_install_repository_url != 'existing'
3030

31+
- name: upgrade | Configure GPFS Scale API YUM repository
32+
yum_repository:
33+
name: spectrum-scale-scaleapi
34+
description: IBM Spectrum Scale Scale API (GPFS)
35+
baseurl: "{{ scale_install_repository_url }}scaleapi_rpms/"
36+
gpgcheck: "{{ scale_install_gpgcheck }}"
37+
repo_gpgcheck: no
38+
sslverify: no
39+
state: present
40+
notify: yum-clean-metadata
41+
when:
42+
- scale_scaleadmd is defined
43+
- ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
44+
- scale_install_repository_url is defined
45+
- scale_install_repository_url != 'existing'
46+
3147
#
3248
# Configure apt repository
3349
#
@@ -128,3 +144,13 @@
128144
with_items:
129145
- gpfs.java*
130146
when: (is_scale_java_pkg_installed | bool)
147+
148+
#
149+
# Add GPFS packages for building scale-api from source
150+
#
151+
- name: install | Add scale api package to list
152+
set_fact:
153+
scale_install_all_packages: "{{ scale_install_all_packages + [ item ] }}"
154+
when: scale_scaleadmd is defined
155+
with_items:
156+
- gpfs.scaleapi

roles/fal_install/tasks/install_repository.yml

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
scale_fal_url: 'gpfs_debs/ubuntu/ubuntu22/'
4141
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '22'
4242

43+
- name: install | file audit logging path
44+
set_fact:
45+
scale_fal_url: 'gpfs_debs/ubuntu/ubuntu24/'
46+
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '24'
47+
4348
- name: install | file audit logging path
4449
set_fact:
4550
scale_fal_url: 'gpfs_rpms/sles15/'

roles/fal_upgrade/tasks/install_repository.yml

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
scale_fal_url: 'gpfs_debs/ubuntu/ubuntu22/'
4848
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '22'
4949

50+
- name: upgrade | file audit logging path
51+
set_fact:
52+
scale_fal_url: 'gpfs_debs/ubuntu/ubuntu24/'
53+
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '24'
54+
5055
- name: upgrade | file audit logging path
5156
set_fact:
5257
scale_fal_url: 'gpfs_rpms/sles15/'

roles/nfs_install/tasks/install_repository.yml

+10
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
scale_smb_url: 'smb_debs/ubuntu/ubuntu22/'
6161
when: ansible_distribution_major_version == '22'
6262

63+
- name: install | smb path
64+
set_fact:
65+
scale_smb_url: 'smb_debs/ubuntu/ubuntu24/'
66+
when: ansible_distribution_major_version == '24'
67+
6368
- name: install | nfs path
6469
set_fact:
6570
scale_nfs_url: 'ganesha_debs/ubuntu/ubuntu20/'
@@ -69,6 +74,11 @@
6974
set_fact:
7075
scale_nfs_url: 'ganesha_debs/ubuntu/ubuntu22/'
7176
when: ansible_distribution_major_version == '22'
77+
78+
- name: install | nfs path
79+
set_fact:
80+
scale_nfs_url: 'ganesha_debs/ubuntu/ubuntu24/'
81+
when: ansible_distribution_major_version == '24'
7282
when:
7383
- ansible_distribution in scale_ubuntu_distribution
7484
- scale_version >= "5.1.4.0"

roles/nfs_upgrade/tasks/install_repository.yml

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
set_fact:
7575
scale_nfs_url: 'ganesha_debs/ubuntu/ubuntu22/'
7676
when: ansible_distribution_major_version == '22'
77+
78+
- name: upgrade | nfs path
79+
set_fact:
80+
scale_nfs_url: 'ganesha_debs/ubuntu/ubuntu24/'
81+
when: ansible_distribution_major_version == '24'
7782
when:
7883
- ansible_distribution in scale_ubuntu_distribution
7984
- scale_version >= "5.1.4.0"

roles/openldap_common/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Role Definition
2+
-------------------------------
3+
- Role name: OpenLDAP
4+
- Definition:
5+
- Stand-alone LDAP Load Balancer Daemon (server or slapd module).
6+
7+
Requirements
8+
------------
9+
10+
- Ubuntu 22.04
11+
12+
Role Variables
13+
--------------
14+
15+
- The parameters required to configure are as follows:
16+
17+
```
18+
ldap_domain: "example.com"
19+
ldap_organization: "Example Organization"
20+
ldap_admin_password: "Passw0rd"
21+
ldap_basedn: "dc=example,dc=com"
22+
ldap_admin_dn: "cn=admin,{{ ldap_basedn }}"
23+
default_usergroup: "sample_group"
24+
default_user: "john"
25+
default_user_password: "Passw0rd"
26+
```
27+
28+
`default_usergroup`, `default_user`, `default_user_password` are optional.
29+
30+
Example Playbook
31+
----------------
32+
33+
```
34+
- hosts: servers
35+
roles:
36+
- openldap-common
37+
```
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Variables for the OpenLDAP role
3+
ldap_domain: ""
4+
ldap_organization: ""
5+
ldap_admin_password: ""
6+
ldap_basedn: ""
7+
ldap_admin_dn: ""
8+
default_usergroup: ""
9+
default_user: ""
10+
default_user_password: ""

0 commit comments

Comments
 (0)