Skip to content

Commit 5f7d12b

Browse files
authored
Merge pull request #186 from rajan-mis/admin_flag
Cloud deployment defect fixes for 64 node cluster , profile and admin flag implementation
2 parents b55ecea + e38f7b0 commit 5f7d12b

File tree

5 files changed

+54
-24
lines changed

5 files changed

+54
-24
lines changed

roles/core/cluster/tasks/check.yml

+17
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@
1616
set_fact:
1717
scale_daemon_nodename: "{{ scale_daemon_nodename }}"
1818
when: hostvars[inventory_hostname].scale_daemon_nodename is undefined
19+
20+
- name: cluster | Assign default admin nodes
21+
set_fact:
22+
is_admin_node: true
23+
when: true not in ansible_play_hosts | map('extract', hostvars, 'is_admin_node') | map('bool') | list
24+
with_sequence: start=1 end={{ [ ansible_play_hosts | length, 1 ] | min }}
25+
run_once: true
26+
delegate_to: "{{ ansible_play_hosts[item | int - 1] }}"
27+
delegate_facts: true
28+
29+
- name: cluster | Find admin nodes
30+
add_host:
31+
name: "{{ item }}"
32+
groups: scale_cluster_admin_nodes
33+
when: hostvars[item].is_admin_node is defined and hostvars[item].is_admin_node | bool
34+
with_items: "{{ ansible_play_hosts }}"
35+
changed_when: false

roles/core/cluster/tasks/cluster.yml

+29-24
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,35 @@
7474
- scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
7575
- scale_cluster_profile_name not in gpfs_cluster_system_profile
7676

77+
- block:
78+
- name: check | cluster profile name validation
79+
assert:
80+
that:
81+
- scale_cluster_profile_name is not match("gpfs.*")
82+
msg: >-
83+
A user-defined profile must not begin with the string 'gpfs'
84+
85+
- name: check | cluster profile format validation
86+
assert:
87+
that:
88+
- stat_user_profile_result.matched == 1
89+
msg: >-
90+
A user-defined profile must have the .profile suffix
91+
delegate_to: localhost
92+
when:
93+
- scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
94+
- scale_cluster_profile_name not in gpfs_cluster_system_profile
95+
96+
- block:
97+
- name: cluster | Copy user defined profile
98+
copy:
99+
src: "{{ stat_user_profile_result.files.0.path }}"
100+
dest: "{{ scale_cluster_profile_system_path }}"
101+
mode: a+x
102+
when:
103+
- scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
104+
- scale_cluster_profile_name not in gpfs_cluster_system_profile
105+
77106
#
78107
# Create new cluster
79108
#
@@ -89,30 +118,6 @@
89118
patterns: "{{ scale_cluster_profile_name }}.profile"
90119
register: stat_profile_result
91120

92-
- block:
93-
- name: check | cluster profile name validation
94-
assert:
95-
that:
96-
- scale_cluster_profile_name is not match("gpfs.*")
97-
msg: >-
98-
A user-defined profile must not begin with the string 'gpfs'
99-
100-
- name: check | cluster profile format validation
101-
assert:
102-
that:
103-
- stat_user_profile_result.matched == 1
104-
msg: >-
105-
A user-defined profile must have the .profile suffix
106-
107-
- name: cluster | Copy user defined profile
108-
copy:
109-
src: "{{ stat_user_profile_result.files.0.path }}"
110-
dest: "{{ scale_cluster_profile_system_path }}"
111-
mode: a+x
112-
when:
113-
- scale_cluster_profile_name is defined and scale_cluster_profile_name != 'None'
114-
- scale_cluster_profile_name not in gpfs_cluster_system_profile
115-
116121
- name: install | Initialize gpfs profile
117122
set_fact:
118123
profile_type: ""

roles/core/cluster/tasks/removenode.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
groups: scale_cluster_members
2323
when:
2424
- hostvars[item].state is defined and hostvars[item].state == 'present'
25+
- hostvars[item].is_admin_node is defined and hostvars[item].is_admin_node|bool
2526
- hostvars[item].scale_cluster_clusterId.stdout
2627
with_items: "{{ ansible_play_hosts }}"
2728
changed_when: false

roles/core/cluster/tasks/storage.yml

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
changed_when: false
3636
failed_when: false
3737
run_once: true
38+
delegate_to: "{{ groups['scale_cluster_admin_nodes'].0 }}"
3839

3940
- name: storage | Initialize undefined variables
4041
set_fact:
@@ -99,6 +100,10 @@
99100
- item.size > 1
100101
with_items: "{{ scale_storage_stanzafile_new.results }}"
101102

103+
- name: storage | Wait for NSD configuration to be synced across cluster
104+
wait_for:
105+
timeout: 30
106+
102107
#
103108
# Create new filesystems
104109
#
@@ -310,3 +315,4 @@
310315
- scale_storage_existing_fsmounts.stdout is search(':' + item.key + ':' + item.key + ':' + scale_cluster_clustername + ':0:')
311316
with_dict: "{{ scale_storage_fsparams | default({}) }}"
312317
run_once: true
318+
delegate_to: "{{ groups['scale_cluster_admin_nodes'].0 }}"

set_json_variables.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
scale_cluster_gui: "{{ item.is_gui_server | default(false) }}"
2929
scale_zimon_collector: "{{ item.is_collector_node | default(false) }}"
3030
state: "{{ item.state | default('present') }}"
31+
is_admin_node: "{{ item.is_admin_node | default('true') }}"
3132
scale_nodeclass: "{{ item.scale_nodeclass | default(omit) }}"
3233
scale_config: "{{ scale_config | default(omit) }}"
3334
ansible_ssh_private_key_file: "{{ item.ansible_ssh_private_key_file | default(omit) }}"

0 commit comments

Comments
 (0)